OSDN Git Service

Fix debug output level control
[pghintplan/pg_hint_plan.git] / expected / pg_hint_plan.out
index fa3e4e8..c462cf8 100644 (file)
@@ -1486,10 +1486,10 @@ error hint:
               QUERY PLAN               
 ---------------------------------------
  Nested Loop
+   Join Filter: (t1.id = t2.id)
    ->  Seq Scan on t1
          Filter: (ctid = '(1,1)'::tid)
-   ->  Index Scan using t2_pkey on t2
-         Index Cond: (id = t1.id)
+   ->  Seq Scan on t2
          Filter: (ctid = '(1,1)'::tid)
 (6 rows)
 
@@ -3011,10 +3011,10 @@ error hint:
           QUERY PLAN          
 ------------------------------
  Hash Full Join
-   Hash Cond: (t1.id = t2.id)
-   ->  Seq Scan on t1
+   Hash Cond: (t2.id = t1.id)
+   ->  Seq Scan on t2
    ->  Hash
-         ->  Seq Scan on t2
+         ->  Seq Scan on t1
 (5 rows)
 
 -- inheritance tables test
@@ -4010,11 +4010,12 @@ error hint:
                               QUERY PLAN                               
 -----------------------------------------------------------------------
  Nested Loop
+   Join Filter: (p1.id = t1.id)
    ->  Seq Scan on p1
          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
-         Index Cond: ((id = p1.id) AND (id < 10))
-(5 rows)
+         Index Cond: (id < 10)
+(6 rows)
 
 /*+MergeJoin(p1 t1)*/
 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
@@ -4135,11 +4136,12 @@ error hint:
                               QUERY PLAN                               
 -----------------------------------------------------------------------
  Nested Loop
+   Join Filter: (p1.id = t1.id)
    ->  Seq Scan on p1
          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
-         Index Cond: ((id = p1.id) AND (id < 10))
-(5 rows)
+         Index Cond: (id < 10)
+(6 rows)
 
 /*+MergeJoin(p1 t1)*/
 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
@@ -4187,22 +4189,24 @@ EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 5
                               QUERY PLAN                               
 -----------------------------------------------------------------------
  Nested Loop
+   Join Filter: (p1.id = t1.id)
    ->  Seq Scan on p1
          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
-         Index Cond: ((id = p1.id) AND (id < 10))
-(5 rows)
+         Index Cond: (id < 10)
+(6 rows)
 
 SET constraint_exclusion TO on;
 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
                               QUERY PLAN                               
 -----------------------------------------------------------------------
  Nested Loop
+   Join Filter: (p1.id = t1.id)
    ->  Seq Scan on p1
          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
-         Index Cond: ((id = p1.id) AND (id < 10))
-(5 rows)
+         Index Cond: (id < 10)
+(6 rows)
 
 SET constraint_exclusion TO off;
 /*+SeqScan(p1)*/
@@ -4217,11 +4221,12 @@ error hint:
                               QUERY PLAN                               
 -----------------------------------------------------------------------
  Nested Loop
+   Join Filter: (p1.id = t1.id)
    ->  Seq Scan on p1
          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
-         Index Cond: ((id = p1.id) AND (id < 10))
-(5 rows)
+         Index Cond: (id < 10)
+(6 rows)
 
 /*+IndexScan(p1)*/
 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
@@ -4232,15 +4237,16 @@ not used hint:
 duplication hint:
 error hint:
 
-                    QUERY PLAN                    
---------------------------------------------------
- Nested Loop
+                   QUERY PLAN                    
+-------------------------------------------------
+ Merge Join
+   Merge Cond: (p1.id = t1.id)
    ->  Index Scan using p1_pkey on p1
          Index Cond: ((id >= 50) AND (id <= 51))
          Filter: (ctid = '(1,1)'::tid)
    ->  Index Scan using t1_pkey on t1
-         Index Cond: ((id = p1.id) AND (id < 10))
-(6 rows)
+         Index Cond: (id < 10)
+(7 rows)
 
 /*+BitmapScan(p1)*/
 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
@@ -4254,14 +4260,15 @@ error hint:
                       QUERY PLAN                       
 -------------------------------------------------------
  Nested Loop
+   Join Filter: (p1.id = t1.id)
    ->  Bitmap Heap Scan on p1
          Recheck Cond: ((id >= 50) AND (id <= 51))
          Filter: (ctid = '(1,1)'::tid)
          ->  Bitmap Index Scan on p1_pkey
                Index Cond: ((id >= 50) AND (id <= 51))
    ->  Index Scan using t1_pkey on t1
-         Index Cond: ((id = p1.id) AND (id < 10))
-(8 rows)
+         Index Cond: (id < 10)
+(9 rows)
 
 /*+TidScan(p1)*/
 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
@@ -4272,15 +4279,16 @@ not used hint:
 duplication hint:
 error hint:
 
-                    QUERY PLAN                    
---------------------------------------------------
+                 QUERY PLAN                  
+---------------------------------------------
  Nested Loop
+   Join Filter: (p1.id = t1.id)
    ->  Tid Scan on p1
          TID Cond: (ctid = '(1,1)'::tid)
          Filter: ((id >= 50) AND (id <= 51))
    ->  Index Scan using t1_pkey on t1
