Kouhei Sutou
null+****@clear*****
Tue May 2 15:23:22 JST 2017
Kouhei Sutou 2017-05-02 15:23:22 +0900 (Tue, 02 May 2017) New Revision: 389f21c816df103c434b8b921607e0342a1f09ad https://github.com/pgroonga/pgroonga/commit/389f21c816df103c434b8b921607e0342a1f09ad Message: Add v2 compatible operators to pgroonga.varchar_full_text_search_ops Added files: expected/full-text-search/varchar/single/compatibility/v1/match-v2/bitmapscan.out expected/full-text-search/varchar/single/compatibility/v1/match-v2/indexscan.out expected/full-text-search/varchar/single/compatibility/v1/match-v2/seqscan.out expected/full-text-search/varchar/single/compatibility/v1/query-v2/bitmapscan.out expected/full-text-search/varchar/single/compatibility/v1/query-v2/indexscan.out expected/full-text-search/varchar/single/compatibility/v1/query-v2/seqscan.out sql/full-text-search/varchar/single/compatibility/v1/match-v2/bitmapscan.sql sql/full-text-search/varchar/single/compatibility/v1/match-v2/indexscan.sql sql/full-text-search/varchar/single/compatibility/v1/match-v2/seqscan.sql sql/full-text-search/varchar/single/compatibility/v1/query-v2/bitmapscan.sql sql/full-text-search/varchar/single/compatibility/v1/query-v2/indexscan.sql sql/full-text-search/varchar/single/compatibility/v1/query-v2/seqscan.sql Modified files: data/pgroonga--1.2.0--1.2.1.sql data/pgroonga.sql Modified: data/pgroonga--1.2.0--1.2.1.sql (+6 -0) =================================================================== --- data/pgroonga--1.2.0--1.2.1.sql 2017-05-02 15:16:15 +0900 (799a890) +++ data/pgroonga--1.2.0--1.2.1.sql 2017-05-02 15:23:22 +0900 (2f07bc5) @@ -227,3 +227,9 @@ CREATE OPERATOR CLASS pgroonga.varchar_full_text_search_ops_v2 OPERATOR 15 &`, OPERATOR 18 &@> (varchar, varchar[]), OPERATOR 19 &?> (varchar, varchar[]); + +-- Add v2 compatible operators to full text search ops for varchar +ALTER OPERATOR FAMILY pgroonga.varchar_full_text_search_ops USING pgroonga + ADD + OPERATOR 12 &@ (varchar, varchar), + OPERATOR 13 &? (varchar, varchar); Modified: data/pgroonga.sql (+3 -1) =================================================================== --- data/pgroonga.sql 2017-05-02 15:16:15 +0900 (d93fe8b) +++ data/pgroonga.sql 2017-05-02 15:23:22 +0900 (a57f275) @@ -690,7 +690,9 @@ CREATE OPERATOR CLASS pgroonga.text_array_full_text_search_ops CREATE OPERATOR CLASS pgroonga.varchar_full_text_search_ops FOR TYPE varchar USING pgroonga AS OPERATOR 8 %%, - OPERATOR 9 @@; + OPERATOR 9 @@, + OPERATOR 12 &@, + OPERATOR 13 &?; CREATE OPERATOR CLASS pgroonga.varchar_ops DEFAULT FOR TYPE varchar USING pgroonga AS Added: expected/full-text-search/varchar/single/compatibility/v1/match-v2/bitmapscan.out (+22 -0) 100644 =================================================================== --- /dev/null +++ expected/full-text-search/varchar/single/compatibility/v1/match-v2/bitmapscan.out 2017-05-02 15:23:22 +0900 (1cb84af) @@ -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_full_text_search_ops); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +SELECT id, content + FROM memos + WHERE content &@ 'Groonga'; + id | content +----+------------------------------------------------------- + 2 | Groonga is fast full text search engine. + 3 | PGroonga is a PostgreSQL extension that uses Groonga. +(2 rows) + +DROP TABLE memos; Added: expected/full-text-search/varchar/single/compatibility/v1/match-v2/indexscan.out (+22 -0) 100644 =================================================================== --- /dev/null +++ expected/full-text-search/varchar/single/compatibility/v1/match-v2/indexscan.out 2017-05-02 15:23:22 +0900 (4722483) @@ -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_full_text_search_ops); +SET enable_seqscan = off; +SET enable_indexscan = on; +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/full-text-search/varchar/single/compatibility/v1/match-v2/seqscan.out (+22 -0) 100644 =================================================================== --- /dev/null +++ expected/full-text-search/varchar/single/compatibility/v1/match-v2/seqscan.out 2017-05-02 15:23:22 +0900 (8a36dee) @@ -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_full_text_search_ops); +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/full-text-search/varchar/single/compatibility/v1/query-v2/bitmapscan.out (+22 -0) 100644 =================================================================== --- /dev/null +++ expected/full-text-search/varchar/single/compatibility/v1/query-v2/bitmapscan.out 2017-05-02 15:23:22 +0900 (ab95025) @@ -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_full_text_search_ops); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +SELECT id, content + FROM memos + WHERE content &? 'rdbms OR engine'; + id | content +----+------------------------------------------ + 1 | PostgreSQL is a RDBMS. + 2 | Groonga is fast full text search engine. +(2 rows) + +DROP TABLE memos; Added: expected/full-text-search/varchar/single/compatibility/v1/query-v2/indexscan.out (+22 -0) 100644 =================================================================== --- /dev/null +++ expected/full-text-search/varchar/single/compatibility/v1/query-v2/indexscan.out 2017-05-02 15:23:22 +0900 (8516491) @@ -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_full_text_search_ops); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content &? 'rdbms OR engine'; + id | content +----+------------------------------------------ + 1 | PostgreSQL is a RDBMS. + 2 | Groonga is fast full text search engine. +(2 rows) + +DROP TABLE memos; Added: expected/full-text-search/varchar/single/compatibility/v1/query-v2/seqscan.out (+23 -0) 100644 =================================================================== --- /dev/null +++ expected/full-text-search/varchar/single/compatibility/v1/query-v2/seqscan.out 2017-05-02 15:23:22 +0900 (831c77e) @@ -0,0 +1,23 @@ +SET search_path = "$user",public,pgroonga,pg_catalog; +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_full_text_search_ops); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content &? 'rdbms OR engine'; + id | content +----+------------------------------------------ + 1 | PostgreSQL is a RDBMS. + 2 | Groonga is fast full text search engine. +(2 rows) + +DROP TABLE memos; Added: sql/full-text-search/varchar/single/compatibility/v1/match-v2/bitmapscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/full-text-search/varchar/single/compatibility/v1/match-v2/bitmapscan.sql 2017-05-02 15:23:22 +0900 (58f08b7) @@ -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_full_text_search_ops); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +SELECT id, content + FROM memos + WHERE content &@ 'Groonga'; + +DROP TABLE memos; Added: sql/full-text-search/varchar/single/compatibility/v1/match-v2/indexscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/full-text-search/varchar/single/compatibility/v1/match-v2/indexscan.sql 2017-05-02 15:23:22 +0900 (1377198) @@ -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_full_text_search_ops); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content &@ 'Groonga'; + +DROP TABLE memos; Added: sql/full-text-search/varchar/single/compatibility/v1/match-v2/seqscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/full-text-search/varchar/single/compatibility/v1/match-v2/seqscan.sql 2017-05-02 15:23:22 +0900 (8c1258e) @@ -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_full_text_search_ops); + +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/full-text-search/varchar/single/compatibility/v1/query-v2/bitmapscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/full-text-search/varchar/single/compatibility/v1/query-v2/bitmapscan.sql 2017-05-02 15:23:22 +0900 (f8d54ce) @@ -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_full_text_search_ops); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +SELECT id, content + FROM memos + WHERE content &? 'rdbms OR engine'; + +DROP TABLE memos; Added: sql/full-text-search/varchar/single/compatibility/v1/query-v2/indexscan.sql (+21 -0) 100644 =================================================================== --- /dev/null +++ sql/full-text-search/varchar/single/compatibility/v1/query-v2/indexscan.sql 2017-05-02 15:23:22 +0900 (59eb473) @@ -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_full_text_search_ops); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content &? 'rdbms OR engine'; + +DROP TABLE memos; Added: sql/full-text-search/varchar/single/compatibility/v1/query-v2/seqscan.sql (+23 -0) 100644 =================================================================== --- /dev/null +++ sql/full-text-search/varchar/single/compatibility/v1/query-v2/seqscan.sql 2017-05-02 15:23:22 +0900 (d9a1ca9) @@ -0,0 +1,23 @@ +SET search_path = "$user",public,pgroonga,pg_catalog; + +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_full_text_search_ops); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content &? 'rdbms OR engine'; + +DROP TABLE memos; -------------- next part -------------- HTML����������������������������...Download