[Groonga-commit] pgroonga/pgroonga at ddb0224 [master] jsonb test: ensure confirming index is used

Back to archive index

Kouhei Sutou null+****@clear*****
Mon May 8 18:47:03 JST 2017


Kouhei Sutou	2017-05-08 18:47:03 +0900 (Mon, 08 May 2017)

  New Revision: ddb0224ae9b0ff775c447ec78621d512ef47028c
  https://github.com/pgroonga/pgroonga/commit/ddb0224ae9b0ff775c447ec78621d512ef47028c

  Message:
    jsonb test: ensure confirming index is used

  Modified files:
    expected/jsonb/contain-v2/array/empty.out
    expected/jsonb/contain-v2/array/multiple-elements.out
    expected/jsonb/contain-v2/object/empty.out
    expected/jsonb/script-v2/element/boolean/bitmapscan.out
    expected/jsonb/script-v2/element/boolean/indexscan.out
    expected/jsonb/script-v2/element/number/bitmapscan.out
    expected/jsonb/script-v2/element/number/indexscan.out
    expected/jsonb/script-v2/element/string/bitmapscan.out
    expected/jsonb/script-v2/element/string/indexscan.out
    expected/jsonb/script-v2/full-text-search/default.out
    expected/jsonb/script-v2/full-text-search/disable.out
    expected/jsonb/script-v2/object/bitmapscan.out
    expected/jsonb/script-v2/object/indexscan.out
    expected/jsonb/script-v2/value/boolean/bitmapscan.out
    expected/jsonb/script-v2/value/boolean/indexscan.out
    expected/jsonb/script-v2/value/number/bitmapscan.out
    expected/jsonb/script-v2/value/number/indexscan.out
    expected/jsonb/script-v2/value/string/bitmapscan.out
    expected/jsonb/script-v2/value/string/indexscan.out
    sql/jsonb/contain-v2/array/empty.sql
    sql/jsonb/contain-v2/array/multiple-elements.sql
    sql/jsonb/contain-v2/object/empty.sql
    sql/jsonb/script-v2/element/boolean/bitmapscan.sql
    sql/jsonb/script-v2/element/boolean/indexscan.sql
    sql/jsonb/script-v2/element/number/bitmapscan.sql
    sql/jsonb/script-v2/element/number/indexscan.sql
    sql/jsonb/script-v2/element/string/bitmapscan.sql
    sql/jsonb/script-v2/element/string/indexscan.sql
    sql/jsonb/script-v2/full-text-search/default.sql
    sql/jsonb/script-v2/full-text-search/disable.sql
    sql/jsonb/script-v2/object/bitmapscan.sql
    sql/jsonb/script-v2/object/indexscan.sql
    sql/jsonb/script-v2/value/boolean/bitmapscan.sql
    sql/jsonb/script-v2/value/boolean/indexscan.sql
    sql/jsonb/script-v2/value/number/bitmapscan.sql
    sql/jsonb/script-v2/value/number/indexscan.sql
    sql/jsonb/script-v2/value/string/bitmapscan.sql
    sql/jsonb/script-v2/value/string/indexscan.sql

  Modified: expected/jsonb/contain-v2/array/empty.out (+13 -0)
===================================================================
--- expected/jsonb/contain-v2/array/empty.out    2017-05-08 18:32:48 +0900 (c8e9ff0)
+++ expected/jsonb/contain-v2/array/empty.out    2017-05-08 18:47:03 +0900 (c735a75)
@@ -13,6 +13,19 @@ CREATE INDEX pgroonga_index ON logs
 SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
+EXPLAIN (COSTS OFF)
+SELECT id, record
+  FROM logs
+ WHERE record @> '[]'::jsonb
+ ORDER BY id;
+                  QUERY PLAN                   
+-----------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Index Scan using pgroonga_index on logs
+         Index Cond: (record @> '[]'::jsonb)
+(4 rows)
+
 SELECT id, record
   FROM logs
  WHERE record @> '[]'::jsonb

  Modified: expected/jsonb/contain-v2/array/multiple-elements.out (+13 -0)
===================================================================
--- expected/jsonb/contain-v2/array/multiple-elements.out    2017-05-08 18:32:48 +0900 (06ad8dc)
+++ expected/jsonb/contain-v2/array/multiple-elements.out    2017-05-08 18:47:03 +0900 (01d4df4)
@@ -13,6 +13,19 @@ CREATE INDEX pgroonga_index ON logs
 SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
+EXPLAIN (COSTS OFF)
+SELECT id, record
+  FROM logs
+ WHERE record @> '{"body": {"values": ["Hello", true, 100]}}'::jsonb
+ ORDER BY id;
+                                     QUERY PLAN                                      
+-------------------------------------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Index Scan using pgroonga_index on logs
+         Index Cond: (record @> '{"body": {"values": ["Hello", true, 100]}}'::jsonb)
+(4 rows)
+
 SELECT id, record
   FROM logs
  WHERE record @> '{"body": {"values": ["Hello", true, 100]}}'::jsonb

  Modified: expected/jsonb/contain-v2/object/empty.out (+13 -0)
===================================================================
--- expected/jsonb/contain-v2/object/empty.out    2017-05-08 18:32:48 +0900 (afc58f5)
+++ expected/jsonb/contain-v2/object/empty.out    2017-05-08 18:47:03 +0900 (fdd5e4f)
@@ -13,6 +13,19 @@ CREATE INDEX pgroonga_index ON logs
 SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
+EXPLAIN (COSTS OFF)
+SELECT id, record
+  FROM logs
+ WHERE record @> '{}'::jsonb
+ ORDER BY id;
+                  QUERY PLAN                   
+-----------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Index Scan using pgroonga_index on logs
+         Index Cond: (record @> '{}'::jsonb)
+(4 rows)
+
 SELECT id, record
   FROM logs
  WHERE record @> '{}'::jsonb

  Modified: expected/jsonb/script-v2/element/boolean/bitmapscan.out (+15 -0)
===================================================================
--- expected/jsonb/script-v2/element/boolean/bitmapscan.out    2017-05-08 18:32:48 +0900 (4fb3834)
+++ expected/jsonb/script-v2/element/boolean/bitmapscan.out    2017-05-08 18:47:03 +0900 (e53a592)
@@ -10,6 +10,21 @@ CREATE INDEX pgroonga_index ON fruits
 SET enable_seqscan = off;
 SET enable_indexscan = off;
 SET enable_bitmapscan = on;
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'boolean == true'
+ ORDER BY id;
+                          QUERY PLAN                          
+--------------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Bitmap Heap Scan on fruits
+         Recheck Cond: (items &` 'boolean == true'::text)
+         ->  Bitmap Index Scan on pgroonga_index
+               Index Cond: (items &` 'boolean == true'::text)
+(6 rows)
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'boolean == true'

  Modified: expected/jsonb/script-v2/element/boolean/indexscan.out (+13 -0)
===================================================================
--- expected/jsonb/script-v2/element/boolean/indexscan.out    2017-05-08 18:32:48 +0900 (c3acc78)
+++ expected/jsonb/script-v2/element/boolean/indexscan.out    2017-05-08 18:47:03 +0900 (9d19984)
@@ -10,6 +10,19 @@ CREATE INDEX pgroonga_index ON fruits
 SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'boolean == true'
