Skip to content

Instantly share code, notes, and snippets.

@snaga
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snaga/82173bd49749ccf0fa6c to your computer and use it in GitHub Desktop.
Save snaga/82173bd49749ccf0fa6c to your computer and use it in GitHub Desktop.
test_brin.sql
-- for more details, visit below.
-- http://michael.otacoo.com/postgresql-2/postgres-9-5-feature-highlight-brin-indexes/
\timing
CREATE TABLE brin_example AS SELECT generate_series(1,100000000) AS id;
CREATE INDEX brin_index ON brin_example USING brin(id);
EXPLAIN ANALYZE SELECT id FROM brin_example WHERE id = 52342323;
CREATE INDEX btree_index ON brin_example(id);
EXPLAIN ANALYZE SELECT id FROM brin_example WHERE id = 52342323;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment