Navigation Menu

Skip to content

Commit

Permalink
test: add tests for ILIKE with regular expression
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 28, 2015
1 parent 6047ef8 commit 58c7541
Show file tree
Hide file tree
Showing 48 changed files with 540 additions and 0 deletions.
22 changes: 22 additions & 0 deletions expected/regexp/text/ilike/begin-of-text/bitmapscan.out
@@ -0,0 +1,22 @@
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.');
INSERT INTO memos VALUES (4, 'groonga command is provided.');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = off;
SET enable_indexscan = off;
SET enable_bitmapscan = on;
SELECT id, content
FROM memos
WHERE content ILIKE 'GROONGA%';
id | content
----+------------------------------------------
2 | Groonga is fast full text search engine.
4 | groonga command is provided.
(2 rows)

DROP TABLE memos;
22 changes: 22 additions & 0 deletions expected/regexp/text/ilike/begin-of-text/indexscan.out
@@ -0,0 +1,22 @@
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.');
INSERT INTO memos VALUES (4, 'groonga command is provided.');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = off;
SET enable_indexscan = on;
SET enable_bitmapscan = off;
SELECT id, content
FROM memos
WHERE content ILIKE 'GROONGA%';
id | content
----+------------------------------------------
2 | Groonga is fast full text search engine.
4 | groonga command is provided.
(2 rows)

DROP TABLE memos;
22 changes: 22 additions & 0 deletions expected/regexp/text/ilike/begin-of-text/seqscan.out
@@ -0,0 +1,22 @@
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.');
INSERT INTO memos VALUES (4, 'groonga command is provided.');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = on;
SET enable_indexscan = off;
SET enable_bitmapscan = off;
SELECT id, content
FROM memos
WHERE content ILIKE 'GROONGA%';
id | content
----+------------------------------------------
2 | Groonga is fast full text search engine.
4 | groonga command is provided.
(2 rows)

DROP TABLE memos;
21 changes: 21 additions & 0 deletions expected/regexp/text/ilike/end-of-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');
INSERT INTO memos VALUES (4, 'groonga command is provided');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = off;
SET enable_indexscan = off;
SET enable_bitmapscan = on;
SELECT id, content
FROM memos
WHERE content ILIKE '%GROONGA';
id | content
----+------------------------------------------------------
3 | PGroonga is a PostgreSQL extension that uses Groonga
(1 row)

DROP TABLE memos;
21 changes: 21 additions & 0 deletions expected/regexp/text/ilike/end-of-text/indexscan.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');
INSERT INTO memos VALUES (4, 'groonga command is provided');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = off;
SET enable_indexscan = on;
SET enable_bitmapscan = off;
SELECT id, content
FROM memos
WHERE content ILIKE '%GROONGA';
id | content
----+------------------------------------------------------
3 | PGroonga is a PostgreSQL extension that uses Groonga
(1 row)

DROP TABLE memos;
21 changes: 21 additions & 0 deletions expected/regexp/text/ilike/end-of-text/seqscan.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');
INSERT INTO memos VALUES (4, 'groonga command is provided');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = on;
SET enable_indexscan = off;
SET enable_bitmapscan = off;
SELECT id, content
FROM memos
WHERE content ILIKE '%GROONGA';
id | content
----+------------------------------------------------------
3 | PGroonga is a PostgreSQL extension that uses Groonga
(1 row)

DROP TABLE memos;
22 changes: 22 additions & 0 deletions expected/regexp/text/ilike/exact/bitmapscan.out
@@ -0,0 +1,22 @@
CREATE TABLE memos (
id integer,
content text
);
INSERT INTO memos VALUES (1, 'PostgreSQL');
INSERT INTO memos VALUES (2, 'Groonga');
INSERT INTO memos VALUES (3, 'PGroonga');
INSERT INTO memos VALUES (4, 'groonga');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = off;
SET enable_indexscan = off;
SET enable_bitmapscan = on;
SELECT id, content
FROM memos
WHERE content ILIKE 'GROONGA';
id | content
----+---------
2 | Groonga
4 | groonga
(2 rows)

