OSDN Git Service

インデックスの正規化とインデックスメッセージ出力の試験を追加した。
[pghintplan/pg_hint_plan.git] / expected / ut-S-9.1.out
index 99ea0ce..b95e77b 100644 (file)
@@ -4466,6 +4466,27 @@ DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
 (2 rows)
 
 -- No. S-3-5-7
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+          QUERY PLAN          
+------------------------------
+ Index Scan using t1_i1 on t1
+   Index Cond: (c1 = 1)
+(2 rows)
+
+/*+TidScan(t1)*/
+EXPLAIN (COSTS true) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+LOG:  pg_hint_plan:
+used hint:
+TidScan(t1)
+not used hint:
+duplication hint:
+error hint:
+
+                              QUERY PLAN                               
+-----------------------------------------------------------------------
+ Seq Scan on t1  (cost=10000000000.00..10000000018.50 rows=1 width=15)
+   Filter: (c1 = 1)
+(2 rows)
 
 ----
 ---- No. S-3-6 query structure
@@ -5012,38 +5033,69 @@ error hint:
 (8 rows)
 
 -- No. S-3-10-3
-/*+IndexScan(p2 p2_pkey p2c1_pkey p2c1c1_pkey)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
-LOG:  available indexes for IndexScan(p2): p2_pkey
-LOG:  available indexes for IndexScan(p2c1): p2c1_pkey
-LOG:  available indexes for IndexScan(p2c2):
-LOG:  available indexes for IndexScan(p2c3):
-LOG:  available indexes for IndexScan(p2c1c1): p2c1c1_pkey
-LOG:  available indexes for IndexScan(p2c1c2):
-LOG:  available indexes for IndexScan(p2c2c1):
-LOG:  available indexes for IndexScan(p2c2c2):
-LOG:  available indexes for IndexScan(p2c3c1):
-LOG:  available indexes for IndexScan(p2c3c2):
+EXPLAIN SELECT c4 FROM s1.p1 WHERE c2 * 2 < 100 AND c1 < 10;
+                            QUERY PLAN                             
+-------------------------------------------------------------------
+ Result  (cost=0.00..2.75 rows=4 width=10)
+   ->  Append  (cost=0.00..2.75 rows=4 width=10)
+         ->  Seq Scan on p1  (cost=0.00..0.00 rows=1 width=32)
+               Filter: ((c1 < 10) AND ((c2 * 2) < 100))
+         ->  Seq Scan on p1c1 p1  (cost=0.00..2.75 rows=3 width=2)
+               Filter: ((c1 < 10) AND ((c2 * 2) < 100))
+(6 rows)
+
+/*+IndexScan(p1 p1_parent)*/
+EXPLAIN SELECT c4 FROM s1.p1 WHERE c2 * 2 < 100 AND c1 < 10;
+LOG:  available indexes for IndexScan(p1): p1_parent
+LOG:  available indexes for IndexScan(p1c1): p1c1_c4_expr_idx
+LOG:  available indexes for IndexScan(p1c2): p1c2_c4_expr_idx
+LOG:  available indexes for IndexScan(p1c3): p1c3_c4_expr_idx
 LOG:  pg_hint_plan:
 used hint:
-IndexScan(p2 p2_pkey p2c1_pkey p2c1c1_pkey)
+IndexScan(p1 p1_parent)
 not used hint:
 duplication hint:
 error hint:
 
-                      QUERY PLAN                       
--------------------------------------------------------
- Result
-   ->  Append
-         ->  Index Scan using p2_pkey on p2
-               Index Cond: (c1 = 1)
-         ->  Index Scan using p2c1_pkey on p2c1 p2
-               Index Cond: (c1 = 1)
-         ->  Index Scan using p2c1c1_pkey on p2c1c1 p2
-               Index Cond: (c1 = 1)
-(8 rows)
+                                         QUERY PLAN                                          
+---------------------------------------------------------------------------------------------
+ Result  (cost=0.00..20.73 rows=4 width=10)
+   ->  Append  (cost=0.00..20.73 rows=4 width=10)
+         ->  Index Scan using p1_parent on p1  (cost=0.00..8.27 rows=1 width=32)
+               Filter: ((c2 * 2) < 100)
+         ->  Index Scan using p1c1_c4_expr_idx on p1c1 p1  (cost=0.00..12.45 rows=3 width=2)
+               Filter: ((c2 * 2) < 100)
+(6 rows)
 
 -- No. S-3-10-4
