Navigation Menu

Skip to content

Commit

Permalink
Add a test for bitmapscan
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 18, 2015
1 parent 4b2d48f commit 6835862
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
21 changes: 21 additions & 0 deletions expected/text/bitmapscan.out
@@ -0,0 +1,21 @@
CREATE TABLE memos (
id integer,
content text
);
INSERT INTO memos VALUES (1, 'PostgreSQL is a RDBMS.');
INSERT INTO memos VALUES (2, 'Groonga is fast full text search engine.');
INSERT INTO memos VALUES (3, 'PGroonga is a PostgreSQL extension that uses Groonga.');
CREATE INDEX grnindex ON memos USING pgroonga (content);
SET enable_seqscan = off;
SET enable_indexscan = off;
SET enable_bitmapscan = on;
SELECT id, content
FROM memos
WHERE content %% 'Groonga';
id | content
----+-------------------------------------------------------
2 | Groonga is fast full text search engine.
3 | PGroonga is a PostgreSQL extension that uses Groonga.
(2 rows)

DROP TABLE memos;
20 changes: 20 additions & 0 deletions sql/text/bitmapscan.sql
@@ -0,0 +1,20 @@
CREATE TABLE memos (
id integer,
content text
);

INSERT INTO memos VALUES (1, 'PostgreSQL is a RDBMS.');
INSERT INTO memos VALUES (2, 'Groonga is fast full text search engine.');
INSERT INTO memos VALUES (3, 'PGroonga is a PostgreSQL extension that uses Groonga.');

CREATE INDEX grnindex ON memos USING pgroonga (content);

SET enable_seqscan = off;
SET enable_indexscan = off;
SET enable_bitmapscan = on;

SELECT id, content
FROM memos
WHERE content %% 'Groonga';

DROP TABLE memos;

0 comments on commit 6835862

Please sign in to comment.