DROP TABLE memos;
22 changes: 22 additions & 0 deletions expected/regexp/text/ilike/exact/indexscan.out
@@ -0,0 +1,22 @@
CREATE TABLE memos (
id integer,
content text
);
INSERT INTO memos VALUES (1, 'PostgreSQL');
INSERT INTO memos VALUES (2, 'Groonga');
INSERT INTO memos VALUES (3, 'PGroonga');
INSERT INTO memos VALUES (4, 'groonga');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = off;
SET enable_indexscan = on;
SET enable_bitmapscan = off;
SELECT id, content
FROM memos
WHERE content ILIKE 'GROONGA';
id | content
----+---------
2 | Groonga
4 | groonga
(2 rows)

DROP TABLE memos;
22 changes: 22 additions & 0 deletions expected/regexp/text/ilike/exact/seqscan.out
@@ -0,0 +1,22 @@
CREATE TABLE memos (
id integer,
content text
);
INSERT INTO memos VALUES (1, 'PostgreSQL');
INSERT INTO memos VALUES (2, 'Groonga');
INSERT INTO memos VALUES (3, 'PGroonga');
INSERT INTO memos VALUES (4, 'groonga');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = on;
SET enable_indexscan = off;
SET enable_bitmapscan = off;
SELECT id, content
FROM memos
WHERE content ILIKE 'GROONGA';
id | content
----+---------
2 | Groonga
4 | groonga
(2 rows)

DROP TABLE memos;
23 changes: 23 additions & 0 deletions expected/regexp/text/ilike/partial/bitmapscan.out
@@ -0,0 +1,23 @@
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.');
INSERT INTO memos VALUES (4, 'groonga command is provided.');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = off;
SET enable_indexscan = off;
SET enable_bitmapscan = on;
SELECT id, content
FROM memos
WHERE content ILIKE '%GROONGA%';
id | content
----+-------------------------------------------------------
2 | Groonga is fast full text search engine.
3 | PGroonga is a PostgreSQL extension that uses Groonga.
4 | groonga command is provided.
(3 rows)

DROP TABLE memos;
23 changes: 23 additions & 0 deletions expected/regexp/text/ilike/partial/indexscan.out
@@ -0,0 +1,23 @@
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.');
INSERT INTO memos VALUES (4, 'groonga command is provided.');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = off;
SET enable_indexscan = on;
SET enable_bitmapscan = off;
SELECT id, content
FROM memos
WHERE content ILIKE '%GROONGA%';
id | content
----+-------------------------------------------------------
2 | Groonga is fast full text search engine.
3 | PGroonga is a PostgreSQL extension that uses Groonga.
4 | groonga command is provided.
(3 rows)

DROP TABLE memos;
23 changes: 23 additions & 0 deletions expected/regexp/text/ilike/partial/seqscan.out
@@ -0,0 +1,23 @@
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.');
INSERT INTO memos VALUES (4, 'groonga command is provided.');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = on;
SET enable_indexscan = off;
SET enable_bitmapscan = off;
SELECT id, content
FROM memos
WHERE content ILIKE '%GROONGA%';
id | content
----+-------------------------------------------------------
2 | Groonga is fast full text search engine.
3 | PGroonga is a PostgreSQL extension that uses Groonga.
4 | groonga command is provided.
(3 rows)

DROP TABLE memos;
1 change: 1 addition & 0 deletions expected/regexp/text/like/begin-of-text/bitmapscan.out
Expand Up @@ -5,6 +5,7 @@ CREATE TABLE memos (
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.');
INSERT INTO memos VALUES (4, 'groonga command is provided.');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = off;
SET enable_indexscan = off;
Expand Down
1 change: 1 addition & 0 deletions expected/regexp/text/like/begin-of-text/indexscan.out
Expand Up @@ -5,6 +5,7 @@ CREATE TABLE memos (
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.');
INSERT INTO memos VALUES (4, 'groonga command is provided.');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = off;
SET enable_indexscan = on;
Expand Down
1 change: 1 addition & 0 deletions expected/regexp/text/like/begin-of-text/seqscan.out
Expand Up @@ -5,6 +5,7 @@ CREATE TABLE memos (
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.');
INSERT INTO memos VALUES (4, 'groonga command is provided.');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = on;
SET enable_indexscan = off;
Expand Down
1 change: 1 addition & 0 deletions expected/regexp/text/like/end-of-text/bitmapscan.out
Expand Up @@ -5,6 +5,7 @@ CREATE TABLE memos (
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');
INSERT INTO memos VALUES (4, 'groonga command is provided');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = off;
SET enable_indexscan = off;
Expand Down
1 change: 1 addition & 0 deletions expected/regexp/text/like/end-of-text/indexscan.out
Expand Up @@ -5,6 +5,7 @@ CREATE TABLE memos (
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');
INSERT INTO memos VALUES (4, 'groonga command is provided');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = off;
SET enable_indexscan = on;
Expand Down
1 change: 1 addition & 0 deletions expected/regexp/text/like/end-of-text/seqscan.out
Expand Up @@ -5,6 +5,7 @@ CREATE TABLE memos (
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');
INSERT INTO memos VALUES (4, 'groonga command is provided');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = on;
SET enable_indexscan = off;
Expand Down
1 change: 1 addition & 0 deletions expected/regexp/text/like/exact/bitmapscan.out
Expand Up @@ -5,6 +5,7 @@ CREATE TABLE memos (
INSERT INTO memos VALUES (1, 'PostgreSQL');
INSERT INTO memos VALUES (2, 'Groonga');
INSERT INTO memos VALUES (3, 'PGroonga');
INSERT INTO memos VALUES (4, 'groonga');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = off;
SET enable_indexscan = off;
Expand Down
1 change: 1 addition & 0 deletions expected/regexp/text/like/exact/indexscan.out
Expand Up @@ -5,6 +5,7 @@ CREATE TABLE memos (
INSERT INTO memos VALUES (1, 'PostgreSQL');
INSERT INTO memos VALUES (2, 'Groonga');
INSERT INTO memos VALUES (3, 'PGroonga');
INSERT INTO memos VALUES (4, 'groonga');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = off;
SET enable_indexscan = on;
Expand Down
1 change: 1 addition & 0 deletions expected/regexp/text/like/exact/seqscan.out
Expand Up @@ -5,6 +5,7 @@ CREATE TABLE memos (
INSERT INTO memos VALUES (1, 'PostgreSQL');
INSERT INTO memos VALUES (2, 'Groonga');
INSERT INTO memos VALUES (3, 'PGroonga');
INSERT INTO memos VALUES (4, 'groonga');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = on;
SET enable_indexscan = off;
Expand Down
1 change: 1 addition & 0 deletions expected/regexp/text/like/partial/bitmapscan.out
Expand Up @@ -5,6 +5,7 @@ CREATE TABLE memos (
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.');
INSERT INTO memos VALUES (4, 'groonga command is provided.');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = off;
SET enable_indexscan = off;
Expand Down
1 change: 1 addition & 0 deletions expected/regexp/text/like/partial/indexscan.out
Expand Up @@ -5,6 +5,7 @@ CREATE TABLE memos (
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.');
INSERT INTO memos VALUES (4, 'groonga command is provided.');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = off;
SET enable_indexscan = on;
Expand Down
1 change: 1 addition & 0 deletions expected/regexp/text/like/partial/seqscan.out
Expand Up @@ -5,6 +5,7 @@ CREATE TABLE memos (
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.');
INSERT INTO memos VALUES (4, 'groonga command is provided.');
CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);
SET enable_seqscan = on;
SET enable_indexscan = off;
Expand Down
21 changes: 21 additions & 0 deletions sql/regexp/text/ilike/begin-of-text/bitmapscan.sql
@@ -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.');
INSERT INTO memos VALUES (4, 'groonga command is provided.');

CREATE INDEX grnindex ON memos USING pgroonga (content pgroonga.text_regexp_ops);

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

SELECT id, content
FROM memos
WHERE content ILIKE 'GROONGA%';

DROP TABLE memos;

0 comments on commit 58c7541

Please sign in to comment.