File: hypo_brin.sql

package info (click to toggle)
hypopg 1.4.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 464 kB
  • sloc: ansic: 2,338; sql: 357; makefile: 66; python: 51; sh: 2
file content (18 lines) | stat: -rw-r--r-- 460 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-- Hypothetical BRIN index tests

CREATE TABLE hypo_brin (id integer);

INSERT INTO hypo_brin SELECT generate_series(1, 10000);

ANALYZE hypo_brin;

SELECT COUNT(*) AS nb
FROM public.hypopg_create_index('CREATE INDEX ON hypo_brin USING brin (id);');


-- Should use hypothetical index
SET enable_seqscan = 0;
SELECT COUNT(*) FROM do_explain('SELECT * FROM hypo_brin WHERE id = 1') e
WHERE e ~ 'Bitmap Index Scan.*<\d+>brin_hypo_brin.*';

DROP TABLE hypo_brin;