+ ORDER BY id;
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Index Scan using pgroonga_index on fruits
+         Index Cond: (items &` 'boolean == true'::text)
+(4 rows)
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'boolean == true'

  Modified: expected/jsonb/script-v2/element/number/bitmapscan.out (+15 -0)
===================================================================
--- expected/jsonb/script-v2/element/number/bitmapscan.out    2017-05-08 18:32:48 +0900 (af3ddbf)
+++ expected/jsonb/script-v2/element/number/bitmapscan.out    2017-05-08 18:47:03 +0900 (cd9681e)
@@ -10,6 +10,21 @@ CREATE INDEX pgroonga_index ON fruits
 SET enable_seqscan = off;
 SET enable_indexscan = off;
 SET enable_bitmapscan = on;
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'type == "number" && number <= 100'
+ ORDER BY id;
+                                   QUERY PLAN                                   
+--------------------------------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Bitmap Heap Scan on fruits
+         Recheck Cond: (items &` 'type == "number" && number <= 100'::text)
+         ->  Bitmap Index Scan on pgroonga_index
+               Index Cond: (items &` 'type == "number" && number <= 100'::text)
+(6 rows)
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'type == "number" && number <= 100'

  Modified: expected/jsonb/script-v2/element/number/indexscan.out (+13 -0)
===================================================================
--- expected/jsonb/script-v2/element/number/indexscan.out    2017-05-08 18:32:48 +0900 (0c20f37)
+++ expected/jsonb/script-v2/element/number/indexscan.out    2017-05-08 18:47:03 +0900 (b47fd0b)
@@ -10,6 +10,19 @@ CREATE INDEX pgroonga_index ON fruits
 SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'type == "number" && number <= 100'
+ ORDER BY id;
+                                QUERY PLAN                                
+--------------------------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Index Scan using pgroonga_index on fruits
+         Index Cond: (items &` 'type == "number" && number <= 100'::text)
+(4 rows)
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'type == "number" && number <= 100'

  Modified: expected/jsonb/script-v2/element/string/bitmapscan.out (+15 -0)
===================================================================
--- expected/jsonb/script-v2/element/string/bitmapscan.out    2017-05-08 18:32:48 +0900 (e7e072e)
+++ expected/jsonb/script-v2/element/string/bitmapscan.out    2017-05-08 18:47:03 +0900 (8a14e82)
@@ -10,6 +10,21 @@ CREATE INDEX pgroonga_index ON fruits
 SET enable_seqscan = off;
 SET enable_indexscan = off;
 SET enable_bitmapscan = on;
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'string == "apple"'
+ ORDER BY id;
+                           QUERY PLAN                           
+----------------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Bitmap Heap Scan on fruits
+         Recheck Cond: (items &` 'string == "apple"'::text)
+         ->  Bitmap Index Scan on pgroonga_index
+               Index Cond: (items &` 'string == "apple"'::text)
+(6 rows)
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'string == "apple"'

  Modified: expected/jsonb/script-v2/element/string/indexscan.out (+13 -0)
===================================================================
--- expected/jsonb/script-v2/element/string/indexscan.out    2017-05-08 18:32:48 +0900 (d48852b)
+++ expected/jsonb/script-v2/element/string/indexscan.out    2017-05-08 18:47:03 +0900 (ccfd4dd)
@@ -10,6 +10,19 @@ CREATE INDEX pgroonga_index ON fruits
 SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'string == "apple"'
+ ORDER BY id;
+                        QUERY PLAN                        
+----------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Index Scan using pgroonga_index on fruits
+         Index Cond: (items &` 'string == "apple"'::text)
+(4 rows)
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'string == "apple"'

  Modified: expected/jsonb/script-v2/full-text-search/default.out (+13 -0)
===================================================================
--- expected/jsonb/script-v2/full-text-search/default.out    2017-05-08 18:32:48 +0900 (e01ecc2)
+++ expected/jsonb/script-v2/full-text-search/default.out    2017-05-08 18:47:03 +0900 (00874ae)
@@ -10,6 +10,19 @@ CREATE INDEX pgroonga_index ON logs
 SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
+EXPLAIN (COSTS OFF)
+SELECT id, record
+  FROM logs
+ WHERE record &` 'string @ "world"'
+ ORDER BY id;
+                        QUERY PLAN                        
+----------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Index Scan using pgroonga_index on logs
+         Index Cond: (record &` 'string @ "world"'::text)
+(4 rows)
+
 SELECT id, record
   FROM logs
  WHERE record &` 'string @ "world"'

  Modified: expected/jsonb/script-v2/full-text-search/disable.out (+26 -0)
===================================================================
--- expected/jsonb/script-v2/full-text-search/disable.out    2017-05-08 18:32:48 +0900 (235a9e0)
+++ expected/jsonb/script-v2/full-text-search/disable.out    2017-05-08 18:47:03 +0900 (4362b07)
@@ -11,6 +11,19 @@ CREATE INDEX pgroonga_index ON logs
 SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
+EXPLAIN (COSTS OFF)
+SELECT id, record
+  FROM logs
+ WHERE record &` 'string @ "world"'
+ ORDER BY id;
+                        QUERY PLAN                        
+----------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Index Scan using pgroonga_index on logs
+         Index Cond: (record &` 'string @ "world"'::text)
+(4 rows)
+
 SELECT id, record
   FROM logs
  WHERE record &` 'string @ "world"'
@@ -19,6 +32,19 @@ SELECT id, record
 ----+--------
 (0 rows)
 
+EXPLAIN (COSTS OFF)
+SELECT id, record
+  FROM logs
+ WHERE record &` 'string == "Hello World"'
+ ORDER BY id;
+                           QUERY PLAN                            
+-----------------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Index Scan using pgroonga_index on logs
+         Index Cond: (record &` 'string == "Hello World"'::text)
+(4 rows)
+
 SELECT id, record
   FROM logs
  WHERE record &` 'string == "Hello World"'

  Modified: expected/jsonb/script-v2/object/bitmapscan.out (+15 -0)
===================================================================
--- expected/jsonb/script-v2/object/bitmapscan.out    2017-05-08 18:32:48 +0900 (fda8d21)
+++ expected/jsonb/script-v2/object/bitmapscan.out    2017-05-08 18:47:03 +0900 (cee9dea)
@@ -10,6 +10,21 @@ CREATE INDEX pgroonga_index ON logs
 SET enable_seqscan = off;
 SET enable_indexscan = off;
 SET enable_bitmapscan = on;
+EXPLAIN (COSTS OFF)
+SELECT id, record
+  FROM logs
+ WHERE record &` 'paths @ ".message" && type == "object"'
+ ORDER BY id;
+                                      QUERY PLAN                                      
+--------------------------------------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Bitmap Heap Scan on logs
+         Recheck Cond: (record &` 'paths @ ".message" && type == "object"'::text)
+         ->  Bitmap Index Scan on pgroonga_index
+               Index Cond: (record &` 'paths @ ".message" && type == "object"'::text)
+(6 rows)
+
 SELECT id, record
   FROM logs
  WHERE record &` 'paths @ ".message" && type == "object"'

  Modified: expected/jsonb/script-v2/object/indexscan.out (+13 -0)
===================================================================
--- expected/jsonb/script-v2/object/indexscan.out    2017-05-08 18:32:48 +0900 (56baf14)
+++ expected/jsonb/script-v2/object/indexscan.out    2017-05-08 18:47:03 +0900 (1a27661)
@@ -10,6 +10,19 @@ CREATE INDEX pgroonga_index ON logs
 SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
+EXPLAIN (COSTS OFF)
+SELECT id, record
+  FROM logs
+ WHERE record &` 'paths @ ".message" && type == "object"'
+ ORDER BY id;
+                                   QUERY PLAN                                   
+--------------------------------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Index Scan using pgroonga_index on logs
+         Index Cond: (record &` 'paths @ ".message" && type == "object"'::text)
+(4 rows)
+
 SELECT id, record
   FROM logs
  WHERE record &` 'paths @ ".message" && type == "object"'

  Modified: expected/jsonb/script-v2/value/boolean/bitmapscan.out (+15 -0)
===================================================================
--- expected/jsonb/script-v2/value/boolean/bitmapscan.out    2017-05-08 18:32:48 +0900 (87961fb)
+++ expected/jsonb/script-v2/value/boolean/bitmapscan.out    2017-05-08 18:47:03 +0900 (55e024b)
@@ -10,6 +10,21 @@ CREATE INDEX pgroonga_index ON fruits
 SET enable_seqscan = off;
 SET enable_indexscan = off;
 SET enable_bitmapscan = on;
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'boolean == true'
+ ORDER BY id;
+                          QUERY PLAN                          
+--------------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Bitmap Heap Scan on fruits
+         Recheck Cond: (items &` 'boolean == true'::text)
+         ->  Bitmap Index Scan on pgroonga_index
+               Index Cond: (items &` 'boolean == true'::text)
+(6 rows)
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'boolean == true'

  Modified: expected/jsonb/script-v2/value/boolean/indexscan.out (+13 -0)
===================================================================
--- expected/jsonb/script-v2/value/boolean/indexscan.out    2017-05-08 18:32:48 +0900 (eb79d30)
+++ expected/jsonb/script-v2/value/boolean/indexscan.out    2017-05-08 18:47:03 +0900 (21b7528)
@@ -10,6 +10,19 @@ CREATE INDEX pgroonga_index ON fruits
 SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'boolean == true'
+ ORDER BY id;
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Index Scan using pgroonga_index on fruits
+         Index Cond: (items &` 'boolean == true'::text)
+(4 rows)
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'boolean == true'

  Modified: expected/jsonb/script-v2/value/number/bitmapscan.out (+15 -0)
