Created
September 7, 2021 15:17
-
-
Save onderkalaci/c83f38dd71aaf02afc999d92af25e59c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE columnar_test(col_int integer, col_text text, col_text_compressed text COMPRESSION pglz, col_json_b jsonb) USING COLUMNAR; | |
| BEGIN; | |
| insert into columnar_test SELECT i, i::text, i::text, test_jsonb() FROM generate_series(0,1000000)i; | |
| CREATE INDEX i1 ON columnar_test(col_int, col_text, col_text_compressed, col_json_b); | |
| set enable_seqscan to off; set columnar.enable_custom_scan to off; | |
| EXPLAIN SELECT count(*) FROM columnar_test WHERE col_int = random(); | |
| -- works fine | |
| SELECT count(*) FROM columnar_test WHERE col_int = random(); | |
| -- works fine | |
| insert into columnar_test SELECT i, i::text, i::text, test_jsonb() FROM generate_series(0,1000000)i; | |
| -- never finishes | |
| SELECT count(*) FROM columnar_test WHERE col_int = random(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment