[Groonga-commit] pgroonga/pgroonga at 1328854 [master] Improve performance for operator against empty text[] value

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jun 19 11:45:23 JST 2017


Kouhei Sutou	2017-06-19 11:45:23 +0900 (Mon, 19 Jun 2017)

  New Revision: 132885476055e78958340f34a2d6c54c584f45bf
  https://github.com/pgroonga/pgroonga/commit/132885476055e78958340f34a2d6c54c584f45bf

  Message:
    Improve performance for operator against empty text[] value

  Modified files:
    expected/full-text-search/text-array/single/match-v2/bitmapscan.out
    expected/full-text-search/text-array/single/match-v2/indexscan.out
    expected/full-text-search/text-array/single/match-v2/seqscan.out
    sql/full-text-search/text-array/single/match-v2/bitmapscan.sql
    sql/full-text-search/text-array/single/match-v2/indexscan.sql
    sql/full-text-search/text-array/single/match-v2/seqscan.sql
    src/pgroonga.c

  Modified: expected/full-text-search/text-array/single/match-v2/bitmapscan.out (+3 -0)
===================================================================
--- expected/full-text-search/text-array/single/match-v2/bitmapscan.out    2017-06-19 11:40:54 +0900 (61d7628)
+++ expected/full-text-search/text-array/single/match-v2/bitmapscan.out    2017-06-19 11:45:23 +0900 (af8dd7e)
@@ -13,6 +13,9 @@ INSERT INTO memos
     VALUES ('PGroonga',
             ARRAY['PGroonga is an OSS PostgreSQL extension',
                   'PGroonga adds full full-text search support based on Groonga to PostgreSQL']);
+INSERT INTO memos
+    VALUES ('empty',
+            ARRAY[]::text[]);
 CREATE INDEX pgroonga_memos_index ON memos
   USING pgroonga (contents pgroonga.text_array_full_text_search_ops_v2);
 SET enable_seqscan = off;

  Modified: expected/full-text-search/text-array/single/match-v2/indexscan.out (+3 -0)
===================================================================
--- expected/full-text-search/text-array/single/match-v2/indexscan.out    2017-06-19 11:40:54 +0900 (a5323c9)
+++ expected/full-text-search/text-array/single/match-v2/indexscan.out    2017-06-19 11:45:23 +0900 (79f1bbe)
@@ -13,6 +13,9 @@ INSERT INTO memos
     VALUES ('PGroonga',
             ARRAY['PGroonga is an OSS PostgreSQL extension',
                   'PGroonga adds full full-text search support based on Groonga to PostgreSQL']);
+INSERT INTO memos
+    VALUES ('empty',
+            ARRAY[]::text[]);
 CREATE INDEX pgroonga_memos_index ON memos
   USING pgroonga (contents pgroonga.text_array_full_text_search_ops_v2);
 SET enable_seqscan = off;

  Modified: expected/full-text-search/text-array/single/match-v2/seqscan.out (+3 -0)
===================================================================
--- expected/full-text-search/text-array/single/match-v2/seqscan.out    2017-06-19 11:40:54 +0900 (646f718)
+++ expected/full-text-search/text-array/single/match-v2/seqscan.out    2017-06-19 11:45:23 +0900 (6b4fd29)
@@ -13,6 +13,9 @@ INSERT INTO memos
     VALUES ('PGroonga',
             ARRAY['PGroonga is an OSS PostgreSQL extension',
                   'PGroonga adds full full-text search support based on Groonga to PostgreSQL']);
+INSERT INTO memos
+    VALUES ('empty',
+            ARRAY[]::text[]);
 CREATE INDEX pgroonga_memos_index ON memos
   USING pgroonga (contents pgroonga.text_array_full_text_search_ops_v2);
 SET enable_seqscan = on;

  Modified: sql/full-text-search/text-array/single/match-v2/bitmapscan.sql (+3 -0)
===================================================================
--- sql/full-text-search/text-array/single/match-v2/bitmapscan.sql    2017-06-19 11:40:54 +0900 (a52e35d)
+++ sql/full-text-search/text-array/single/match-v2/bitmapscan.sql    2017-06-19 11:45:23 +0900 (2fa0f00)
@@ -14,6 +14,9 @@ INSERT INTO memos
     VALUES ('PGroonga',
             ARRAY['PGroonga is an OSS PostgreSQL extension',
                   'PGroonga adds full full-text search support based on Groonga to PostgreSQL']);
+INSERT INTO memos
+    VALUES ('empty',
+            ARRAY[]::text[]);
 
 CREATE INDEX pgroonga_memos_index ON memos
   USING pgroonga (contents pgroonga.text_array_full_text_search_ops_v2);

  Modified: sql/full-text-search/text-array/single/match-v2/indexscan.sql (+3 -0)
===================================================================
--- sql/full-text-search/text-array/single/match-v2/indexscan.sql    2017-06-19 11:40:54 +0900 (31aee4c)
+++ sql/full-text-search/text-array/single/match-v2/indexscan.sql    2017-06-19 11:45:23 +0900 (383c168)
@@ -14,6 +14,9 @@ INSERT INTO memos
     VALUES ('PGroonga',
             ARRAY['PGroonga is an OSS PostgreSQL extension',
                   'PGroonga adds full full-text search support based on Groonga to PostgreSQL']);
+INSERT INTO memos
+    VALUES ('empty',
+            ARRAY[]::text[]);
 
 CREATE INDEX pgroonga_memos_index ON memos
   USING pgroonga (contents pgroonga.text_array_full_text_search_ops_v2);

  Modified: sql/full-text-search/text-array/single/match-v2/seqscan.sql (+3 -0)
===================================================================
--- sql/full-text-search/text-array/single/match-v2/seqscan.sql    2017-06-19 11:40:54 +0900 (64dddb5)
+++ sql/full-text-search/text-array/single/match-v2/seqscan.sql    2017-06-19 11:45:23 +0900 (366c3f9)
@@ -14,6 +14,9 @@ INSERT INTO memos
     VALUES ('PGroonga',
             ARRAY['PGroonga is an OSS PostgreSQL extension',
                   'PGroonga adds full full-text search support based on Groonga to PostgreSQL']);
+INSERT INTO memos
+    VALUES ('empty',
+            ARRAY[]::text[]);
 
 CREATE INDEX pgroonga_memos_index ON memos
   USING pgroonga (contents pgroonga.text_array_full_text_search_ops_v2);

  Modified: src/pgroonga.c (+3 -0)
===================================================================
--- src/pgroonga.c    2017-06-19 11:40:54 +0900 (fa20b78)
+++ src/pgroonga.c    2017-06-19 11:45:23 +0900 (64c4807)
@@ -1459,6 +1459,9 @@ pgroonga_execute_binary_operator_string_array(ArrayType *operands1,
 {
 	int i, n;
 
+	if (ARR_NDIM(operands1) == 0)
+		return false;
+
 	n = ARR_DIMS(operands1)[0];
 	for (i = 1; i <= n; i++)
 	{
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index