===================================================================
--- expected/jsonb/script-v2/value/number/bitmapscan.out    2017-05-08 18:32:48 +0900 (6ea4d43)
+++ expected/jsonb/script-v2/value/number/bitmapscan.out    2017-05-08 18:47:03 +0900 (6cbda5f)
@@ -10,6 +10,21 @@ CREATE INDEX pgroonga_index ON fruits
 SET enable_seqscan = off;
 SET enable_indexscan = off;
 SET enable_bitmapscan = on;
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'type == "number" && number <= 100'
+ ORDER BY id;
+                                   QUERY PLAN                                   
+--------------------------------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Bitmap Heap Scan on fruits
+         Recheck Cond: (items &` 'type == "number" && number <= 100'::text)
+         ->  Bitmap Index Scan on pgroonga_index
+               Index Cond: (items &` 'type == "number" && number <= 100'::text)
+(6 rows)
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'type == "number" && number <= 100'

  Modified: expected/jsonb/script-v2/value/number/indexscan.out (+13 -0)
===================================================================
--- expected/jsonb/script-v2/value/number/indexscan.out    2017-05-08 18:32:48 +0900 (93a0bac)
+++ expected/jsonb/script-v2/value/number/indexscan.out    2017-05-08 18:47:03 +0900 (f4aceb4)
@@ -10,6 +10,19 @@ CREATE INDEX pgroonga_index ON fruits
 SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'type == "number" && number <= 100'
+ ORDER BY id;
+                                QUERY PLAN                                
+--------------------------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Index Scan using pgroonga_index on fruits
+         Index Cond: (items &` 'type == "number" && number <= 100'::text)
+(4 rows)
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'type == "number" && number <= 100'

  Modified: expected/jsonb/script-v2/value/string/bitmapscan.out (+15 -0)
===================================================================
--- expected/jsonb/script-v2/value/string/bitmapscan.out    2017-05-08 18:32:48 +0900 (8323755)
+++ expected/jsonb/script-v2/value/string/bitmapscan.out    2017-05-08 18:47:03 +0900 (4e172af)
@@ -10,6 +10,21 @@ CREATE INDEX pgroonga_index ON fruits
 SET enable_seqscan = off;
 SET enable_indexscan = off;
 SET enable_bitmapscan = on;
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'string == "apple"'
+ ORDER BY id;
+                           QUERY PLAN                           
+----------------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Bitmap Heap Scan on fruits
+         Recheck Cond: (items &` 'string == "apple"'::text)
+         ->  Bitmap Index Scan on pgroonga_index
+               Index Cond: (items &` 'string == "apple"'::text)
+(6 rows)
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'string == "apple"'

  Modified: expected/jsonb/script-v2/value/string/indexscan.out (+13 -0)
===================================================================
--- expected/jsonb/script-v2/value/string/indexscan.out    2017-05-08 18:32:48 +0900 (8cdab2f)
+++ expected/jsonb/script-v2/value/string/indexscan.out    2017-05-08 18:47:03 +0900 (a9cf39f)
@@ -10,6 +10,19 @@ CREATE INDEX pgroonga_index ON fruits
 SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'string == "apple"'
+ ORDER BY id;
+                        QUERY PLAN                        
+----------------------------------------------------------
+ Sort
+   Sort Key: id
+   ->  Index Scan using pgroonga_index on fruits
+         Index Cond: (items &` 'string == "apple"'::text)
+(4 rows)
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'string == "apple"'

  Modified: sql/jsonb/contain-v2/array/empty.sql (+6 -0)