-         Index Cond: ((id = p1.id) AND (id < 10))
-(6 rows)
+         Index Cond: (id < 10)
+(7 rows)
 
 SET constraint_exclusion TO on;
 /*+SeqScan(p1)*/
@@ -4295,11 +4303,12 @@ error hint:
                               QUERY PLAN                               
 -----------------------------------------------------------------------
  Nested Loop
+   Join Filter: (p1.id = t1.id)
    ->  Seq Scan on p1
          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
-         Index Cond: ((id = p1.id) AND (id < 10))
-(5 rows)
+         Index Cond: (id < 10)
+(6 rows)
 
 /*+IndexScan(p1)*/
 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
@@ -4310,15 +4319,16 @@ not used hint:
 duplication hint:
 error hint:
 
-                    QUERY PLAN                    
---------------------------------------------------
- Nested Loop
+                   QUERY PLAN                    
+-------------------------------------------------
+ Merge Join
+   Merge Cond: (p1.id = t1.id)
    ->  Index Scan using p1_pkey on p1
          Index Cond: ((id >= 50) AND (id <= 51))
          Filter: (ctid = '(1,1)'::tid)
    ->  Index Scan using t1_pkey on t1
-         Index Cond: ((id = p1.id) AND (id < 10))
-(6 rows)
+         Index Cond: (id < 10)
+(7 rows)
 
 /*+BitmapScan(p1)*/
 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
@@ -4332,14 +4342,15 @@ error hint:
                       QUERY PLAN                       
 -------------------------------------------------------
  Nested Loop
+   Join Filter: (p1.id = t1.id)
    ->  Bitmap Heap Scan on p1
          Recheck Cond: ((id >= 50) AND (id <= 51))
          Filter: (ctid = '(1,1)'::tid)
          ->  Bitmap Index Scan on p1_pkey
                Index Cond: ((id >= 50) AND (id <= 51))
    ->  Index Scan using t1_pkey on t1
-         Index Cond: ((id = p1.id) AND (id < 10))
-(8 rows)
+         Index Cond: (id < 10)
+(9 rows)
 
 /*+TidScan(p1)*/
 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
@@ -4350,15 +4361,16 @@ not used hint:
 duplication hint:
 error hint:
 
-                    QUERY PLAN                    
---------------------------------------------------
+                 QUERY PLAN                  
+---------------------------------------------
  Nested Loop
+   Join Filter: (p1.id = t1.id)
    ->  Tid Scan on p1
          TID Cond: (ctid = '(1,1)'::tid)
          Filter: ((id >= 50) AND (id <= 51))
    ->  Index Scan using t1_pkey on t1
-         Index Cond: ((id = p1.id) AND (id < 10))
-(6 rows)
+         Index Cond: (id < 10)
+(7 rows)
 
 -- quote test
 /*+SeqScan("""t1 )     ")IndexScan("t  2 """)HashJoin("""t1 )  "T3"t   2 """)Leading("""t1 )   "T3"t   2 """)Set(application_name"a    a       a""     a       A")*/
@@ -6601,7 +6613,9 @@ EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p
          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
 (19 rows)
 
-/*+IndexScan(p2 p2_val)*/
+-- Inhibit parallel exection to avoid interfaring the hint
+set max_parallel_workers_per_gather to 0;
+/*+ IndexScan(p2 p2_val)*/
 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
 LOG:  available indexes for IndexScan(p2):
 LOG:  available indexes for IndexScan(p2_c1):
@@ -8402,6 +8416,7 @@ duplication hint:
 error hint:
 
 \o
+set max_parallel_workers_per_gather to DEFAULT;
 \! sql/maskout.sh results/pg_hint_plan.tmpout
                                      QUERY PLAN                                     
 ------------------------------------------------------------------------------------
@@ -8417,3 +8432,48 @@ error hint:
 (9 rows)
 
 \! rm results/pg_hint_plan.tmpout
+-- hint error level
+set client_min_messages to 'DEBUG1';
+set pg_hint_plan.debug_level to 'verbose';
+/*+ SeqScan( */ SELECT 1;
+INFO:  pg_hint_plan: hint syntax error at or near ""
+DETAIL:  Closing parenthesis is necessary.
+ ?column? 
+----------
+        1
+(1 row)
+
+/*+ SeqScan(t1) */ SELECT * FROM t1 LIMIT 0;
+LOG:  pg_hint_plan:
+used hint:
+SeqScan(t1)
+not used hint:
+duplication hint:
+error hint:
+
+ id | val 
+----+-----
+(0 rows)
+
+set pg_hint_plan.message_level to 'DEBUG1';
+set pg_hint_plan.parse_messages to 'NOTICE';
+/*+ SeqScan( */ SELECT 1;
+NOTICE:  pg_hint_plan: hint syntax error at or near ""
+DETAIL:  Closing parenthesis is necessary.
+ ?column? 
+----------
+        1
+(1 row)
+
+/*+ SeqScan(t1) */ SELECT * FROM t1 LIMIT 0;
+DEBUG:  pg_hint_plan:
+used hint:
+SeqScan(t1)
+not used hint:
+duplication hint:
+error hint:
+
+ id | val 
+----+-----
+(0 rows)
+