Skip to content

Instantly share code, notes, and snippets.

@akdor1154
Created February 13, 2023 02:41
Show Gist options
  • Select an option

  • Save akdor1154/88f192f4d4bc2e747d98fce235a7d138 to your computer and use it in GitHub Desktop.

Select an option

Save akdor1154/88f192f4d4bc2e747d98fce235a7d138 to your computer and use it in GitHub Desktop.
create temp table jarrad_test(t1 int, t2 int);
insert into jarrad_test(t1, t2)
select
t1,
case when t1 % 10 = 0 then 2 else 1 end as t2
from generate_series(1, 9999) t(t1);
create index btree_to_order on jarrad_test(t1, t2);
create index brin on jarrad_test using brin(t1, t2);
cluster jarrad_test using btree_to_order;
create extension pageinspect;
select * from brin_page_items(get_raw_page('brin', 2), 'brin') order by blknum, attnum;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment