Kouhei Sutou
null+****@clear*****
Tue May 2 17:24:11 JST 2017
Kouhei Sutou 2017-05-02 17:24:11 +0900 (Tue, 02 May 2017) New Revision: a451a8430960081be223d167ec52c6a646e5e051 https://github.com/pgroonga/pgroonga/commit/a451a8430960081be223d167ec52c6a646e5e051 Message: Add pgroonga.text_regexp_ops_v2 and varchar version Added files: expected/regexp/text/compatibility/v2/regexp-v1/begin-of-text/bitmapscan.out expected/regexp/text/compatibility/v2/regexp-v1/begin-of-text/indexscan.out expected/regexp/text/compatibility/v2/regexp-v1/begin-of-text/seqscan.out expected/regexp/text/compatibility/v2/regexp-v1/dot/bitmapscan.out expected/regexp/text/compatibility/v2/regexp-v1/dot/indexscan.out expected/regexp/text/compatibility/v2/regexp-v1/dot/seqscan.out expected/regexp/text/compatibility/v2/regexp-v1/end-of-text/bitmapscan.out expected/regexp/text/compatibility/v2/regexp-v1/end-of-text/indexscan.out expected/regexp/text/compatibility/v2/regexp-v1/end-of-text/seqscan.out expected/regexp/text/compatibility/v2/regexp-v1/exact/bitmapscan.out expected/regexp/text/compatibility/v2/regexp-v1/exact/indexscan.out expected/regexp/text/compatibility/v2/regexp-v1/exact/seqscan.out expected/regexp/text/compatibility/v2/regexp-v1/partial/bitmapscan.out expected/regexp/text/compatibility/v2/regexp-v1/partial/indexscan.out expected/regexp/text/compatibility/v2/regexp-v1/partial/seqscan.out expected/regexp/text/ilike-v2/begin-of-text/bitmapscan.out expected/regexp/text/ilike-v2/begin-of-text/indexscan.out expected/regexp/text/ilike-v2/begin-of-text/seqscan.out expected/regexp/text/ilike-v2/end-of-text/bitmapscan.out expected/regexp/text/ilike-v2/end-of-text/indexscan.out expected/regexp/text/ilike-v2/end-of-text/seqscan.out expected/regexp/text/ilike-v2/exact/bitmapscan.out expected/regexp/text/ilike-v2/exact/indexscan.out expected/regexp/text/ilike-v2/exact/seqscan.out expected/regexp/text/ilike-v2/partial/bitmapscan.out expected/regexp/text/ilike-v2/partial/indexscan.out expected/regexp/text/ilike-v2/partial/seqscan.out expected/regexp/text/like-v2/begin-of-text/bitmapscan.out expected/regexp/text/like-v2/begin-of-text/indexscan.out expected/regexp/text/like-v2/begin-of-text/seqscan.out expected/regexp/text/like-v2/end-of-text/bitmapscan.out expected/regexp/text/like-v2/end-of-text/indexscan.out expected/regexp/text/like-v2/end-of-text/seqscan.out expected/regexp/text/like-v2/exact/bitmapscan.out expected/regexp/text/like-v2/exact/indexscan.out expected/regexp/text/like-v2/exact/seqscan.out expected/regexp/text/like-v2/partial/bitmapscan.out expected/regexp/text/like-v2/partial/indexscan.out expected/regexp/text/like-v2/partial/seqscan.out expected/regexp/text/regexp-v2/begin-of-text/bitmapscan.out expected/regexp/text/regexp-v2/begin-of-text/indexscan.out expected/regexp/text/regexp-v2/begin-of-text/seqscan.out expected/regexp/text/regexp-v2/dot/bitmapscan.out expected/regexp/text/regexp-v2/dot/indexscan.out expected/regexp/text/regexp-v2/dot/seqscan.out expected/regexp/text/regexp-v2/end-of-text/bitmapscan.out expected/regexp/text/regexp-v2/end-of-text/indexscan.out expected/regexp/text/regexp-v2/end-of-text/seqscan.out expected/regexp/text/regexp-v2/exact/bitmapscan.out expected/regexp/text/regexp-v2/exact/indexscan.out expected/regexp/text/regexp-v2/exact/seqscan.out expected/regexp/text/regexp-v2/partial/bitmapscan.out expected/regexp/text/regexp-v2/partial/indexscan.out expected/regexp/text/regexp-v2/partial/seqscan.out expected/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/bitmapscan.out expected/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/indexscan.out expected/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/seqscan.out expected/regexp/varchar/compatibility/v2/regexp-v1/dot/bitmapscan.out expected/regexp/varchar/compatibility/v2/regexp-v1/dot/indexscan.out expected/regexp/varchar/compatibility/v2/regexp-v1/dot/seqscan.out expected/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/bitmapscan.out expected/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/indexscan.out expected/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/seqscan.out expected/regexp/varchar/compatibility/v2/regexp-v1/exact/bitmapscan.out expected/regexp/varchar/compatibility/v2/regexp-v1/exact/indexscan.out expected/regexp/varchar/compatibility/v2/regexp-v1/exact/seqscan.out expected/regexp/varchar/compatibility/v2/regexp-v1/partial/bitmapscan.out expected/regexp/varchar/compatibility/v2/regexp-v1/partial/indexscan.out expected/regexp/varchar/compatibility/v2/regexp-v1/partial/seqscan.out expected/regexp/varchar/regexp-v2/begin-of-text/bitmapscan.out expected/regexp/varchar/regexp-v2/begin-of-text/indexscan.out expected/regexp/varchar/regexp-v2/begin-of-text/seqscan.out expected/regexp/varchar/regexp-v2/dot/bitmapscan.out expected/regexp/varchar/regexp-v2/dot/indexscan.out expected/regexp/varchar/regexp-v2/dot/seqscan.out expected/regexp/varchar/regexp-v2/end-of-text/bitmapscan.out expected/regexp/varchar/regexp-v2/end-of-text/indexscan.out expected/regexp/varchar/regexp-v2/end-of-text/seqscan.out expected/regexp/varchar/regexp-v2/exact/bitmapscan.out expected/regexp/varchar/regexp-v2/exact/indexscan.out expected/regexp/varchar/regexp-v2/exact/seqscan.out expected/regexp/varchar/regexp-v2/partial/bitmapscan.out expected/regexp/varchar/regexp-v2/partial/indexscan.out expected/regexp/varchar/regexp-v2/partial/seqscan.out sql/regexp/text/compatibility/v2/regexp-v1/begin-of-text/bitmapscan.sql sql/regexp/text/compatibility/v2/regexp-v1/begin-of-text/indexscan.sql sql/regexp/text/compatibility/v2/regexp-v1/begin-of-text/seqscan.sql sql/regexp/text/compatibility/v2/regexp-v1/dot/bitmapscan.sql sql/regexp/text/compatibility/v2/regexp-v1/dot/indexscan.sql sql/regexp/text/compatibility/v2/regexp-v1/dot/seqscan.sql sql/regexp/text/compatibility/v2/regexp-v1/end-of-text/bitmapscan.sql sql/regexp/text/compatibility/v2/regexp-v1/end-of-text/indexscan.sql sql/regexp/text/compatibility/v2/regexp-v1/end-of-text/seqscan.sql sql/regexp/text/compatibility/v2/regexp-v1/exact/bitmapscan.sql sql/regexp/text/compatibility/v2/regexp-v1/exact/indexscan.sql sql/regexp/text/compatibility/v2/regexp-v1/exact/seqscan.sql sql/regexp/text/compatibility/v2/regexp-v1/partial/bitmapscan.sql sql/regexp/text/compatibility/v2/regexp-v1/partial/indexscan.sql sql/regexp/text/compatibility/v2/regexp-v1/partial/seqscan.sql sql/regexp/text/ilike-v2/begin-of-text/bitmapscan.sql sql/regexp/text/ilike-v2/begin-of-text/indexscan.sql sql/regexp/text/ilike-v2/begin-of-text/seqscan.sql sql/regexp/text/ilike-v2/end-of-text/bitmapscan.sql sql/regexp/text/ilike-v2/end-of-text/indexscan.sql sql/regexp/text/ilike-v2/end-of-text/seqscan.sql sql/regexp/text/ilike-v2/exact/bitmapscan.sql sql/regexp/text/ilike-v2/exact/indexscan.sql sql/regexp/text/ilike-v2/exact/seqscan.sql sql/regexp/text/ilike-v2/partial/bitmapscan.sql sql/regexp/text/ilike-v2/partial/indexscan.sql sql/regexp/text/ilike-v2/partial/seqscan.sql sql/regexp/text/like-v2/begin-of-text/bitmapscan.sql sql/regexp/text/like-v2/begin-of-text/indexscan.sql sql/regexp/text/like-v2/begin-of-text/seqscan.sql sql/regexp/text/like-v2/end-of-text/bitmapscan.sql sql/regexp/text/like-v2/end-of-text/indexscan.sql sql/regexp/text/like-v2/end-of-text/seqscan.sql sql/regexp/text/like-v2/exact/bitmapscan.sql sql/regexp/text/like-v2/exact/indexscan.sql sql/regexp/text/like-v2/exact/seqscan.sql sql/regexp/text/like-v2/partial/bitmapscan.sql sql/regexp/text/like-v2/partial/indexscan.sql sql/regexp/text/like-v2/partial/seqscan.sql sql/regexp/text/regexp-v2/begin-of-text/bitmapscan.sql sql/regexp/text/regexp-v2/begin-of-text/indexscan.sql sql/regexp/text/regexp-v2/begin-of-text/seqscan.sql sql/regexp/text/regexp-v2/dot/bitmapscan.sql sql/regexp/text/regexp-v2/dot/indexscan.sql sql/regexp/text/regexp-v2/dot/seqscan.sql sql/regexp/text/regexp-v2/end-of-text/bitmapscan.sql sql/regexp/text/regexp-v2/end-of-text/indexscan.sql sql/regexp/text/regexp-v2/end-of-text/seqscan.sql sql/regexp/text/regexp-v2/exact/bitmapscan.sql sql/regexp/text/regexp-v2/exact/indexscan.sql sql/regexp/text/regexp-v2/exact/seqscan.sql sql/regexp/text/regexp-v2/partial/bitmapscan.sql sql/regexp/text/regexp-v2/partial/indexscan.sql sql/regexp/text/regexp-v2/partial/seqscan.sql sql/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/bitmapscan.sql sql/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/indexscan.sql sql/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/seqscan.sql sql/regexp/varchar/compatibility/v2/regexp-v1/dot/bitmapscan.sql sql/regexp/varchar/compatibility/v2/regexp-v1/dot/indexscan.sql sql/regexp/varchar/compatibility/v2/regexp-v1/dot/seqscan.sql sql/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/bitmapscan.sql sql/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/indexscan.sql sql/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/seqscan.sql sql/regexp/varchar/compatibility/v2/regexp-v1/exact/bitmapscan.sql sql/regexp/varchar/compatibility/v2/regexp-v1/exact/indexscan.sql sql/regexp/varchar/compatibility/v2/regexp-v1/exact/seqscan.sql sql/regexp/varchar/compatibility/v2/regexp-v1/partial/bitmapscan.sql sql/regexp/varchar/compatibility/v2/regexp-v1/partial/indexscan.sql sql/regexp/varchar/compatibility/v2/regexp-v1/partial/seqscan.sql sql/regexp/varchar/regexp-v2/begin-of-text/bitmapscan.sql sql/regexp/varchar/regexp-v2/begin-of-text/indexscan.sql sql/regexp/varchar/regexp-v2/begin-of-text/seqscan.sql sql/regexp/varchar/regexp-v2/dot/bitmapscan.sql sql/regexp/varchar/regexp-v2/dot/indexscan.sql sql/regexp/varchar/regexp-v2/dot/seqscan.sql sql/regexp/varchar/regexp-v2/end-of-text/bitmapscan.sql sql/regexp/varchar/regexp-v2/end-of-text/indexscan.sql sql/regexp/varchar/regexp-v2/end-of-text/seqscan.sql sql/regexp/varchar/regexp-v2/exact/bitmapscan.sql sql/regexp/varchar/regexp-v2/exact/indexscan.sql sql/regexp/varchar/regexp-v2/exact/seqscan.sql sql/regexp/varchar/regexp-v2/partial/bitmapscan.sql sql/regexp/varchar/regexp-v2/partial/indexscan.sql sql/regexp/varchar/regexp-v2/partial/seqscan.sql Modified files: data/pgroonga--1.2.0--1.2.1.sql data/pgroonga.sql src/pgroonga.c src/pgroonga.h Modified: data/pgroonga--1.2.0--1.2.1.sql (+50 -0) =================================================================== --- data/pgroonga--1.2.0--1.2.1.sql 2017-05-02 16:17:16 +0900 (1f65834) +++ data/pgroonga--1.2.0--1.2.1.sql 2017-05-02 17:24:11 +0900 (31b408d) @@ -291,3 +291,53 @@ CREATE OPERATOR CLASS pgroonga.text_array_term_search_ops_v2 FOR TYPE text[] OPERATOR 17 &^~ (text[], text), OPERATOR 20 &^> (text[], text[]), OPERATOR 21 &^~> (text[], text[]); + +-- Add pgroonga.text_regexp_ops_v2. +-- Add pgroonga.varchar_regexp_ops_v2. +DO LANGUAGE plpgsql $$ +BEGIN + SELECT amstrategies FROM pg_am LIMIT 0; +EXCEPTION + WHEN syntax_error THEN + UPDATE pg_am SET amstrategies = 22 + WHERE amname = 'pgroonga'; +END; +$$; + +CREATE FUNCTION pgroonga.regexp_text(text, text) + RETURNS bool + AS 'MODULE_PATHNAME', 'pgroonga_regexp_text' + LANGUAGE C + IMMUTABLE + STRICT; + +CREATE OPERATOR &~ ( + PROCEDURE = pgroonga.regexp_text, + LEFTARG = text, + RIGHTARG = text +); + +CREATE FUNCTION pgroonga.regexp_varchar(varchar, varchar) + RETURNS bool + AS 'MODULE_PATHNAME', 'pgroonga_regexp_varchar' + LANGUAGE C + IMMUTABLE + STRICT; + +CREATE OPERATOR &~ ( + PROCEDURE = pgroonga.regexp_varchar, + LEFTARG = varchar, + RIGHTARG = varchar +); + +CREATE OPERATOR CLASS pgroonga.text_regexp_ops_v2 FOR TYPE text + USING pgroonga AS + OPERATOR 6 ~~, + OPERATOR 7 ~~*, + OPERATOR 10 @~, + OPERATOR 22 &~; + +CREATE OPERATOR CLASS pgroonga.varchar_regexp_ops_v2 FOR TYPE varchar + USING pgroonga AS + OPERATOR 10 @~, + OPERATOR 22 &~; Modified: data/pgroonga.sql (+39 -1) =================================================================== --- data/pgroonga.sql 2017-05-02 16:17:16 +0900 (998f6b9) +++ data/pgroonga.sql 2017-05-02 17:24:11 +0900 (f41dd7d) @@ -617,6 +617,32 @@ CREATE OPERATOR &^~> ( RIGHTARG = text[] ); +CREATE FUNCTION pgroonga.regexp_text(text, text) + RETURNS bool + AS 'MODULE_PATHNAME', 'pgroonga_regexp_text' + LANGUAGE C + IMMUTABLE + STRICT; + +CREATE OPERATOR &~ ( + PROCEDURE = pgroonga.regexp_text, + LEFTARG = text, + RIGHTARG = text +); + +CREATE FUNCTION pgroonga.regexp_varchar(varchar, varchar) + RETURNS bool + AS 'MODULE_PATHNAME', 'pgroonga_regexp_varchar' + LANGUAGE C + IMMUTABLE + STRICT; + +CREATE OPERATOR &~ ( + PROCEDURE = pgroonga.regexp_varchar, + LEFTARG = varchar, + RIGHTARG = varchar +); + CREATE FUNCTION pgroonga.insert(internal) RETURNS bool @@ -686,7 +712,7 @@ EXCEPTION DELETE FROM pg_am WHERE amname = 'pgroonga'; INSERT INTO pg_am VALUES( 'pgroonga', -- amname - 21, -- amstrategies + 22, -- amstrategies 0, -- amsupport true, -- amcanorder true, -- amcanorderbyop @@ -903,6 +929,13 @@ CREATE OPERATOR CLASS pgroonga.text_array_term_search_ops_v2 FOR TYPE text[] OPERATOR 20 &^> (text[], text[]), OPERATOR 21 &^~> (text[], text[]); +CREATE OPERATOR CLASS pgroonga.text_regexp_ops_v2 FOR TYPE text + USING pgroonga AS + OPERATOR 6 ~~, + OPERATOR 7 ~~*, + OPERATOR 10 @~, + OPERATOR 22 &~; + CREATE OPERATOR CLASS pgroonga.varchar_full_text_search_ops_v2 FOR TYPE varchar USING pgroonga AS @@ -914,3 +947,8 @@ CREATE OPERATOR CLASS pgroonga.varchar_full_text_search_ops_v2 OPERATOR 15 &`, OPERATOR 18 &@> (varchar, varchar[]), OPERATOR 19 &?> (varchar, varchar[]); + +CREATE OPERATOR CLASS pgroonga.varchar_regexp_ops_v2 FOR TYPE varchar + USING pgroonga AS + OPERATOR 10 @~, + OPERATOR 22 &~; Added: expected/regexp/text/compatibility/v2/regexp-v1/begin-of-text/bitmapscan.out (+33 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/compatibility/v2/regexp-v1/begin-of-text/bitmapscan.out 2017-05-02 17:24:11 +0900 (d11ac57) @@ -0,0 +1,33 @@ +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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + QUERY PLAN +---------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content @~ '\Agroonga'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content @~ '\Agroonga'::text) +(4 rows) + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + id | content +----+------------------------------------------ + 2 | Groonga is fast full text search engine. +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/compatibility/v2/regexp-v1/begin-of-text/indexscan.out (+31 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/compatibility/v2/regexp-v1/begin-of-text/indexscan.out 2017-05-02 17:24:11 +0900 (0499f8e) @@ -0,0 +1,31 @@ +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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + QUERY PLAN +---------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content @~ '\Agroonga'::text) +(2 rows) + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + id | content +----+------------------------------------------ + 2 | Groonga is fast full text search engine. +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/compatibility/v2/regexp-v1/begin-of-text/seqscan.out (+21 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/compatibility/v2/regexp-v1/begin-of-text/seqscan.out 2017-05-02 17:24:11 +0900 (0ee3eb2) @@ -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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + id | content +----+------------------------------------------ + 2 | Groonga is fast full text search engine. +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/compatibility/v2/regexp-v1/dot/bitmapscan.out (+34 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/compatibility/v2/regexp-v1/dot/bitmapscan.out 2017-05-02 17:24:11 +0900 (10a9ffc) @@ -0,0 +1,34 @@ +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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + QUERY PLAN +-------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content @~ '.roonga'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content @~ '.roonga'::text) +(4 rows) + +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + id | content +----+------------------------------------------------------- + 2 | Groonga is fast full text search engine. + 3 | PGroonga is a PostgreSQL extension that uses Groonga. +(2 rows) + +DROP TABLE memos; Added: expected/regexp/text/compatibility/v2/regexp-v1/dot/indexscan.out (+32 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/compatibility/v2/regexp-v1/dot/indexscan.out 2017-05-02 17:24:11 +0900 (6ff9c62) @@ -0,0 +1,32 @@ +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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + QUERY PLAN +-------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content @~ '.roonga'::text) +(2 rows) + +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + id | content +----+------------------------------------------------------- + 2 | Groonga is fast full text search engine. + 3 | PGroonga is a PostgreSQL extension that uses Groonga. +(2 rows) + +DROP TABLE memos; Added: expected/regexp/text/compatibility/v2/regexp-v1/dot/seqscan.out (+22 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/compatibility/v2/regexp-v1/dot/seqscan.out 2017-05-02 17:24:11 +0900 (772dd3c) @@ -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.'); +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.text_regexp_ops_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + id | content +----+------------------------------------------------------- + 2 | Groonga is fast full text search engine. + 3 | PGroonga is a PostgreSQL extension that uses Groonga. +(2 rows) + +DROP TABLE memos; Added: expected/regexp/text/compatibility/v2/regexp-v1/end-of-text/bitmapscan.out (+33 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/compatibility/v2/regexp-v1/end-of-text/bitmapscan.out 2017-05-02 17:24:11 +0900 (8195bd1) @@ -0,0 +1,33 @@ +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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + QUERY PLAN +---------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content @~ 'groonga\z'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content @~ 'groonga\z'::text) +(4 rows) + +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + id | content +----+------------------------------------------------------ + 3 | PGroonga is a PostgreSQL extension that uses Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/compatibility/v2/regexp-v1/end-of-text/indexscan.out (+31 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/compatibility/v2/regexp-v1/end-of-text/indexscan.out 2017-05-02 17:24:11 +0900 (33f507e) @@ -0,0 +1,31 @@ +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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + QUERY PLAN +---------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content @~ 'groonga\z'::text) +(2 rows) + +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + id | content +----+------------------------------------------------------ + 3 | PGroonga is a PostgreSQL extension that uses Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/compatibility/v2/regexp-v1/end-of-text/seqscan.out (+21 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/compatibility/v2/regexp-v1/end-of-text/seqscan.out 2017-05-02 17:24:11 +0900 (f08e27b) @@ -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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + id | content +----+------------------------------------------------------ + 3 | PGroonga is a PostgreSQL extension that uses Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/compatibility/v2/regexp-v1/exact/bitmapscan.out (+33 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/compatibility/v2/regexp-v1/exact/bitmapscan.out 2017-05-02 17:24:11 +0900 (9dc8dc1) @@ -0,0 +1,33 @@ +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'); +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + QUERY PLAN +------------------------------------------------------ + Bitmap Heap Scan on memos + Recheck Cond: (content @~ '\Agroonga\z'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content @~ '\Agroonga\z'::text) +(4 rows) + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + id | content +----+--------- + 2 | Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/compatibility/v2/regexp-v1/exact/indexscan.out (+31 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/compatibility/v2/regexp-v1/exact/indexscan.out 2017-05-02 17:24:11 +0900 (ced81dc) @@ -0,0 +1,31 @@ +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'); +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + QUERY PLAN +------------------------------------------------ + Index Scan using grnindex on memos + Index Cond: (content @~ '\Agroonga\z'::text) +(2 rows) + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + id | content +----+--------- + 2 | Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/compatibility/v2/regexp-v1/exact/seqscan.out (+21 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/compatibility/v2/regexp-v1/exact/seqscan.out 2017-05-02 17:24:11 +0900 (ad5614b) @@ -0,0 +1,21 @@ +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'); +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.text_regexp_ops_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + id | content +----+--------- + 2 | Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/compatibility/v2/regexp-v1/partial/bitmapscan.out (+34 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/compatibility/v2/regexp-v1/partial/bitmapscan.out 2017-05-02 17:24:11 +0900 (554bc5f) @@ -0,0 +1,34 @@ +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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ 'groonga'; + QUERY PLAN +-------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content @~ 'groonga'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content @~ 'groonga'::text) +(4 rows) + +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; Added: expected/regexp/text/compatibility/v2/regexp-v1/partial/indexscan.out (+32 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/compatibility/v2/regexp-v1/partial/indexscan.out 2017-05-02 17:24:11 +0900 (4e0608e) @@ -0,0 +1,32 @@ +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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ 'groonga'; + QUERY PLAN +-------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content @~ 'groonga'::text) +(2 rows) + +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; Added: expected/regexp/text/compatibility/v2/regexp-v1/partial/seqscan.out (+22 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/compatibility/v2/regexp-v1/partial/seqscan.out 2017-05-02 17:24:11 +0900 (4346586) @@ -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.'); +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.text_regexp_ops_v2); +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) + +DROP TABLE memos; Added: expected/regexp/text/ilike-v2/begin-of-text/bitmapscan.out (+35 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/ilike-v2/begin-of-text/bitmapscan.out 2017-05-02 17:24:11 +0900 (1c554ad) @@ -0,0 +1,35 @@ +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_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content ILIKE 'GROONGA%'; + QUERY PLAN +---------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content ~~* 'GROONGA%'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content ~~* 'GROONGA%'::text) +(4 rows) + +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; Added: expected/regexp/text/ilike-v2/begin-of-text/indexscan.out (+33 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/ilike-v2/begin-of-text/indexscan.out 2017-05-02 17:24:11 +0900 (0fecd20) @@ -0,0 +1,33 @@ +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_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content ILIKE 'GROONGA%'; + QUERY PLAN +---------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content ~~* 'GROONGA%'::text) +(2 rows) + +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; Added: expected/regexp/text/ilike-v2/begin-of-text/seqscan.out (+23 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/ilike-v2/begin-of-text/seqscan.out 2017-05-02 17:24:11 +0900 (b0806e5) @@ -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. + 4 | groonga command is provided. +(2 rows) + +DROP TABLE memos; Added: expected/regexp/text/ilike-v2/end-of-text/bitmapscan.out (+34 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/ilike-v2/end-of-text/bitmapscan.out 2017-05-02 17:24:11 +0900 (6af11b4) @@ -0,0 +1,34 @@ +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_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content ILIKE '%GROONGA'; + QUERY PLAN +---------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content ~~* '%GROONGA'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content ~~* '%GROONGA'::text) +(4 rows) + +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; Added: expected/regexp/text/ilike-v2/end-of-text/indexscan.out (+32 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/ilike-v2/end-of-text/indexscan.out 2017-05-02 17:24:11 +0900 (cdb0d36) @@ -0,0 +1,32 @@ +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_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content ILIKE '%GROONGA'; + QUERY PLAN +---------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content ~~* '%GROONGA'::text) +(2 rows) + +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; Added: expected/regexp/text/ilike-v2/end-of-text/seqscan.out (+22 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/ilike-v2/end-of-text/seqscan.out 2017-05-02 17:24:11 +0900 (b1e844c) @@ -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 +----+------------------------------------------------------ + 3 | PGroonga is a PostgreSQL extension that uses Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/ilike-v2/exact/bitmapscan.out (+35 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/ilike-v2/exact/bitmapscan.out 2017-05-02 17:24:11 +0900 (532f6ac) @@ -0,0 +1,35 @@ +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; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content ILIKE 'GROONGA'; + QUERY PLAN +--------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content ~~* 'GROONGA'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content ~~* 'GROONGA'::text) +(4 rows) + +SELECT id, content + FROM memos + WHERE content ILIKE 'GROONGA'; + id | content +----+--------- + 2 | Groonga + 4 | groonga +(2 rows) + +DROP TABLE memos; Added: expected/regexp/text/ilike-v2/exact/indexscan.out (+33 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/ilike-v2/exact/indexscan.out 2017-05-02 17:24:11 +0900 (7363f9e) @@ -0,0 +1,33 @@ +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_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content ILIKE 'GROONGA'; + QUERY PLAN +--------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content ~~* 'GROONGA'::text) +(2 rows) + +SELECT id, content + FROM memos + WHERE content ILIKE 'GROONGA'; + id | content +----+--------- + 2 | Groonga + 4 | groonga +(2 rows) + +DROP TABLE memos; Added: expected/regexp/text/ilike-v2/exact/seqscan.out (+23 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/ilike-v2/exact/seqscan.out 2017-05-02 17:24:11 +0900 (30fb1e1) @@ -0,0 +1,23 @@ +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_v2); +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; Added: expected/regexp/text/ilike-v2/partial/bitmapscan.out (+36 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/ilike-v2/partial/bitmapscan.out 2017-05-02 17:24:11 +0900 (69ec8ff) @@ -0,0 +1,36 @@ +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_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content ILIKE '%GROONGA%'; + QUERY PLAN +----------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content ~~* '%GROONGA%'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content ~~* '%GROONGA%'::text) +(4 rows) + +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; Added: expected/regexp/text/ilike-v2/partial/indexscan.out (+34 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/ilike-v2/partial/indexscan.out 2017-05-02 17:24:11 +0900 (1ee2479) @@ -0,0 +1,34 @@ +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_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content ILIKE '%GROONGA%'; + QUERY PLAN +----------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content ~~* '%GROONGA%'::text) +(2 rows) + +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; Added: expected/regexp/text/ilike-v2/partial/seqscan.out (+24 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/ilike-v2/partial/seqscan.out 2017-05-02 17:24:11 +0900 (0afbbe6) @@ -0,0 +1,24 @@ +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_v2); +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; Added: expected/regexp/text/like-v2/begin-of-text/bitmapscan.out (+34 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/like-v2/begin-of-text/bitmapscan.out 2017-05-02 17:24:11 +0900 (51c9a17) @@ -0,0 +1,34 @@ +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_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga%'; + QUERY PLAN +--------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content ~~ 'Groonga%'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content ~~ 'Groonga%'::text) +(4 rows) + +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga%'; + id | content +----+------------------------------------------ + 2 | Groonga is fast full text search engine. +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/like-v2/begin-of-text/indexscan.out (+32 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/like-v2/begin-of-text/indexscan.out 2017-05-02 17:24:11 +0900 (0ddd13f) @@ -0,0 +1,32 @@ +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_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga%'; + QUERY PLAN +--------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content ~~ 'Groonga%'::text) +(2 rows) + +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga%'; + id | content +----+------------------------------------------ + 2 | Groonga is fast full text search engine. +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/like-v2/begin-of-text/seqscan.out (+22 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/like-v2/begin-of-text/seqscan.out 2017-05-02 17:24:11 +0900 (0a81c80) @@ -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_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga%'; + id | content +----+------------------------------------------ + 2 | Groonga is fast full text search engine. +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/like-v2/end-of-text/bitmapscan.out (+34 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/like-v2/end-of-text/bitmapscan.out 2017-05-02 17:24:11 +0900 (970df4c) @@ -0,0 +1,34 @@ +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_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content LIKE '%Groonga'; + QUERY PLAN +--------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content ~~ '%Groonga'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content ~~ '%Groonga'::text) +(4 rows) + +SELECT id, content + FROM memos + WHERE content LIKE '%Groonga'; + id | content +----+------------------------------------------------------ + 3 | PGroonga is a PostgreSQL extension that uses Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/like-v2/end-of-text/indexscan.out (+32 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/like-v2/end-of-text/indexscan.out 2017-05-02 17:24:11 +0900 (707dc84) @@ -0,0 +1,32 @@ +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_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content LIKE '%Groonga'; + QUERY PLAN +--------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content ~~ '%Groonga'::text) +(2 rows) + +SELECT id, content + FROM memos + WHERE content LIKE '%Groonga'; + id | content +----+------------------------------------------------------ + 3 | PGroonga is a PostgreSQL extension that uses Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/like-v2/end-of-text/seqscan.out (+22 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/like-v2/end-of-text/seqscan.out 2017-05-02 17:24:11 +0900 (013dc3e) @@ -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_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content LIKE '%Groonga'; + id | content +----+------------------------------------------------------ + 3 | PGroonga is a PostgreSQL extension that uses Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/like-v2/exact/bitmapscan.out (+34 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/like-v2/exact/bitmapscan.out 2017-05-02 17:24:11 +0900 (2b9d29c) @@ -0,0 +1,34 @@ +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_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga'; + QUERY PLAN +-------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content ~~ 'Groonga'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content ~~ 'Groonga'::text) +(4 rows) + +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga'; + id | content +----+--------- + 2 | Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/like-v2/exact/indexscan.out (+32 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/like-v2/exact/indexscan.out 2017-05-02 17:24:11 +0900 (f267593) @@ -0,0 +1,32 @@ +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_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga'; + QUERY PLAN +-------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content ~~ 'Groonga'::text) +(2 rows) + +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga'; + id | content +----+--------- + 2 | Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/like-v2/exact/seqscan.out (+22 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/like-v2/exact/seqscan.out 2017-05-02 17:24:11 +0900 (2332f8b) @@ -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_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga'; + id | content +----+--------- + 2 | Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/like-v2/partial/bitmapscan.out (+35 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/like-v2/partial/bitmapscan.out 2017-05-02 17:24:11 +0900 (18baeb4) @@ -0,0 +1,35 @@ +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_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content LIKE '%Groonga%'; + QUERY PLAN +---------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content ~~ '%Groonga%'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content ~~ '%Groonga%'::text) +(4 rows) + +SELECT id, content + FROM memos + WHERE content LIKE '%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; Added: expected/regexp/text/like-v2/partial/indexscan.out (+33 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/like-v2/partial/indexscan.out 2017-05-02 17:24:11 +0900 (91e6987) @@ -0,0 +1,33 @@ +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_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content LIKE '%Groonga%'; + QUERY PLAN +---------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content ~~ '%Groonga%'::text) +(2 rows) + +SELECT id, content + FROM memos + WHERE content LIKE '%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; Added: expected/regexp/text/like-v2/partial/seqscan.out (+23 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/like-v2/partial/seqscan.out 2017-05-02 17:24:11 +0900 (94b6c3f) @@ -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_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content LIKE '%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; Added: expected/regexp/text/regexp-v2/begin-of-text/bitmapscan.out (+33 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/regexp-v2/begin-of-text/bitmapscan.out 2017-05-02 17:24:11 +0900 (700a07f) @@ -0,0 +1,33 @@ +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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + QUERY PLAN +---------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content &~ '\Agroonga'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content &~ '\Agroonga'::text) +(4 rows) + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + id | content +----+------------------------------------------ + 2 | Groonga is fast full text search engine. +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/regexp-v2/begin-of-text/indexscan.out (+31 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/regexp-v2/begin-of-text/indexscan.out 2017-05-02 17:24:11 +0900 (3e2f023) @@ -0,0 +1,31 @@ +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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + QUERY PLAN +---------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content &~ '\Agroonga'::text) +(2 rows) + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + id | content +----+------------------------------------------ + 2 | Groonga is fast full text search engine. +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/regexp-v2/begin-of-text/seqscan.out (+21 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/regexp-v2/begin-of-text/seqscan.out 2017-05-02 17:24:11 +0900 (c7f7686) @@ -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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + id | content +----+------------------------------------------ + 2 | Groonga is fast full text search engine. +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/regexp-v2/dot/bitmapscan.out (+34 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/regexp-v2/dot/bitmapscan.out 2017-05-02 17:24:11 +0900 (7e32645) @@ -0,0 +1,34 @@ +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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + QUERY PLAN +-------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content &~ '.roonga'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content &~ '.roonga'::text) +(4 rows) + +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + id | content +----+------------------------------------------------------- + 2 | Groonga is fast full text search engine. + 3 | PGroonga is a PostgreSQL extension that uses Groonga. +(2 rows) + +DROP TABLE memos; Added: expected/regexp/text/regexp-v2/dot/indexscan.out (+32 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/regexp-v2/dot/indexscan.out 2017-05-02 17:24:11 +0900 (b96a2e2) @@ -0,0 +1,32 @@ +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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + QUERY PLAN +-------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content &~ '.roonga'::text) +(2 rows) + +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + id | content +----+------------------------------------------------------- + 2 | Groonga is fast full text search engine. + 3 | PGroonga is a PostgreSQL extension that uses Groonga. +(2 rows) + +DROP TABLE memos; Added: expected/regexp/text/regexp-v2/dot/seqscan.out (+22 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/regexp-v2/dot/seqscan.out 2017-05-02 17:24:11 +0900 (bfe9263) @@ -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.'); +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.text_regexp_ops_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + id | content +----+------------------------------------------------------- + 2 | Groonga is fast full text search engine. + 3 | PGroonga is a PostgreSQL extension that uses Groonga. +(2 rows) + +DROP TABLE memos; Added: expected/regexp/text/regexp-v2/end-of-text/bitmapscan.out (+33 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/regexp-v2/end-of-text/bitmapscan.out 2017-05-02 17:24:11 +0900 (05a44e5) @@ -0,0 +1,33 @@ +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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + QUERY PLAN +---------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content &~ 'groonga\z'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content &~ 'groonga\z'::text) +(4 rows) + +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + id | content +----+------------------------------------------------------ + 3 | PGroonga is a PostgreSQL extension that uses Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/regexp-v2/end-of-text/indexscan.out (+31 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/regexp-v2/end-of-text/indexscan.out 2017-05-02 17:24:11 +0900 (84f3800) @@ -0,0 +1,31 @@ +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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + QUERY PLAN +---------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content &~ 'groonga\z'::text) +(2 rows) + +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + id | content +----+------------------------------------------------------ + 3 | PGroonga is a PostgreSQL extension that uses Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/regexp-v2/end-of-text/seqscan.out (+21 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/regexp-v2/end-of-text/seqscan.out 2017-05-02 17:24:11 +0900 (6a77db1) @@ -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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + id | content +----+------------------------------------------------------ + 3 | PGroonga is a PostgreSQL extension that uses Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/regexp-v2/exact/bitmapscan.out (+33 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/regexp-v2/exact/bitmapscan.out 2017-05-02 17:24:11 +0900 (ef39cb4) @@ -0,0 +1,33 @@ +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'); +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + QUERY PLAN +------------------------------------------------------ + Bitmap Heap Scan on memos + Recheck Cond: (content &~ '\Agroonga\z'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content &~ '\Agroonga\z'::text) +(4 rows) + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + id | content +----+--------- + 2 | Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/regexp-v2/exact/indexscan.out (+31 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/regexp-v2/exact/indexscan.out 2017-05-02 17:24:11 +0900 (292dd10) @@ -0,0 +1,31 @@ +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'); +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + QUERY PLAN +------------------------------------------------ + Index Scan using grnindex on memos + Index Cond: (content &~ '\Agroonga\z'::text) +(2 rows) + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + id | content +----+--------- + 2 | Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/regexp-v2/exact/seqscan.out (+21 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/regexp-v2/exact/seqscan.out 2017-05-02 17:24:11 +0900 (fe3d956) @@ -0,0 +1,21 @@ +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'); +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.text_regexp_ops_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + id | content +----+--------- + 2 | Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/text/regexp-v2/partial/bitmapscan.out (+34 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/regexp-v2/partial/bitmapscan.out 2017-05-02 17:24:11 +0900 (24b25b6) @@ -0,0 +1,34 @@ +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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ 'groonga'; + QUERY PLAN +-------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content &~ 'groonga'::text) + -> Bitmap Index Scan on grnindex + Index Cond: (content &~ 'groonga'::text) +(4 rows) + +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; Added: expected/regexp/text/regexp-v2/partial/indexscan.out (+32 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/regexp-v2/partial/indexscan.out 2017-05-02 17:24:11 +0900 (18b4a03) @@ -0,0 +1,32 @@ +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 pgroonga.text_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ 'groonga'; + QUERY PLAN +-------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content &~ 'groonga'::text) +(2 rows) + +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; Added: expected/regexp/text/regexp-v2/partial/seqscan.out (+22 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/text/regexp-v2/partial/seqscan.out 2017-05-02 17:24:11 +0900 (73d1e96) @@ -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.'); +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.text_regexp_ops_v2); +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) + +DROP TABLE memos; Added: expected/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/bitmapscan.out (+33 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/bitmapscan.out 2017-05-02 17:24:11 +0900 (c07bce5) @@ -0,0 +1,33 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + QUERY PLAN +----------------------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content @~ '\Agroonga'::character varying) + -> Bitmap Index Scan on grnindex + Index Cond: (content @~ '\Agroonga'::character varying) +(4 rows) + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + id | content +----+------------------------------------------ + 2 | Groonga is fast full text search engine. +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/indexscan.out (+31 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/indexscan.out 2017-05-02 17:24:11 +0900 (e2fa997) @@ -0,0 +1,31 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + QUERY PLAN +----------------------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content @~ '\Agroonga'::character varying) +(2 rows) + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + id | content +----+------------------------------------------ + 2 | Groonga is fast full text search engine. +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/seqscan.out (+21 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/seqscan.out 2017-05-02 17:24:11 +0900 (d8f4c71) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + id | content +----+------------------------------------------ + 2 | Groonga is fast full text search engine. +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/compatibility/v2/regexp-v1/dot/bitmapscan.out (+34 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/compatibility/v2/regexp-v1/dot/bitmapscan.out 2017-05-02 17:24:11 +0900 (4ce77bf) @@ -0,0 +1,34 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + QUERY PLAN +--------------------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content @~ '.roonga'::character varying) + -> Bitmap Index Scan on grnindex + Index Cond: (content @~ '.roonga'::character varying) +(4 rows) + +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + id | content +----+------------------------------------------------------- + 2 | Groonga is fast full text search engine. + 3 | PGroonga is a PostgreSQL extension that uses Groonga. +(2 rows) + +DROP TABLE memos; Added: expected/regexp/varchar/compatibility/v2/regexp-v1/dot/indexscan.out (+32 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/compatibility/v2/regexp-v1/dot/indexscan.out 2017-05-02 17:24:11 +0900 (6dd4a3d) @@ -0,0 +1,32 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + QUERY PLAN +--------------------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content @~ '.roonga'::character varying) +(2 rows) + +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + id | content +----+------------------------------------------------------- + 2 | Groonga is fast full text search engine. + 3 | PGroonga is a PostgreSQL extension that uses Groonga. +(2 rows) + +DROP TABLE memos; Added: expected/regexp/varchar/compatibility/v2/regexp-v1/dot/seqscan.out (+22 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/compatibility/v2/regexp-v1/dot/seqscan.out 2017-05-02 17:24:11 +0900 (ea79f7e) @@ -0,0 +1,22 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + id | content +----+------------------------------------------------------- + 2 | Groonga is fast full text search engine. + 3 | PGroonga is a PostgreSQL extension that uses Groonga. +(2 rows) + +DROP TABLE memos; Added: expected/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/bitmapscan.out (+33 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/bitmapscan.out 2017-05-02 17:24:11 +0900 (0e12ee1) @@ -0,0 +1,33 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + QUERY PLAN +----------------------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content @~ 'groonga\z'::character varying) + -> Bitmap Index Scan on grnindex + Index Cond: (content @~ 'groonga\z'::character varying) +(4 rows) + +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + id | content +----+------------------------------------------------------ + 3 | PGroonga is a PostgreSQL extension that uses Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/indexscan.out (+31 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/indexscan.out 2017-05-02 17:24:11 +0900 (e6574af) @@ -0,0 +1,31 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + QUERY PLAN +----------------------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content @~ 'groonga\z'::character varying) +(2 rows) + +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + id | content +----+------------------------------------------------------ + 3 | PGroonga is a PostgreSQL extension that uses Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/seqscan.out (+21 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/seqscan.out 2017-05-02 17:24:11 +0900 (f2a01e9) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + id | content +----+------------------------------------------------------ + 3 | PGroonga is a PostgreSQL extension that uses Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/compatibility/v2/regexp-v1/exact/bitmapscan.out (+33 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/compatibility/v2/regexp-v1/exact/bitmapscan.out 2017-05-02 17:24:11 +0900 (03d9750) @@ -0,0 +1,33 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +INSERT INTO memos VALUES (1, 'PostgreSQL'); +INSERT INTO memos VALUES (2, 'Groonga'); +INSERT INTO memos VALUES (3, 'PGroonga'); +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + QUERY PLAN +------------------------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content @~ '\Agroonga\z'::character varying) + -> Bitmap Index Scan on grnindex + Index Cond: (content @~ '\Agroonga\z'::character varying) +(4 rows) + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + id | content +----+--------- + 2 | Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/compatibility/v2/regexp-v1/exact/indexscan.out (+31 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/compatibility/v2/regexp-v1/exact/indexscan.out 2017-05-02 17:24:11 +0900 (3b3fdd2) @@ -0,0 +1,31 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +INSERT INTO memos VALUES (1, 'PostgreSQL'); +INSERT INTO memos VALUES (2, 'Groonga'); +INSERT INTO memos VALUES (3, 'PGroonga'); +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + QUERY PLAN +------------------------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content @~ '\Agroonga\z'::character varying) +(2 rows) + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + id | content +----+--------- + 2 | Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/compatibility/v2/regexp-v1/exact/seqscan.out (+21 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/compatibility/v2/regexp-v1/exact/seqscan.out 2017-05-02 17:24:11 +0900 (8e51486) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +INSERT INTO memos VALUES (1, 'PostgreSQL'); +INSERT INTO memos VALUES (2, 'Groonga'); +INSERT INTO memos VALUES (3, 'PGroonga'); +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + id | content +----+--------- + 2 | Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/compatibility/v2/regexp-v1/partial/bitmapscan.out (+34 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/compatibility/v2/regexp-v1/partial/bitmapscan.out 2017-05-02 17:24:11 +0900 (79e8394) @@ -0,0 +1,34 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ 'groonga'; + QUERY PLAN +--------------------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content @~ 'groonga'::character varying) + -> Bitmap Index Scan on grnindex + Index Cond: (content @~ 'groonga'::character varying) +(4 rows) + +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; Added: expected/regexp/varchar/compatibility/v2/regexp-v1/partial/indexscan.out (+32 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/compatibility/v2/regexp-v1/partial/indexscan.out 2017-05-02 17:24:11 +0900 (4cd16ac) @@ -0,0 +1,32 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ 'groonga'; + QUERY PLAN +--------------------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content @~ 'groonga'::character varying) +(2 rows) + +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; Added: expected/regexp/varchar/compatibility/v2/regexp-v1/partial/seqscan.out (+22 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/compatibility/v2/regexp-v1/partial/seqscan.out 2017-05-02 17:24:11 +0900 (0dddc76) @@ -0,0 +1,22 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +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) + +DROP TABLE memos; Added: expected/regexp/varchar/regexp-v2/begin-of-text/bitmapscan.out (+33 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/regexp-v2/begin-of-text/bitmapscan.out 2017-05-02 17:24:11 +0900 (a7ea505) @@ -0,0 +1,33 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + QUERY PLAN +----------------------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content &~ '\Agroonga'::character varying) + -> Bitmap Index Scan on grnindex + Index Cond: (content &~ '\Agroonga'::character varying) +(4 rows) + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + id | content +----+------------------------------------------ + 2 | Groonga is fast full text search engine. +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/regexp-v2/begin-of-text/indexscan.out (+31 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/regexp-v2/begin-of-text/indexscan.out 2017-05-02 17:24:11 +0900 (a47514e) @@ -0,0 +1,31 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + QUERY PLAN +----------------------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content &~ '\Agroonga'::character varying) +(2 rows) + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + id | content +----+------------------------------------------ + 2 | Groonga is fast full text search engine. +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/regexp-v2/begin-of-text/seqscan.out (+21 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/regexp-v2/begin-of-text/seqscan.out 2017-05-02 17:24:11 +0900 (20c023e) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + id | content +----+------------------------------------------ + 2 | Groonga is fast full text search engine. +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/regexp-v2/dot/bitmapscan.out (+34 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/regexp-v2/dot/bitmapscan.out 2017-05-02 17:24:11 +0900 (dac4b1c) @@ -0,0 +1,34 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + QUERY PLAN +--------------------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content &~ '.roonga'::character varying) + -> Bitmap Index Scan on grnindex + Index Cond: (content &~ '.roonga'::character varying) +(4 rows) + +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + id | content +----+------------------------------------------------------- + 2 | Groonga is fast full text search engine. + 3 | PGroonga is a PostgreSQL extension that uses Groonga. +(2 rows) + +DROP TABLE memos; Added: expected/regexp/varchar/regexp-v2/dot/indexscan.out (+32 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/regexp-v2/dot/indexscan.out 2017-05-02 17:24:11 +0900 (22d4c99) @@ -0,0 +1,32 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + QUERY PLAN +--------------------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content &~ '.roonga'::character varying) +(2 rows) + +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + id | content +----+------------------------------------------------------- + 2 | Groonga is fast full text search engine. + 3 | PGroonga is a PostgreSQL extension that uses Groonga. +(2 rows) + +DROP TABLE memos; Added: expected/regexp/varchar/regexp-v2/dot/seqscan.out (+22 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/regexp-v2/dot/seqscan.out 2017-05-02 17:24:11 +0900 (3f70b3e) @@ -0,0 +1,22 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + id | content +----+------------------------------------------------------- + 2 | Groonga is fast full text search engine. + 3 | PGroonga is a PostgreSQL extension that uses Groonga. +(2 rows) + +DROP TABLE memos; Added: expected/regexp/varchar/regexp-v2/end-of-text/bitmapscan.out (+33 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/regexp-v2/end-of-text/bitmapscan.out 2017-05-02 17:24:11 +0900 (2ea8234) @@ -0,0 +1,33 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + QUERY PLAN +----------------------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content &~ 'groonga\z'::character varying) + -> Bitmap Index Scan on grnindex + Index Cond: (content &~ 'groonga\z'::character varying) +(4 rows) + +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + id | content +----+------------------------------------------------------ + 3 | PGroonga is a PostgreSQL extension that uses Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/regexp-v2/end-of-text/indexscan.out (+31 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/regexp-v2/end-of-text/indexscan.out 2017-05-02 17:24:11 +0900 (cc09fc7) @@ -0,0 +1,31 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + QUERY PLAN +----------------------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content &~ 'groonga\z'::character varying) +(2 rows) + +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + id | content +----+------------------------------------------------------ + 3 | PGroonga is a PostgreSQL extension that uses Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/regexp-v2/end-of-text/seqscan.out (+21 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/regexp-v2/end-of-text/seqscan.out 2017-05-02 17:24:11 +0900 (ed1860c) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + id | content +----+------------------------------------------------------ + 3 | PGroonga is a PostgreSQL extension that uses Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/regexp-v2/exact/bitmapscan.out (+33 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/regexp-v2/exact/bitmapscan.out 2017-05-02 17:24:11 +0900 (8d5ba8f) @@ -0,0 +1,33 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +INSERT INTO memos VALUES (1, 'PostgreSQL'); +INSERT INTO memos VALUES (2, 'Groonga'); +INSERT INTO memos VALUES (3, 'PGroonga'); +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + QUERY PLAN +------------------------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content &~ '\Agroonga\z'::character varying) + -> Bitmap Index Scan on grnindex + Index Cond: (content &~ '\Agroonga\z'::character varying) +(4 rows) + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + id | content +----+--------- + 2 | Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/regexp-v2/exact/indexscan.out (+31 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/regexp-v2/exact/indexscan.out 2017-05-02 17:24:11 +0900 (61148aa) @@ -0,0 +1,31 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +INSERT INTO memos VALUES (1, 'PostgreSQL'); +INSERT INTO memos VALUES (2, 'Groonga'); +INSERT INTO memos VALUES (3, 'PGroonga'); +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + QUERY PLAN +------------------------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content &~ '\Agroonga\z'::character varying) +(2 rows) + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + id | content +----+--------- + 2 | Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/regexp-v2/exact/seqscan.out (+21 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/regexp-v2/exact/seqscan.out 2017-05-02 17:24:11 +0900 (9456eb8) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +INSERT INTO memos VALUES (1, 'PostgreSQL'); +INSERT INTO memos VALUES (2, 'Groonga'); +INSERT INTO memos VALUES (3, 'PGroonga'); +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + id | content +----+--------- + 2 | Groonga +(1 row) + +DROP TABLE memos; Added: expected/regexp/varchar/regexp-v2/partial/bitmapscan.out (+34 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/regexp-v2/partial/bitmapscan.out 2017-05-02 17:24:11 +0900 (a50dd97) @@ -0,0 +1,34 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ 'groonga'; + QUERY PLAN +--------------------------------------------------------------- + Bitmap Heap Scan on memos + Recheck Cond: (content &~ 'groonga'::character varying) + -> Bitmap Index Scan on grnindex + Index Cond: (content &~ 'groonga'::character varying) +(4 rows) + +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; Added: expected/regexp/varchar/regexp-v2/partial/indexscan.out (+32 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/regexp-v2/partial/indexscan.out 2017-05-02 17:24:11 +0900 (c7870d6) @@ -0,0 +1,32 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ 'groonga'; + QUERY PLAN +--------------------------------------------------------- + Index Scan using grnindex on memos + Index Cond: (content &~ 'groonga'::character varying) +(2 rows) + +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; Added: expected/regexp/varchar/regexp-v2/partial/seqscan.out (+22 -0) 100644 =================================================================== --- /dev/null +++ expected/regexp/varchar/regexp-v2/partial/seqscan.out 2017-05-02 17:24:11 +0900 (d6bb711) @@ -0,0 +1,22 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); +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 pgroonga.varchar_regexp_ops_v2); +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) + +DROP TABLE memos; Added: sql/regexp/text/compatibility/v2/regexp-v1/begin-of-text/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/compatibility/v2/regexp-v1/begin-of-text/bitmapscan.sql 2017-05-02 17:24:11 +0900 (831a7fe) @@ -0,0 +1,26 @@ +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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + +DROP TABLE memos; Added: sql/regexp/text/compatibility/v2/regexp-v1/begin-of-text/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/compatibility/v2/regexp-v1/begin-of-text/indexscan.sql 2017-05-02 17:24:11 +0900 (081d3d5) @@ -0,0 +1,26 @@ +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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + +DROP TABLE memos; Added: sql/regexp/text/compatibility/v2/regexp-v1/begin-of-text/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/compatibility/v2/regexp-v1/begin-of-text/seqscan.sql 2017-05-02 17:24:11 +0900 (ef6f01a) @@ -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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + +DROP TABLE memos; Added: sql/regexp/text/compatibility/v2/regexp-v1/dot/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/compatibility/v2/regexp-v1/dot/bitmapscan.sql 2017-05-02 17:24:11 +0900 (021979c) @@ -0,0 +1,26 @@ +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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + +DROP TABLE memos; Added: sql/regexp/text/compatibility/v2/regexp-v1/dot/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/compatibility/v2/regexp-v1/dot/indexscan.sql 2017-05-02 17:24:11 +0900 (e61ba9e) @@ -0,0 +1,26 @@ +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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + +DROP TABLE memos; Added: sql/regexp/text/compatibility/v2/regexp-v1/dot/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/compatibility/v2/regexp-v1/dot/seqscan.sql 2017-05-02 17:24:11 +0900 (fcb2acc) @@ -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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + +DROP TABLE memos; Added: sql/regexp/text/compatibility/v2/regexp-v1/end-of-text/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/compatibility/v2/regexp-v1/end-of-text/bitmapscan.sql 2017-05-02 17:24:11 +0900 (f141320) @@ -0,0 +1,26 @@ +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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + +DROP TABLE memos; Added: sql/regexp/text/compatibility/v2/regexp-v1/end-of-text/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/compatibility/v2/regexp-v1/end-of-text/indexscan.sql 2017-05-02 17:24:11 +0900 (8ebd967) @@ -0,0 +1,26 @@ +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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + +DROP TABLE memos; Added: sql/regexp/text/compatibility/v2/regexp-v1/end-of-text/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/compatibility/v2/regexp-v1/end-of-text/seqscan.sql 2017-05-02 17:24:11 +0900 (7d52373) @@ -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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + +DROP TABLE memos; Added: sql/regexp/text/compatibility/v2/regexp-v1/exact/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/compatibility/v2/regexp-v1/exact/bitmapscan.sql 2017-05-02 17:24:11 +0900 (f988826) @@ -0,0 +1,26 @@ +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'); + +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + +DROP TABLE memos; Added: sql/regexp/text/compatibility/v2/regexp-v1/exact/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/compatibility/v2/regexp-v1/exact/indexscan.sql 2017-05-02 17:24:11 +0900 (637b5f1) @@ -0,0 +1,26 @@ +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'); + +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + +DROP TABLE memos; Added: sql/regexp/text/compatibility/v2/regexp-v1/exact/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/compatibility/v2/regexp-v1/exact/seqscan.sql 2017-05-02 17:24:11 +0900 (924f56b) @@ -0,0 +1,21 @@ +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'); + +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + +DROP TABLE memos; Added: sql/regexp/text/compatibility/v2/regexp-v1/partial/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/compatibility/v2/regexp-v1/partial/bitmapscan.sql 2017-05-02 17:24:11 +0900 (a8de21c) @@ -0,0 +1,26 @@ +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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ 'groonga'; + +SELECT id, content + FROM memos + WHERE content @~ 'groonga'; + +DROP TABLE memos; Added: sql/regexp/text/compatibility/v2/regexp-v1/partial/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/compatibility/v2/regexp-v1/partial/indexscan.sql 2017-05-02 17:24:11 +0900 (286eefc) @@ -0,0 +1,26 @@ +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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ 'groonga'; + +SELECT id, content + FROM memos + WHERE content @~ 'groonga'; + +DROP TABLE memos; Added: sql/regexp/text/compatibility/v2/regexp-v1/partial/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/compatibility/v2/regexp-v1/partial/seqscan.sql 2017-05-02 17:24:11 +0900 (548d6ce) @@ -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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content @~ 'groonga'; + +DROP TABLE memos; Added: sql/regexp/text/ilike-v2/begin-of-text/bitmapscan.sql (+27 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/ilike-v2/begin-of-text/bitmapscan.sql 2017-05-02 17:24:11 +0900 (fb93e9e) @@ -0,0 +1,27 @@ +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_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content ILIKE 'GROONGA%'; + +SELECT id, content + FROM memos + WHERE content ILIKE 'GROONGA%'; + +DROP TABLE memos; Added: sql/regexp/text/ilike-v2/begin-of-text/indexscan.sql (+27 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/ilike-v2/begin-of-text/indexscan.sql 2017-05-02 17:24:11 +0900 (aa455ce) @@ -0,0 +1,27 @@ +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_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content ILIKE 'GROONGA%'; + +SELECT id, content + FROM memos + WHERE content ILIKE 'GROONGA%'; + +DROP TABLE memos; Added: sql/regexp/text/ilike-v2/begin-of-text/seqscan.sql (+22 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/ilike-v2/begin-of-text/seqscan.sql 2017-05-02 17:24:11 +0900 (5582460) @@ -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%'; + +DROP TABLE memos; Added: sql/regexp/text/ilike-v2/end-of-text/bitmapscan.sql (+27 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/ilike-v2/end-of-text/bitmapscan.sql 2017-05-02 17:24:11 +0900 (95fdcf2) @@ -0,0 +1,27 @@ +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_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content ILIKE '%GROONGA'; + +SELECT id, content + FROM memos + WHERE content ILIKE '%GROONGA'; + +DROP TABLE memos; Added: sql/regexp/text/ilike-v2/end-of-text/indexscan.sql (+27 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/ilike-v2/end-of-text/indexscan.sql 2017-05-02 17:24:11 +0900 (956b700) @@ -0,0 +1,27 @@ +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_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content ILIKE '%GROONGA'; + +SELECT id, content + FROM memos + WHERE content ILIKE '%GROONGA'; + +DROP TABLE memos; Added: sql/regexp/text/ilike-v2/end-of-text/seqscan.sql (+22 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/ilike-v2/end-of-text/seqscan.sql 2017-05-02 17:24:11 +0900 (f673085) @@ -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'; + +DROP TABLE memos; Added: sql/regexp/text/ilike-v2/exact/bitmapscan.sql (+27 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/ilike-v2/exact/bitmapscan.sql 2017-05-02 17:24:11 +0900 (41a3379) @@ -0,0 +1,27 @@ +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; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content ILIKE 'GROONGA'; + +SELECT id, content + FROM memos + WHERE content ILIKE 'GROONGA'; + +DROP TABLE memos; Added: sql/regexp/text/ilike-v2/exact/indexscan.sql (+27 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/ilike-v2/exact/indexscan.sql 2017-05-02 17:24:11 +0900 (d2300ef) @@ -0,0 +1,27 @@ +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_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content ILIKE 'GROONGA'; + +SELECT id, content + FROM memos + WHERE content ILIKE 'GROONGA'; + +DROP TABLE memos; Added: sql/regexp/text/ilike-v2/exact/seqscan.sql (+22 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/ilike-v2/exact/seqscan.sql 2017-05-02 17:24:11 +0900 (c16af66) @@ -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_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content ILIKE 'GROONGA'; + +DROP TABLE memos; Added: sql/regexp/text/ilike-v2/partial/bitmapscan.sql (+27 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/ilike-v2/partial/bitmapscan.sql 2017-05-02 17:24:11 +0900 (8dced75) @@ -0,0 +1,27 @@ +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_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content ILIKE '%GROONGA%'; + +SELECT id, content + FROM memos + WHERE content ILIKE '%GROONGA%'; + +DROP TABLE memos; Added: sql/regexp/text/ilike-v2/partial/indexscan.sql (+27 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/ilike-v2/partial/indexscan.sql 2017-05-02 17:24:11 +0900 (341d78e) @@ -0,0 +1,27 @@ +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_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content ILIKE '%GROONGA%'; + +SELECT id, content + FROM memos + WHERE content ILIKE '%GROONGA%'; + +DROP TABLE memos; Added: sql/regexp/text/ilike-v2/partial/seqscan.sql (+22 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/ilike-v2/partial/seqscan.sql 2017-05-02 17:24:11 +0900 (680f7c8) @@ -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_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content ILIKE '%GROONGA%'; + +DROP TABLE memos; Added: sql/regexp/text/like-v2/begin-of-text/bitmapscan.sql (+27 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/like-v2/begin-of-text/bitmapscan.sql 2017-05-02 17:24:11 +0900 (7f253f6) @@ -0,0 +1,27 @@ +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_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga%'; + +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga%'; + +DROP TABLE memos; Added: sql/regexp/text/like-v2/begin-of-text/indexscan.sql (+27 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/like-v2/begin-of-text/indexscan.sql 2017-05-02 17:24:11 +0900 (2c4f74b) @@ -0,0 +1,27 @@ +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_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga%'; + +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga%'; + +DROP TABLE memos; Added: sql/regexp/text/like-v2/begin-of-text/seqscan.sql (+22 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/like-v2/begin-of-text/seqscan.sql 2017-05-02 17:24:11 +0900 (a91072f) @@ -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_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga%'; + +DROP TABLE memos; Added: sql/regexp/text/like-v2/end-of-text/bitmapscan.sql (+27 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/like-v2/end-of-text/bitmapscan.sql 2017-05-02 17:24:11 +0900 (d7c9e63) @@ -0,0 +1,27 @@ +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_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content LIKE '%Groonga'; + +SELECT id, content + FROM memos + WHERE content LIKE '%Groonga'; + +DROP TABLE memos; Added: sql/regexp/text/like-v2/end-of-text/indexscan.sql (+27 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/like-v2/end-of-text/indexscan.sql 2017-05-02 17:24:11 +0900 (5a11056) @@ -0,0 +1,27 @@ +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_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content LIKE '%Groonga'; + +SELECT id, content + FROM memos + WHERE content LIKE '%Groonga'; + +DROP TABLE memos; Added: sql/regexp/text/like-v2/end-of-text/seqscan.sql (+22 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/like-v2/end-of-text/seqscan.sql 2017-05-02 17:24:11 +0900 (a10f119) @@ -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_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content LIKE '%Groonga'; + +DROP TABLE memos; Added: sql/regexp/text/like-v2/exact/bitmapscan.sql (+27 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/like-v2/exact/bitmapscan.sql 2017-05-02 17:24:11 +0900 (fccb35b) @@ -0,0 +1,27 @@ +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_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga'; + +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga'; + +DROP TABLE memos; Added: sql/regexp/text/like-v2/exact/indexscan.sql (+27 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/like-v2/exact/indexscan.sql 2017-05-02 17:24:11 +0900 (a6441a2) @@ -0,0 +1,27 @@ +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_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga'; + +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga'; + +DROP TABLE memos; Added: sql/regexp/text/like-v2/exact/seqscan.sql (+22 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/like-v2/exact/seqscan.sql 2017-05-02 17:24:11 +0900 (f5e07b9) @@ -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_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content LIKE 'Groonga'; + +DROP TABLE memos; Added: sql/regexp/text/like-v2/partial/bitmapscan.sql (+27 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/like-v2/partial/bitmapscan.sql 2017-05-02 17:24:11 +0900 (91cfae4) @@ -0,0 +1,27 @@ +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_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content LIKE '%Groonga%'; + +SELECT id, content + FROM memos + WHERE content LIKE '%Groonga%'; + +DROP TABLE memos; Added: sql/regexp/text/like-v2/partial/indexscan.sql (+27 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/like-v2/partial/indexscan.sql 2017-05-02 17:24:11 +0900 (24ce359) @@ -0,0 +1,27 @@ +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_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content LIKE '%Groonga%'; + +SELECT id, content + FROM memos + WHERE content LIKE '%Groonga%'; + +DROP TABLE memos; Added: sql/regexp/text/like-v2/partial/seqscan.sql (+22 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/like-v2/partial/seqscan.sql 2017-05-02 17:24:11 +0900 (75c7048) @@ -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_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content LIKE '%Groonga%'; + +DROP TABLE memos; Added: sql/regexp/text/regexp-v2/begin-of-text/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/regexp-v2/begin-of-text/bitmapscan.sql 2017-05-02 17:24:11 +0900 (1f9daae) @@ -0,0 +1,26 @@ +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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + +DROP TABLE memos; Added: sql/regexp/text/regexp-v2/begin-of-text/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/regexp-v2/begin-of-text/indexscan.sql 2017-05-02 17:24:11 +0900 (1a22fc9) @@ -0,0 +1,26 @@ +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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + +DROP TABLE memos; Added: sql/regexp/text/regexp-v2/begin-of-text/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/regexp-v2/begin-of-text/seqscan.sql 2017-05-02 17:24:11 +0900 (4c5637f) @@ -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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + +DROP TABLE memos; Added: sql/regexp/text/regexp-v2/dot/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/regexp-v2/dot/bitmapscan.sql 2017-05-02 17:24:11 +0900 (3eff107) @@ -0,0 +1,26 @@ +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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + +DROP TABLE memos; Added: sql/regexp/text/regexp-v2/dot/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/regexp-v2/dot/indexscan.sql 2017-05-02 17:24:11 +0900 (6af22e6) @@ -0,0 +1,26 @@ +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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + +DROP TABLE memos; Added: sql/regexp/text/regexp-v2/dot/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/regexp-v2/dot/seqscan.sql 2017-05-02 17:24:11 +0900 (309ffc5) @@ -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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + +DROP TABLE memos; Added: sql/regexp/text/regexp-v2/end-of-text/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/regexp-v2/end-of-text/bitmapscan.sql 2017-05-02 17:24:11 +0900 (edf0851) @@ -0,0 +1,26 @@ +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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + +DROP TABLE memos; Added: sql/regexp/text/regexp-v2/end-of-text/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/regexp-v2/end-of-text/indexscan.sql 2017-05-02 17:24:11 +0900 (13f5dbf) @@ -0,0 +1,26 @@ +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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + +DROP TABLE memos; Added: sql/regexp/text/regexp-v2/end-of-text/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/regexp-v2/end-of-text/seqscan.sql 2017-05-02 17:24:11 +0900 (052a66a) @@ -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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + +DROP TABLE memos; Added: sql/regexp/text/regexp-v2/exact/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/regexp-v2/exact/bitmapscan.sql 2017-05-02 17:24:11 +0900 (c10d21e) @@ -0,0 +1,26 @@ +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'); + +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + +DROP TABLE memos; Added: sql/regexp/text/regexp-v2/exact/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/regexp-v2/exact/indexscan.sql 2017-05-02 17:24:11 +0900 (0f07b57) @@ -0,0 +1,26 @@ +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'); + +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + +DROP TABLE memos; Added: sql/regexp/text/regexp-v2/exact/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/regexp-v2/exact/seqscan.sql 2017-05-02 17:24:11 +0900 (9db5105) @@ -0,0 +1,21 @@ +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'); + +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + +DROP TABLE memos; Added: sql/regexp/text/regexp-v2/partial/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/regexp-v2/partial/bitmapscan.sql 2017-05-02 17:24:11 +0900 (c8e459b) @@ -0,0 +1,26 @@ +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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ 'groonga'; + +SELECT id, content + FROM memos + WHERE content &~ 'groonga'; + +DROP TABLE memos; Added: sql/regexp/text/regexp-v2/partial/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/regexp-v2/partial/indexscan.sql 2017-05-02 17:24:11 +0900 (614ed59) @@ -0,0 +1,26 @@ +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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ 'groonga'; + +SELECT id, content + FROM memos + WHERE content &~ 'groonga'; + +DROP TABLE memos; Added: sql/regexp/text/regexp-v2/partial/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/text/regexp-v2/partial/seqscan.sql 2017-05-02 17:24:11 +0900 (4413bd4) @@ -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 pgroonga.text_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content &~ 'groonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/bitmapscan.sql 2017-05-02 17:24:11 +0900 (6cbe1a2) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/indexscan.sql 2017-05-02 17:24:11 +0900 (661bfc9) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/compatibility/v2/regexp-v1/begin-of-text/seqscan.sql 2017-05-02 17:24:11 +0900 (e090d7b) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/compatibility/v2/regexp-v1/dot/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/compatibility/v2/regexp-v1/dot/bitmapscan.sql 2017-05-02 17:24:11 +0900 (51314f5) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/compatibility/v2/regexp-v1/dot/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/compatibility/v2/regexp-v1/dot/indexscan.sql 2017-05-02 17:24:11 +0900 (e934381) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/compatibility/v2/regexp-v1/dot/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/compatibility/v2/regexp-v1/dot/seqscan.sql 2017-05-02 17:24:11 +0900 (fb824d6) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content @~ '.roonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/bitmapscan.sql 2017-05-02 17:24:11 +0900 (424e654) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + +DROP TABLE memos; Added: sql/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/indexscan.sql 2017-05-02 17:24:11 +0900 (8226981) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + +DROP TABLE memos; Added: sql/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/compatibility/v2/regexp-v1/end-of-text/seqscan.sql 2017-05-02 17:24:11 +0900 (efb9200) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content @~ 'groonga\z'; + +DROP TABLE memos; Added: sql/regexp/varchar/compatibility/v2/regexp-v1/exact/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/compatibility/v2/regexp-v1/exact/bitmapscan.sql 2017-05-02 17:24:11 +0900 (94a121c) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +INSERT INTO memos VALUES (1, 'PostgreSQL'); +INSERT INTO memos VALUES (2, 'Groonga'); +INSERT INTO memos VALUES (3, 'PGroonga'); + +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + +DROP TABLE memos; Added: sql/regexp/varchar/compatibility/v2/regexp-v1/exact/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/compatibility/v2/regexp-v1/exact/indexscan.sql 2017-05-02 17:24:11 +0900 (5b62290) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +INSERT INTO memos VALUES (1, 'PostgreSQL'); +INSERT INTO memos VALUES (2, 'Groonga'); +INSERT INTO memos VALUES (3, 'PGroonga'); + +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + +DROP TABLE memos; Added: sql/regexp/varchar/compatibility/v2/regexp-v1/exact/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/compatibility/v2/regexp-v1/exact/seqscan.sql 2017-05-02 17:24:11 +0900 (dc349d7) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +INSERT INTO memos VALUES (1, 'PostgreSQL'); +INSERT INTO memos VALUES (2, 'Groonga'); +INSERT INTO memos VALUES (3, 'PGroonga'); + +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content @~ '\Agroonga\z'; + +DROP TABLE memos; Added: sql/regexp/varchar/compatibility/v2/regexp-v1/partial/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/compatibility/v2/regexp-v1/partial/bitmapscan.sql 2017-05-02 17:24:11 +0900 (947cb96) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ 'groonga'; + +SELECT id, content + FROM memos + WHERE content @~ 'groonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/compatibility/v2/regexp-v1/partial/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/compatibility/v2/regexp-v1/partial/indexscan.sql 2017-05-02 17:24:11 +0900 (618f6b4) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content @~ 'groonga'; + +SELECT id, content + FROM memos + WHERE content @~ 'groonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/compatibility/v2/regexp-v1/partial/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/compatibility/v2/regexp-v1/partial/seqscan.sql 2017-05-02 17:24:11 +0900 (cf63136) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content @~ 'groonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/regexp-v2/begin-of-text/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/regexp-v2/begin-of-text/bitmapscan.sql 2017-05-02 17:24:11 +0900 (e4115f3) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/regexp-v2/begin-of-text/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/regexp-v2/begin-of-text/indexscan.sql 2017-05-02 17:24:11 +0900 (98da356) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/regexp-v2/begin-of-text/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/regexp-v2/begin-of-text/seqscan.sql 2017-05-02 17:24:11 +0900 (f80f672) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/regexp-v2/dot/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/regexp-v2/dot/bitmapscan.sql 2017-05-02 17:24:11 +0900 (98c779e) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/regexp-v2/dot/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/regexp-v2/dot/indexscan.sql 2017-05-02 17:24:11 +0900 (5f8f61e) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/regexp-v2/dot/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/regexp-v2/dot/seqscan.sql 2017-05-02 17:24:11 +0900 (7451f55) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content &~ '.roonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/regexp-v2/end-of-text/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/regexp-v2/end-of-text/bitmapscan.sql 2017-05-02 17:24:11 +0900 (549f2a1) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + +DROP TABLE memos; Added: sql/regexp/varchar/regexp-v2/end-of-text/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/regexp-v2/end-of-text/indexscan.sql 2017-05-02 17:24:11 +0900 (ff38eec) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + +DROP TABLE memos; Added: sql/regexp/varchar/regexp-v2/end-of-text/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/regexp-v2/end-of-text/seqscan.sql 2017-05-02 17:24:11 +0900 (bcb332b) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content &~ 'groonga\z'; + +DROP TABLE memos; Added: sql/regexp/varchar/regexp-v2/exact/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/regexp-v2/exact/bitmapscan.sql 2017-05-02 17:24:11 +0900 (e1f9d32) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +INSERT INTO memos VALUES (1, 'PostgreSQL'); +INSERT INTO memos VALUES (2, 'Groonga'); +INSERT INTO memos VALUES (3, 'PGroonga'); + +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + +DROP TABLE memos; Added: sql/regexp/varchar/regexp-v2/exact/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/regexp-v2/exact/indexscan.sql 2017-05-02 17:24:11 +0900 (9cb48e3) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +INSERT INTO memos VALUES (1, 'PostgreSQL'); +INSERT INTO memos VALUES (2, 'Groonga'); +INSERT INTO memos VALUES (3, 'PGroonga'); + +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + +DROP TABLE memos; Added: sql/regexp/varchar/regexp-v2/exact/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/regexp-v2/exact/seqscan.sql 2017-05-02 17:24:11 +0900 (2f239dd) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +INSERT INTO memos VALUES (1, 'PostgreSQL'); +INSERT INTO memos VALUES (2, 'Groonga'); +INSERT INTO memos VALUES (3, 'PGroonga'); + +CREATE INDEX grnindex ON memos + USING pgroonga (content pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content &~ '\Agroonga\z'; + +DROP TABLE memos; Added: sql/regexp/varchar/regexp-v2/partial/bitmapscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/regexp-v2/partial/bitmapscan.sql 2017-05-02 17:24:11 +0900 (29f7b38) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ 'groonga'; + +SELECT id, content + FROM memos + WHERE content &~ 'groonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/regexp-v2/partial/indexscan.sql (+26 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/regexp-v2/partial/indexscan.sql 2017-05-02 17:24:11 +0900 (41a8109) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +EXPLAIN (COSTS OFF) +SELECT id, content + FROM memos + WHERE content &~ 'groonga'; + +SELECT id, content + FROM memos + WHERE content &~ 'groonga'; + +DROP TABLE memos; Added: sql/regexp/varchar/regexp-v2/partial/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/regexp/varchar/regexp-v2/partial/seqscan.sql 2017-05-02 17:24:11 +0900 (c21c388) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + id integer, + content varchar(256) +); + +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 pgroonga.varchar_regexp_ops_v2); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content &~ 'groonga'; + +DROP TABLE memos; Modified: src/pgroonga.c (+38 -1) =================================================================== --- src/pgroonga.c 2017-05-02 16:17:16 +0900 (101304d) +++ src/pgroonga.c 2017-05-02 17:24:11 +0900 (fac8a9b) @@ -213,6 +213,8 @@ PGRN_FUNCTION_INFO_V1(pgroonga_prefix_in_text); PGRN_FUNCTION_INFO_V1(pgroonga_prefix_in_text_array); PGRN_FUNCTION_INFO_V1(pgroonga_prefix_rk_in_text); PGRN_FUNCTION_INFO_V1(pgroonga_prefix_rk_in_text_array); +PGRN_FUNCTION_INFO_V1(pgroonga_regexp_text); +PGRN_FUNCTION_INFO_V1(pgroonga_regexp_varchar); PGRN_FUNCTION_INFO_V1(pgroonga_insert); PGRN_FUNCTION_INFO_V1(pgroonga_beginscan); @@ -2410,6 +2412,40 @@ pgroonga_prefix_rk_in_text_array(PG_FUNCTION_ARGS) PG_RETURN_BOOL(matched); } +/** + * pgroonga.regexp_text(target text, pattern text) : bool + */ +Datum +pgroonga_regexp_text(PG_FUNCTION_ARGS) +{ + text *target = PG_GETARG_TEXT_PP(0); + text *pattern = PG_GETARG_TEXT_PP(1); + grn_bool matched; + + matched = pgroonga_match_regexp_raw(VARDATA_ANY(target), + VARSIZE_ANY_EXHDR(target), + VARDATA_ANY(pattern), + VARSIZE_ANY_EXHDR(pattern)); + PG_RETURN_BOOL(matched); +} + +/** + * pgroonga.regexp_varchar(target varchar, pattern varchar) : bool + */ +Datum +pgroonga_regexp_varchar(PG_FUNCTION_ARGS) +{ + VarChar *target = PG_GETARG_VARCHAR_PP(0); + VarChar *pattern = PG_GETARG_VARCHAR_PP(1); + grn_bool matched; + + matched = pgroonga_match_regexp_raw(VARDATA_ANY(target), + VARSIZE_ANY_EXHDR(target), + VARDATA_ANY(pattern), + VARSIZE_ANY_EXHDR(pattern)); + PG_RETURN_BOOL(matched); +} + static bool PGrnNeedMaxRecordSizeUpdate(Relation index) @@ -3301,12 +3337,13 @@ PGrnSearchBuildCondition(Relation index, case PGrnPrefixRKInStrategyV2Number: break; case PGrnRegexpStrategyNumber: + case PGrnRegexpStrategyV2Number: operator = GRN_OP_REGEXP; break; case PGrnQueryInStrategyV2Number: break; case PGrnMatchInStrategyV2Number: - operator = GRN_OP_REGEXP; + operator = GRN_OP_MATCH; break; default: ereport(ERROR, Modified: src/pgroonga.h (+2 -1) =================================================================== --- src/pgroonga.h 2017-05-02 16:17:16 +0900 (0a4418a) +++ src/pgroonga.h 2017-05-02 17:24:11 +0900 (7272bee) @@ -34,8 +34,9 @@ #define PGrnQueryInStrategyV2Number 19 /* operator &?> (query in Groonga) */ #define PGrnPrefixInStrategyV2Number 20 /* operator &^> (prefix search) */ #define PGrnPrefixRKInStrategyV2Number 21 /* operator &^~> (prefix RK search) */ +#define PGrnRegexpStrategyV2Number 22 /* operator &~ (@~ in Groonga) */ -#define PGRN_N_STRATEGIES PGrnPrefixRKInStrategyV2Number +#define PGRN_N_STRATEGIES PGrnRegexpStrategyV2Number /* file and table names */ #define PGrnLogPathDefault "pgroonga.log"