fill_data.sql
application/sql
Filename: fill_data.sql
Type: application/sql
Part: 3
drop table if exists t1;
create table t1(a bigint, b text) with (autovacuum_enabled =false, fillfactor = 10);
insert into t1 (a,b) select x ,'z1mh3sf2xkv5v55sjiruap2cs59gv4w6dx2vdusjfdef51mk2wvby7r9qlqw56g2y7zsohr0gbt2e94f82kwai7llbzy20fuaqvncaoyofnukh43bsbd3b9uk5wk' from generate_series(1,500000) x;
create index t1_brin_idx on t1 using brin (b) with (pages_per_range = 1);
select pg_size_pretty(pg_relation_size('t1_brin_idx')) as idx_size,
pg_size_pretty(pg_relation_size('t1')) as rel_size,
pg_relation_size('t1_brin_idx')/8192 as num_of_pages;
vacuum t1;