===================================================================
--- sql/jsonb/contain-v2/array/empty.sql    2017-05-08 18:32:48 +0900 (7cc7b16)
+++ sql/jsonb/contain-v2/array/empty.sql    2017-05-08 18:47:03 +0900 (3f3d9f1)
@@ -17,6 +17,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
 
+EXPLAIN (COSTS OFF)
+SELECT id, record
+  FROM logs
+ WHERE record @> '[]'::jsonb
+ ORDER BY id;
+
 SELECT id, record
   FROM logs
  WHERE record @> '[]'::jsonb

  Modified: sql/jsonb/contain-v2/array/multiple-elements.sql (+6 -0)
===================================================================
--- sql/jsonb/contain-v2/array/multiple-elements.sql    2017-05-08 18:32:48 +0900 (153b3b0)
+++ sql/jsonb/contain-v2/array/multiple-elements.sql    2017-05-08 18:47:03 +0900 (91dce40)
@@ -17,6 +17,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
 
+EXPLAIN (COSTS OFF)
+SELECT id, record
+  FROM logs
+ WHERE record @> '{"body": {"values": ["Hello", true, 100]}}'::jsonb
+ ORDER BY id;
+
 SELECT id, record
   FROM logs
  WHERE record @> '{"body": {"values": ["Hello", true, 100]}}'::jsonb

  Modified: sql/jsonb/contain-v2/object/empty.sql (+6 -0)
===================================================================
--- sql/jsonb/contain-v2/object/empty.sql    2017-05-08 18:32:48 +0900 (59fd4b5)
+++ sql/jsonb/contain-v2/object/empty.sql    2017-05-08 18:47:03 +0900 (fd629d0)
@@ -17,6 +17,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
 
+EXPLAIN (COSTS OFF)
+SELECT id, record
+  FROM logs
+ WHERE record @> '{}'::jsonb
+ ORDER BY id;
+
 SELECT id, record
   FROM logs
  WHERE record @> '{}'::jsonb

  Modified: sql/jsonb/script-v2/element/boolean/bitmapscan.sql (+6 -0)
===================================================================
--- sql/jsonb/script-v2/element/boolean/bitmapscan.sql    2017-05-08 18:32:48 +0900 (7757924)
+++ sql/jsonb/script-v2/element/boolean/bitmapscan.sql    2017-05-08 18:47:03 +0900 (e0b9d3f)
@@ -14,6 +14,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = off;
 SET enable_bitmapscan = on;
 
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'boolean == true'
+ ORDER BY id;
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'boolean == true'

  Modified: sql/jsonb/script-v2/element/boolean/indexscan.sql (+6 -0)
===================================================================
--- sql/jsonb/script-v2/element/boolean/indexscan.sql    2017-05-08 18:32:48 +0900 (8a0c344)
+++ sql/jsonb/script-v2/element/boolean/indexscan.sql    2017-05-08 18:47:03 +0900 (77ca73f)
@@ -14,6 +14,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
 
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'boolean == true'
+ ORDER BY id;
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'boolean == true'

  Modified: sql/jsonb/script-v2/element/number/bitmapscan.sql (+6 -0)
===================================================================
--- sql/jsonb/script-v2/element/number/bitmapscan.sql    2017-05-08 18:32:48 +0900 (aee3e15)
+++ sql/jsonb/script-v2/element/number/bitmapscan.sql    2017-05-08 18:47:03 +0900 (40bef13)
@@ -14,6 +14,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = off;
 SET enable_bitmapscan = on;
 
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'type == "number" && number <= 100'
+ ORDER BY id;
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'type == "number" && number <= 100'

  Modified: sql/jsonb/script-v2/element/number/indexscan.sql (+6 -0)