+/*+IndexScan(p1 p1_i2)*/
+EXPLAIN SELECT c2 FROM s1.p1 WHERE c2 = 1;
+LOG:  available indexes for IndexScan(p1): p1_i2
+LOG:  available indexes for IndexScan(p1c1):
+LOG:  available indexes for IndexScan(p1c2):
+LOG:  available indexes for IndexScan(p1c3):
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p1 p1_i2)
+not used hint:
+duplication hint:
+error hint:
+
+                                      QUERY PLAN                                       
+---------------------------------------------------------------------------------------
+ Result  (cost=0.00..30000000015.02 rows=4 width=4)
+   ->  Append  (cost=0.00..30000000015.02 rows=4 width=4)
+         ->  Index Scan using p1_i2 on p1  (cost=0.00..8.27 rows=1 width=4)
+               Index Cond: (c2 = 1)
+         ->  Seq Scan on p1c1 p1  (cost=10000000000.00..10000000002.25 rows=1 width=4)
+               Filter: (c2 = 1)
+         ->  Seq Scan on p1c2 p1  (cost=10000000000.00..10000000002.25 rows=1 width=4)
+               Filter: (c2 = 1)
+         ->  Seq Scan on p1c3 p1  (cost=10000000000.00..10000000002.25 rows=1 width=4)
+               Filter: (c2 = 1)
+(10 rows)
+
+-- No. S-3-10-5
 /*+IndexScan(p2 p2c1_pkey)*/
 EXPLAIN (COSTS true) SELECT * FROM s1.p2 WHERE c1 = 1;
 LOG:  available indexes for IndexScan(p2):
@@ -5075,8 +5127,6 @@ error hint:
                Filter: (c1 = 1)
 (8 rows)
 
--- No. S-3-10-5
-
 ----
 ---- No. S-3-11 specified same table
 ----
@@ -5686,3 +5736,224 @@ DETAIL:  Unrecognized hint keyword "NoIndexOnlyScan".
    Index Cond: (c1 = 1)
 (2 rows)
 
