Navigation Menu

Skip to content

Commit

Permalink
Add a test for seqscan match
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 18, 2015
1 parent 1d3234a commit 2c8b67f
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 3 deletions.
7 changes: 6 additions & 1 deletion Makefile
Expand Up @@ -6,7 +6,7 @@ DATA = pgroonga--0.2.0.sql
PG_CPPFLAGS = $(shell pkg-config --cflags groonga)
SHLIB_LINK = $(shell pkg-config --libs groonga)
# REGRESS = pgroonga update bench
REGRESS = install
REGRESS = $(shell find sql -name '*.sql' | sed -e 's,\(^sql/\|\.sql$$\),,g')

ifdef DEBUG
COPT += -O0 -g3 -DPGROONGA_DEBUG=1
Expand All @@ -16,3 +16,8 @@ endif
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)

installcheck: results/text

results/text:
@mkdir -p results/text
1 change: 0 additions & 1 deletion expected/install.out

This file was deleted.

21 changes: 21 additions & 0 deletions expected/text/seqscan.out
@@ -0,0 +1,21 @@
CREATE EXTENSION pgroonga;
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 = on;
SET enable_indexscan = off;
SET enable_bitmapscan = off;
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)

1 change: 0 additions & 1 deletion sql/install.sql

This file was deleted.

20 changes: 20 additions & 0 deletions sql/text/seqscan.sql
@@ -0,0 +1,20 @@
CREATE EXTENSION pgroonga;

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 = on;
SET enable_indexscan = off;
SET enable_bitmapscan = off;

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

0 comments on commit 2c8b67f

Please sign in to comment.