===================================================================
--- sql/jsonb/script-v2/element/number/indexscan.sql    2017-05-08 18:32:48 +0900 (0fd48bd)
+++ sql/jsonb/script-v2/element/number/indexscan.sql    2017-05-08 18:47:03 +0900 (4dca8df)
@@ -14,6 +14,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
 
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'type == "number" && number <= 100'
+ ORDER BY id;
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'type == "number" && number <= 100'

  Modified: sql/jsonb/script-v2/element/string/bitmapscan.sql (+6 -0)
===================================================================
--- sql/jsonb/script-v2/element/string/bitmapscan.sql    2017-05-08 18:32:48 +0900 (424ba95)
+++ sql/jsonb/script-v2/element/string/bitmapscan.sql    2017-05-08 18:47:03 +0900 (c99cfc9)
@@ -14,6 +14,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = off;
 SET enable_bitmapscan = on;
 
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'string == "apple"'
+ ORDER BY id;
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'string == "apple"'

  Modified: sql/jsonb/script-v2/element/string/indexscan.sql (+6 -0)
===================================================================
--- sql/jsonb/script-v2/element/string/indexscan.sql    2017-05-08 18:32:48 +0900 (63744d6)
+++ sql/jsonb/script-v2/element/string/indexscan.sql    2017-05-08 18:47:03 +0900 (ddfa1e8)
@@ -14,6 +14,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
 
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'string == "apple"'
+ ORDER BY id;
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'string == "apple"'

  Modified: sql/jsonb/script-v2/full-text-search/default.sql (+6 -0)
===================================================================
--- sql/jsonb/script-v2/full-text-search/default.sql    2017-05-08 18:32:48 +0900 (11e4fb3)
+++ sql/jsonb/script-v2/full-text-search/default.sql    2017-05-08 18:47:03 +0900 (90f030e)
@@ -14,6 +14,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
 
+EXPLAIN (COSTS OFF)
+SELECT id, record
+  FROM logs
+ WHERE record &` 'string @ "world"'
+ ORDER BY id;
+
 SELECT id, record
   FROM logs
  WHERE record &` 'string @ "world"'

  Modified: sql/jsonb/script-v2/full-text-search/disable.sql (+12 -0)
===================================================================
--- sql/jsonb/script-v2/full-text-search/disable.sql    2017-05-08 18:32:48 +0900 (7940178)
+++ sql/jsonb/script-v2/full-text-search/disable.sql    2017-05-08 18:47:03 +0900 (01e9b48)
@@ -15,6 +15,7 @@ SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
 
+EXPLAIN (COSTS OFF)
 SELECT id, record
   FROM logs
  WHERE record &` 'string @ "world"'
@@ -22,6 +23,17 @@ SELECT id, record
 
 SELECT id, record
   FROM logs
+ WHERE record &` 'string @ "world"'
+ ORDER BY id;
+
+EXPLAIN (COSTS OFF)
+SELECT id, record
+  FROM logs
+ WHERE record &` 'string == "Hello World"'
+ ORDER BY id;
+
+SELECT id, record
+  FROM logs
  WHERE record &` 'string == "Hello World"'
  ORDER BY id;
 

  Modified: sql/jsonb/script-v2/object/bitmapscan.sql (+6 -0)
===================================================================
--- sql/jsonb/script-v2/object/bitmapscan.sql    2017-05-08 18:32:48 +0900 (2f68847)
+++ sql/jsonb/script-v2/object/bitmapscan.sql    2017-05-08 18:47:03 +0900 (5e679c2)
@@ -14,6 +14,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = off;
 SET enable_bitmapscan = on;
 
+EXPLAIN (COSTS OFF)
+SELECT id, record
+  FROM logs
+ WHERE record &` 'paths @ ".message" && type == "object"'
+ ORDER BY id;
+
 SELECT id, record
   FROM logs
  WHERE record &` 'paths @ ".message" && type == "object"'

  Modified: sql/jsonb/script-v2/object/indexscan.sql (+6 -0)
