drop table if exists t;

set max_parallel_workers_per_gather = 0;

create table t (a int, b bigint, c text) with (fillfactor = 50);

insert into t select 1000000 * random(), 1000000 * random(), md5((1000000 * random())::int::text) from generate_series(1,1000000) s(i);

select count(*) from (select distinct b from t where ctid < '(128,0)'::tid) foo;

create index bloom_a_idx on t using brin (a int4_bloom_ops(n_distinct_per_range=6000)); 

analyze t;

explain select * from t where a = 1000;

create index brin_idx on t using brin (a);
analyze t;

explain select * from t where a = 1000;

drop index brin_idx;

explain select * from t where a = 1000;
