Kouhei Sutou
null+****@clear*****
Tue May 2 09:17:05 JST 2017
Kouhei Sutou 2017-05-02 09:17:05 +0900 (Tue, 02 May 2017) New Revision: d81177b5ac5144b9e409727db7c0a75b7b80a713 https://github.com/pgroonga/pgroonga/commit/d81177b5ac5144b9e409727db7c0a75b7b80a713 Message: test: put full text search related tests into full-text-search/ Added files: expected/full-text-search/text-array/single/match/bitmapscan.out expected/full-text-search/text-array/single/match/indexscan.out expected/full-text-search/text-array/single/match/seqscan.out expected/full-text-search/text-array/single/query/bitmapscan.out expected/full-text-search/text-array/single/query/indexscan.out expected/full-text-search/text-array/single/query/seqscan.out expected/full-text-search/varchar-array/single/match/bitmapscan.out expected/full-text-search/varchar-array/single/match/indexscan.out expected/full-text-search/varchar-array/single/match/seqscan.out sql/full-text-search/text-array/single/match/bitmapscan.sql sql/full-text-search/text-array/single/match/indexscan.sql sql/full-text-search/text-array/single/match/seqscan.sql sql/full-text-search/text-array/single/query/bitmapscan.sql sql/full-text-search/text-array/single/query/indexscan.sql sql/full-text-search/text-array/single/query/seqscan.sql sql/full-text-search/varchar-array/single/match/bitmapscan.sql sql/full-text-search/varchar-array/single/match/indexscan.sql sql/full-text-search/varchar-array/single/match/seqscan.sql Added: expected/full-text-search/text-array/single/match/bitmapscan.out (+29 -0) 100644 =================================================================== --- /dev/null +++ expected/full-text-search/text-array/single/match/bitmapscan.out 2017-05-02 09:17:05 +0900 (f5fd603) @@ -0,0 +1,29 @@ +CREATE TABLE memos ( + title text, + contents text[] +); +INSERT INTO memos + VALUES ('PostgreSQL', + ARRAY['PostgreSQL is an OSS RDBMS', + 'PostgreSQL has partial full-text search support']); +INSERT INTO memos + VALUES ('Groonga', ARRAY['Groonga is an OSS full-text search engine', + 'Groonga has full full-text search support']); +INSERT INTO memos + VALUES ('PGroonga', + ARRAY['PGroonga is an OSS PostgreSQL extension', + 'PGroonga adds full full-text search support based on Groonga to PostgreSQL']); +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (contents); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +SELECT title, contents + FROM memos + WHERE contents %% 'Groonga'; + title | contents +----------+-------------------------------------------------------------------------------------------------------------------------- + Groonga | {"Groonga is an OSS full-text search engine","Groonga has full full-text search support"} + PGroonga | {"PGroonga is an OSS PostgreSQL extension","PGroonga adds full full-text search support based on Groonga to PostgreSQL"} +(2 rows) + +DROP TABLE memos; Added: expected/full-text-search/text-array/single/match/indexscan.out (+29 -0) 100644 =================================================================== --- /dev/null +++ expected/full-text-search/text-array/single/match/indexscan.out 2017-05-02 09:17:05 +0900 (e23faa2) @@ -0,0 +1,29 @@ +CREATE TABLE memos ( + title text, + contents text[] +); +INSERT INTO memos + VALUES ('PostgreSQL', + ARRAY['PostgreSQL is an OSS RDBMS', + 'PostgreSQL has partial full-text search support']); +INSERT INTO memos + VALUES ('Groonga', ARRAY['Groonga is an OSS full-text search engine', + 'Groonga has full full-text search support']); +INSERT INTO memos + VALUES ('PGroonga', + ARRAY['PGroonga is an OSS PostgreSQL extension', + 'PGroonga adds full full-text search support based on Groonga to PostgreSQL']); +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (contents); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +SELECT title, contents + FROM memos + WHERE contents %% 'Groonga'; + title | contents +----------+-------------------------------------------------------------------------------------------------------------------------- + Groonga | {"Groonga is an OSS full-text search engine","Groonga has full full-text search support"} + PGroonga | {"PGroonga is an OSS PostgreSQL extension","PGroonga adds full full-text search support based on Groonga to PostgreSQL"} +(2 rows) + +DROP TABLE memos; Added: expected/full-text-search/text-array/single/match/seqscan.out (+29 -0) 100644 =================================================================== --- /dev/null +++ expected/full-text-search/text-array/single/match/seqscan.out 2017-05-02 09:17:05 +0900 (1c0d0a0) @@ -0,0 +1,29 @@ +CREATE TABLE memos ( + title text, + contents text[] +); +INSERT INTO memos + VALUES ('PostgreSQL', + ARRAY['PostgreSQL is an OSS RDBMS', + 'PostgreSQL has partial full-text search support']); +INSERT INTO memos + VALUES ('Groonga', ARRAY['Groonga is an OSS full-text search engine', + 'Groonga has full full-text search support']); +INSERT INTO memos + VALUES ('PGroonga', + ARRAY['PGroonga is an OSS PostgreSQL extension', + 'PGroonga adds full full-text search support based on Groonga to PostgreSQL']); +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (contents); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT title, contents + FROM memos + WHERE contents %% 'Groonga'; + title | contents +----------+-------------------------------------------------------------------------------------------------------------------------- + Groonga | {"Groonga is an OSS full-text search engine","Groonga has full full-text search support"} + PGroonga | {"PGroonga is an OSS PostgreSQL extension","PGroonga adds full full-text search support based on Groonga to PostgreSQL"} +(2 rows) + +DROP TABLE memos; Added: expected/full-text-search/text-array/single/query/bitmapscan.out (+29 -0) 100644 =================================================================== --- /dev/null +++ expected/full-text-search/text-array/single/query/bitmapscan.out 2017-05-02 09:17:05 +0900 (f7353bf) @@ -0,0 +1,29 @@ +CREATE TABLE memos ( + title text, + contents text[] +); +INSERT INTO memos + VALUES ('PostgreSQL', + ARRAY['PostgreSQL is an OSS RDBMS', + 'PostgreSQL has partial full-text search support']); +INSERT INTO memos + VALUES ('Groonga', ARRAY['Groonga is an OSS full-text search engine', + 'Groonga has full full-text search support']); +INSERT INTO memos + VALUES ('PGroonga', + ARRAY['PGroonga is an OSS PostgreSQL extension', + 'PGroonga adds full full-text search support based on Groonga to PostgreSQL']); +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (contents); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +SELECT title, contents + FROM memos + WHERE contents @@ 'rdbms OR engine'; + title | contents +------------+------------------------------------------------------------------------------------------- + PostgreSQL | {"PostgreSQL is an OSS RDBMS","PostgreSQL has partial full-text search support"} + Groonga | {"Groonga is an OSS full-text search engine","Groonga has full full-text search support"} +(2 rows) + +DROP TABLE memos; Added: expected/full-text-search/text-array/single/query/indexscan.out (+29 -0) 100644 =================================================================== --- /dev/null +++ expected/full-text-search/text-array/single/query/indexscan.out 2017-05-02 09:17:05 +0900 (ab54ab7) @@ -0,0 +1,29 @@ +CREATE TABLE memos ( + title text, + contents text[] +); +INSERT INTO memos + VALUES ('PostgreSQL', + ARRAY['PostgreSQL is an OSS RDBMS', + 'PostgreSQL has partial full-text search support']); +INSERT INTO memos + VALUES ('Groonga', ARRAY['Groonga is an OSS full-text search engine', + 'Groonga has full full-text search support']); +INSERT INTO memos + VALUES ('PGroonga', + ARRAY['PGroonga is an OSS PostgreSQL extension', + 'PGroonga adds full full-text search support based on Groonga to PostgreSQL']); +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (contents); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +SELECT title, contents + FROM memos + WHERE contents @@ 'rdbms OR engine'; + title | contents +------------+------------------------------------------------------------------------------------------- + PostgreSQL | {"PostgreSQL is an OSS RDBMS","PostgreSQL has partial full-text search support"} + Groonga | {"Groonga is an OSS full-text search engine","Groonga has full full-text search support"} +(2 rows) + +DROP TABLE memos; Added: expected/full-text-search/text-array/single/query/seqscan.out (+29 -0) 100644 =================================================================== --- /dev/null +++ expected/full-text-search/text-array/single/query/seqscan.out 2017-05-02 09:17:05 +0900 (dcab8f5) @@ -0,0 +1,29 @@ +CREATE TABLE memos ( + title text, + contents text[] +); +INSERT INTO memos + VALUES ('PostgreSQL', + ARRAY['PostgreSQL is an OSS RDBMS', + 'PostgreSQL has partial full-text search support']); +INSERT INTO memos + VALUES ('Groonga', ARRAY['Groonga is an OSS full-text search engine', + 'Groonga has full full-text search support']); +INSERT INTO memos + VALUES ('PGroonga', + ARRAY['PGroonga is an OSS PostgreSQL extension', + 'PGroonga adds full full-text search support based on Groonga to PostgreSQL']); +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (contents); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT title, contents + FROM memos + WHERE contents @@ 'rdbms OR engine'; + title | contents +------------+------------------------------------------------------------------------------------------- + PostgreSQL | {"PostgreSQL is an OSS RDBMS","PostgreSQL has partial full-text search support"} + Groonga | {"Groonga is an OSS full-text search engine","Groonga has full full-text search support"} +(2 rows) + +DROP TABLE memos; Added: expected/full-text-search/varchar-array/single/match/bitmapscan.out (+21 -0) 100644 =================================================================== --- /dev/null +++ expected/full-text-search/varchar-array/single/match/bitmapscan.out 2017-05-02 09:17:05 +0900 (52c5847) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + title text, + tags varchar(1023)[] +); +INSERT INTO memos VALUES ('PostgreSQL', ARRAY['PostgreSQL']); +INSERT INTO memos VALUES ('Groonga', ARRAY['Groonga']); +INSERT INTO memos VALUES ('PGroonga', ARRAY['PostgreSQL', 'Groonga']); +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (tags); +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; +SELECT title, tags + FROM memos + WHERE tags %% 'Groonga'; + title | tags +----------+---------------------- + Groonga | {Groonga} + PGroonga | {PostgreSQL,Groonga} +(2 rows) + +DROP TABLE memos; Added: expected/full-text-search/varchar-array/single/match/indexscan.out (+21 -0) 100644 =================================================================== --- /dev/null +++ expected/full-text-search/varchar-array/single/match/indexscan.out 2017-05-02 09:17:05 +0900 (b17f753) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + title text, + tags varchar(1023)[] +); +INSERT INTO memos VALUES ('PostgreSQL', ARRAY['PostgreSQL']); +INSERT INTO memos VALUES ('Groonga', ARRAY['Groonga']); +INSERT INTO memos VALUES ('PGroonga', ARRAY['PostgreSQL', 'Groonga']); +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (tags); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +SELECT title, tags + FROM memos + WHERE tags %% 'Groonga'; + title | tags +----------+---------------------- + Groonga | {Groonga} + PGroonga | {PostgreSQL,Groonga} +(2 rows) + +DROP TABLE memos; Added: expected/full-text-search/varchar-array/single/match/seqscan.out (+21 -0) 100644 =================================================================== --- /dev/null +++ expected/full-text-search/varchar-array/single/match/seqscan.out 2017-05-02 09:17:05 +0900 (517a48f) @@ -0,0 +1,21 @@ +CREATE TABLE memos ( + title text, + tags varchar(1023)[] +); +INSERT INTO memos VALUES ('PostgreSQL', ARRAY['PostgreSQL']); +INSERT INTO memos VALUES ('Groonga', ARRAY['Groonga']); +INSERT INTO memos VALUES ('PGroonga', ARRAY['PostgreSQL', 'Groonga']); +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (tags); +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; +SELECT title, tags + FROM memos + WHERE tags %% 'Groonga'; + title | tags +----------+---------------------- + Groonga | {Groonga} + PGroonga | {PostgreSQL,Groonga} +(2 rows) + +DROP TABLE memos; Added: sql/full-text-search/text-array/single/match/bitmapscan.sql (+28 -0) 100644 =================================================================== --- /dev/null +++ sql/full-text-search/text-array/single/match/bitmapscan.sql 2017-05-02 09:17:05 +0900 (5a906ab) @@ -0,0 +1,28 @@ +CREATE TABLE memos ( + title text, + contents text[] +); + +INSERT INTO memos + VALUES ('PostgreSQL', + ARRAY['PostgreSQL is an OSS RDBMS', + 'PostgreSQL has partial full-text search support']); +INSERT INTO memos + VALUES ('Groonga', ARRAY['Groonga is an OSS full-text search engine', + 'Groonga has full full-text search support']); +INSERT INTO memos + VALUES ('PGroonga', + ARRAY['PGroonga is an OSS PostgreSQL extension', + 'PGroonga adds full full-text search support based on Groonga to PostgreSQL']); + +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (contents); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +SELECT title, contents + FROM memos + WHERE contents %% 'Groonga'; + +DROP TABLE memos; Added: sql/full-text-search/text-array/single/match/indexscan.sql (+28 -0) 100644 =================================================================== --- /dev/null +++ sql/full-text-search/text-array/single/match/indexscan.sql 2017-05-02 09:17:05 +0900 (942818c) @@ -0,0 +1,28 @@ +CREATE TABLE memos ( + title text, + contents text[] +); + +INSERT INTO memos + VALUES ('PostgreSQL', + ARRAY['PostgreSQL is an OSS RDBMS', + 'PostgreSQL has partial full-text search support']); +INSERT INTO memos + VALUES ('Groonga', ARRAY['Groonga is an OSS full-text search engine', + 'Groonga has full full-text search support']); +INSERT INTO memos + VALUES ('PGroonga', + ARRAY['PGroonga is an OSS PostgreSQL extension', + 'PGroonga adds full full-text search support based on Groonga to PostgreSQL']); + +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (contents); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +SELECT title, contents + FROM memos + WHERE contents %% 'Groonga'; + +DROP TABLE memos; Added: sql/full-text-search/text-array/single/match/seqscan.sql (+28 -0) 100644 =================================================================== --- /dev/null +++ sql/full-text-search/text-array/single/match/seqscan.sql 2017-05-02 09:17:05 +0900 (5c6e656) @@ -0,0 +1,28 @@ +CREATE TABLE memos ( + title text, + contents text[] +); + +INSERT INTO memos + VALUES ('PostgreSQL', + ARRAY['PostgreSQL is an OSS RDBMS', + 'PostgreSQL has partial full-text search support']); +INSERT INTO memos + VALUES ('Groonga', ARRAY['Groonga is an OSS full-text search engine', + 'Groonga has full full-text search support']); +INSERT INTO memos + VALUES ('PGroonga', + ARRAY['PGroonga is an OSS PostgreSQL extension', + 'PGroonga adds full full-text search support based on Groonga to PostgreSQL']); + +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (contents); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT title, contents + FROM memos + WHERE contents %% 'Groonga'; + +DROP TABLE memos; Added: sql/full-text-search/text-array/single/query/bitmapscan.sql (+28 -0) 100644 =================================================================== --- /dev/null +++ sql/full-text-search/text-array/single/query/bitmapscan.sql 2017-05-02 09:17:05 +0900 (864d135) @@ -0,0 +1,28 @@ +CREATE TABLE memos ( + title text, + contents text[] +); + +INSERT INTO memos + VALUES ('PostgreSQL', + ARRAY['PostgreSQL is an OSS RDBMS', + 'PostgreSQL has partial full-text search support']); +INSERT INTO memos + VALUES ('Groonga', ARRAY['Groonga is an OSS full-text search engine', + 'Groonga has full full-text search support']); +INSERT INTO memos + VALUES ('PGroonga', + ARRAY['PGroonga is an OSS PostgreSQL extension', + 'PGroonga adds full full-text search support based on Groonga to PostgreSQL']); + +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (contents); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +SELECT title, contents + FROM memos + WHERE contents @@ 'rdbms OR engine'; + +DROP TABLE memos; Added: sql/full-text-search/text-array/single/query/indexscan.sql (+28 -0) 100644 =================================================================== --- /dev/null +++ sql/full-text-search/text-array/single/query/indexscan.sql 2017-05-02 09:17:05 +0900 (2fcbd11) @@ -0,0 +1,28 @@ +CREATE TABLE memos ( + title text, + contents text[] +); + +INSERT INTO memos + VALUES ('PostgreSQL', + ARRAY['PostgreSQL is an OSS RDBMS', + 'PostgreSQL has partial full-text search support']); +INSERT INTO memos + VALUES ('Groonga', ARRAY['Groonga is an OSS full-text search engine', + 'Groonga has full full-text search support']); +INSERT INTO memos + VALUES ('PGroonga', + ARRAY['PGroonga is an OSS PostgreSQL extension', + 'PGroonga adds full full-text search support based on Groonga to PostgreSQL']); + +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (contents); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +SELECT title, contents + FROM memos + WHERE contents @@ 'rdbms OR engine'; + +DROP TABLE memos; Added: sql/full-text-search/text-array/single/query/seqscan.sql (+28 -0) 100644 =================================================================== --- /dev/null +++ sql/full-text-search/text-array/single/query/seqscan.sql 2017-05-02 09:17:05 +0900 (bbc0ab6) @@ -0,0 +1,28 @@ +CREATE TABLE memos ( + title text, + contents text[] +); + +INSERT INTO memos + VALUES ('PostgreSQL', + ARRAY['PostgreSQL is an OSS RDBMS', + 'PostgreSQL has partial full-text search support']); +INSERT INTO memos + VALUES ('Groonga', ARRAY['Groonga is an OSS full-text search engine', + 'Groonga has full full-text search support']); +INSERT INTO memos + VALUES ('PGroonga', + ARRAY['PGroonga is an OSS PostgreSQL extension', + 'PGroonga adds full full-text search support based on Groonga to PostgreSQL']); + +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (contents); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT title, contents + FROM memos + WHERE contents @@ 'rdbms OR engine'; + +DROP TABLE memos; Added: sql/full-text-search/varchar-array/single/match/bitmapscan.sql (+20 -0) 100644 =================================================================== --- /dev/null +++ sql/full-text-search/varchar-array/single/match/bitmapscan.sql 2017-05-02 09:17:05 +0900 (d4568f1) @@ -0,0 +1,20 @@ +CREATE TABLE memos ( + title text, + tags varchar(1023)[] +); + +INSERT INTO memos VALUES ('PostgreSQL', ARRAY['PostgreSQL']); +INSERT INTO memos VALUES ('Groonga', ARRAY['Groonga']); +INSERT INTO memos VALUES ('PGroonga', ARRAY['PostgreSQL', 'Groonga']); + +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (tags); + +SET enable_seqscan = off; +SET enable_indexscan = off; +SET enable_bitmapscan = on; + +SELECT title, tags + FROM memos + WHERE tags %% 'Groonga'; + +DROP TABLE memos; Added: sql/full-text-search/varchar-array/single/match/indexscan.sql (+20 -0) 100644 =================================================================== --- /dev/null +++ sql/full-text-search/varchar-array/single/match/indexscan.sql 2017-05-02 09:17:05 +0900 (8805b2a) @@ -0,0 +1,20 @@ +CREATE TABLE memos ( + title text, + tags varchar(1023)[] +); + +INSERT INTO memos VALUES ('PostgreSQL', ARRAY['PostgreSQL']); +INSERT INTO memos VALUES ('Groonga', ARRAY['Groonga']); +INSERT INTO memos VALUES ('PGroonga', ARRAY['PostgreSQL', 'Groonga']); + +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (tags); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +SELECT title, tags + FROM memos + WHERE tags %% 'Groonga'; + +DROP TABLE memos; Added: sql/full-text-search/varchar-array/single/match/seqscan.sql (+20 -0) 100644 =================================================================== --- /dev/null +++ sql/full-text-search/varchar-array/single/match/seqscan.sql 2017-05-02 09:17:05 +0900 (0fb15dc) @@ -0,0 +1,20 @@ +CREATE TABLE memos ( + title text, + tags varchar(1023)[] +); + +INSERT INTO memos VALUES ('PostgreSQL', ARRAY['PostgreSQL']); +INSERT INTO memos VALUES ('Groonga', ARRAY['Groonga']); +INSERT INTO memos VALUES ('PGroonga', ARRAY['PostgreSQL', 'Groonga']); + +CREATE INDEX pgroonga_memos_index ON memos USING pgroonga (tags); + +SET enable_seqscan = on; +SET enable_indexscan = off; +SET enable_bitmapscan = off; + +SELECT title, tags + FROM memos + WHERE tags %% 'Groonga'; + +DROP TABLE memos; -------------- next part -------------- HTML����������������������������...ダウンロード