===================================================================
--- sql/jsonb/script-v2/object/indexscan.sql    2017-05-08 18:32:48 +0900 (0eac1a7)
+++ sql/jsonb/script-v2/object/indexscan.sql    2017-05-08 18:47:03 +0900 (283bf6e)
@@ -14,6 +14,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
 
+EXPLAIN (COSTS OFF)
+SELECT id, record
+  FROM logs
+ WHERE record &` 'paths @ ".message" && type == "object"'
+ ORDER BY id;
+
 SELECT id, record
   FROM logs
  WHERE record &` 'paths @ ".message" && type == "object"'

  Modified: sql/jsonb/script-v2/value/boolean/bitmapscan.sql (+6 -0)
===================================================================
--- sql/jsonb/script-v2/value/boolean/bitmapscan.sql    2017-05-08 18:32:48 +0900 (7318c06)
+++ sql/jsonb/script-v2/value/boolean/bitmapscan.sql    2017-05-08 18:47:03 +0900 (f8e353a)
@@ -14,6 +14,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = off;
 SET enable_bitmapscan = on;
 
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'boolean == true'
+ ORDER BY id;
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'boolean == true'

  Modified: sql/jsonb/script-v2/value/boolean/indexscan.sql (+6 -0)
===================================================================
--- sql/jsonb/script-v2/value/boolean/indexscan.sql    2017-05-08 18:32:48 +0900 (ad3f211)
+++ sql/jsonb/script-v2/value/boolean/indexscan.sql    2017-05-08 18:47:03 +0900 (7d082f9)
@@ -14,6 +14,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
 
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'boolean == true'
+ ORDER BY id;
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'boolean == true'

  Modified: sql/jsonb/script-v2/value/number/bitmapscan.sql (+6 -0)
===================================================================
--- sql/jsonb/script-v2/value/number/bitmapscan.sql    2017-05-08 18:32:48 +0900 (0bf6a03)
+++ sql/jsonb/script-v2/value/number/bitmapscan.sql    2017-05-08 18:47:03 +0900 (2f356f0)
@@ -14,6 +14,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = off;
 SET enable_bitmapscan = on;
 
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'type == "number" && number <= 100'
+ ORDER BY id;
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'type == "number" && number <= 100'

  Modified: sql/jsonb/script-v2/value/number/indexscan.sql (+6 -0)
===================================================================
--- sql/jsonb/script-v2/value/number/indexscan.sql    2017-05-08 18:32:48 +0900 (8ea1634)
+++ sql/jsonb/script-v2/value/number/indexscan.sql    2017-05-08 18:47:03 +0900 (1f83765)
@@ -14,6 +14,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
 
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'type == "number" && number <= 100'
+ ORDER BY id;
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'type == "number" && number <= 100'

  Modified: sql/jsonb/script-v2/value/string/bitmapscan.sql (+6 -0)
===================================================================
--- sql/jsonb/script-v2/value/string/bitmapscan.sql    2017-05-08 18:32:48 +0900 (51bd11f)
+++ sql/jsonb/script-v2/value/string/bitmapscan.sql    2017-05-08 18:47:03 +0900 (bcce680)
@@ -14,6 +14,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = off;
 SET enable_bitmapscan = on;
 
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'string == "apple"'
+ ORDER BY id;
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'string == "apple"'

  Modified: sql/jsonb/script-v2/value/string/indexscan.sql (+6 -0)
===================================================================
--- sql/jsonb/script-v2/value/string/indexscan.sql    2017-05-08 18:32:48 +0900 (0b17b77)
+++ sql/jsonb/script-v2/value/string/indexscan.sql    2017-05-08 18:47:03 +0900 (f2dee98)
@@ -14,6 +14,12 @@ SET enable_seqscan = off;
 SET enable_indexscan = on;
 SET enable_bitmapscan = off;
 
+EXPLAIN (COSTS OFF)
+SELECT id, items
+  FROM fruits
+ WHERE items &` 'string == "apple"'
+ ORDER BY id;
+
 SELECT id, items
   FROM fruits
  WHERE items &` 'string == "apple"'
-------------- next part --------------
HTML����������������������������...
Descargar 



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