+----
+---- No. S-3-13 message output
+----
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
+           QUERY PLAN           
+--------------------------------
+ Index Scan using ti1_i2 on ti1
+   Index Cond: (c2 = 1)
+(2 rows)
+
+-- No. S-3-13-1
+/*+IndexScanRegexp(ti1 ti1_.*_key)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
+LOG:  available indexes for IndexScanRegexp(ti1): ti1_c2_key
+LOG:  pg_hint_plan:
+used hint:
+IndexScanRegexp(ti1 ti1_.*_key)
+not used hint:
+duplication hint:
+error hint:
+
+             QUERY PLAN             
+------------------------------------
+ Index Scan using ti1_c2_key on ti1
+   Index Cond: (c2 = 1)
+(2 rows)
+
+-- No. S-3-13-2
+/*+IndexScanRegexp(ti1 ti1_i.)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
+LOG:  available indexes for IndexScanRegexp(ti1): ti1_i4 ti1_i3 ti1_i2 ti1_i1
+LOG:  pg_hint_plan:
+used hint:
+IndexScanRegexp(ti1 ti1_i.)
+not used hint:
+duplication hint:
+error hint:
+
+           QUERY PLAN           
+--------------------------------
+ Index Scan using ti1_i2 on ti1
+   Index Cond: (c2 = 1)
+(2 rows)
+
+-- No. S-3-13-3
+/*+IndexScanRegexp(ti1 no.*_exist)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
+LOG:  available indexes for IndexScanRegexp(ti1):
+LOG:  pg_hint_plan:
+used hint:
+IndexScanRegexp(ti1 no.*_exist)
+not used hint:
+duplication hint:
+error hint:
+
+     QUERY PLAN     
+--------------------
+ Seq Scan on ti1
+   Filter: (c2 = 1)
+(2 rows)
+
+-- No. S-3-13-4
+/*+IndexScanRegexp(p1 .*pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
+LOG:  available indexes for IndexScanRegexp(p1): p1_pkey
+LOG:  available indexes for IndexScanRegexp(p1c1): p1c1_pkey
+LOG:  available indexes for IndexScanRegexp(p1c2): p1c2_pkey
+LOG:  available indexes for IndexScanRegexp(p1c3): p1c3_pkey
+LOG:  pg_hint_plan:
+used hint:
+IndexScanRegexp(p1 .*pkey)
+not used hint:
+duplication hint:
+error hint:
+
+                    QUERY PLAN                     
+---------------------------------------------------
+ Result
+   ->  Append
+         ->  Index Scan using p1_pkey on p1
+               Index Cond: (c1 = 1)
+         ->  Index Scan using p1c1_pkey on p1c1 p1
+               Index Cond: (c1 = 1)
+(6 rows)
+
+-- No. S-3-13-5
+/*+IndexScanRegexp(p1 p1.*i)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
+LOG:  available indexes for IndexScanRegexp(p1): p1_i2 p1_i
+LOG:  available indexes for IndexScanRegexp(p1c1): p1c1_i p1c1_c4_expr_idx
+LOG:  available indexes for IndexScanRegexp(p1c2): p1c2_i p1c2_c4_expr_idx
+LOG:  available indexes for IndexScanRegexp(p1c3): p1c3_i p1c3_c4_expr_idx
+LOG:  pg_hint_plan:
+used hint:
+IndexScanRegexp(p1 p1.*i)
+not used hint:
+duplication hint:
+error hint:
+
+                   QUERY PLAN                   
+------------------------------------------------
+ Result
+   ->  Append
+         ->  Index Scan using p1_i on p1
+               Index Cond: (c1 = 1)
+         ->  Index Scan using p1c1_i on p1c1 p1
+               Index Cond: (c1 = 1)
+(6 rows)
+
+-- No. S-3-13-6
+/*+IndexScanRegexp(p1 no.*_exist)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
+LOG:  available indexes for IndexScanRegexp(p1):
+LOG:  available indexes for IndexScanRegexp(p1c1):
+LOG:  available indexes for IndexScanRegexp(p1c2):
+LOG:  available indexes for IndexScanRegexp(p1c3):
+LOG:  pg_hint_plan:
+used hint:
+IndexScanRegexp(p1 no.*_exist)
+not used hint:
+duplication hint:
+error hint:
+
+           QUERY PLAN            
+---------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p1
+               Filter: (c1 = 1)
+         ->  Seq Scan on p1c1 p1
+               Filter: (c1 = 1)
+(6 rows)
+
+----
+---- No. S-3-14 message output
+----
+-- No. S-3-14-1
+/*+IndexScan(ti1 ti1_i1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
+LOG:  available indexes for IndexScan(ti1): ti1_i1
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(ti1 ti1_i1)
+not used hint:
+duplication hint:
+error hint:
+
+           QUERY PLAN           
+--------------------------------
+ Index Scan using ti1_i1 on ti1
+   Index Cond: (c2 = 1)
+(2 rows)
+
+-- No. S-3-14-2
+/*+IndexScan(ti1 not_exist)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
+LOG:  available indexes for IndexScan(ti1):
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(ti1 not_exist)
+not used hint:
+duplication hint:
+error hint:
+
+     QUERY PLAN     
+--------------------
+ Seq Scan on ti1
+   Filter: (c2 = 1)
+(2 rows)
+
+-- No. S-3-14-3
+/*+IndexScan(ti1 ti1_i1 ti1_i2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
+LOG:  available indexes for IndexScan(ti1): ti1_i2 ti1_i1
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(ti1 ti1_i1 ti1_i2)
+not used hint:
+duplication hint:
+error hint:
+
+           QUERY PLAN           
+--------------------------------
+ Index Scan using ti1_i2 on ti1
+   Index Cond: (c2 = 1)
+(2 rows)
+
+-- No. S-3-14-4
+/*+IndexScan(ti1 ti1_i1 not_exist)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
+LOG:  available indexes for IndexScan(ti1): ti1_i1
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(ti1 ti1_i1 not_exist)
+not used hint:
+duplication hint:
+error hint:
+
+           QUERY PLAN           
+--------------------------------
+ Index Scan using ti1_i1 on ti1
+   Index Cond: (c2 = 1)
+(2 rows)
+
+-- No. S-3-14-5
+/*+IndexScan(ti1 not_exist1 not_exist2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
+LOG:  available indexes for IndexScan(ti1):
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(ti1 not_exist1 not_exist2)
+not used hint:
+duplication hint:
+error hint:
+
+     QUERY PLAN     
+--------------------
+ Seq Scan on ti1
+   Filter: (c2 = 1)
+(2 rows)
+