SET pg_hint_plan.debug_print TO on;
SET client_min_messages TO LOG;
SET search_path TO public;
+SET max_parallel_workers_per_gather TO 0;
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
QUERY PLAN
------------------------------------------------
/*+Leading(t1 t2 t3 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s2.t1 WHERE s1.t1.c1 = t2.c1 AND s1.t1.c1 = t3.c1 AND s1.t1.c1 = s2.t1.c1;
-INFO: hint syntax error at or near "Leading(t1 t2 t3 t1)"
+INFO: pg_hint_plan: hint syntax error at or near "Leading(t1 t2 t3 t1)"
DETAIL: Relation name "t1" is ambiguous.
LOG: pg_hint_plan:
used hint:
-- No. L-1-5-2
/*+Leading(t4 t2 t3 t1 t4)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near "Leading(t4 t2 t3 t1 t4)"
+INFO: pg_hint_plan: hint syntax error at or near "Leading(t4 t2 t3 t1 t4)"
DETAIL: Relation name "t4" is duplicated.
LOG: pg_hint_plan:
used hint:
/*+Leading(t4 t2 t3 t4)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near "Leading(t4 t2 t3 t4)"
+INFO: pg_hint_plan: hint syntax error at or near "Leading(t4 t2 t3 t4)"
DETAIL: Relation name "t4" is duplicated.
LOG: pg_hint_plan:
used hint:
-- No. L-1-5-3
/*+Leading(t4 t2 t3 t1 t4 t2 t3 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near "Leading(t4 t2 t3 t1 t4 t2 t3 t1)"
+INFO: pg_hint_plan: hint syntax error at or near "Leading(t4 t2 t3 t1 t4 t2 t3 t1)"
DETAIL: Relation name "t4" is duplicated.
LOG: pg_hint_plan:
used hint:
/*+Leading(t4 t2 t2 t4)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near "Leading(t4 t2 t2 t4)"
+INFO: pg_hint_plan: hint syntax error at or near "Leading(t4 t2 t2 t4)"
DETAIL: Relation name "t2" is duplicated.
LOG: pg_hint_plan:
used hint:
(10 rows)
-- No. L-1-6-8
-EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1, c2, c3, c4), s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
+EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t1 (c1, c2, c3, c4), s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
QUERY PLAN
-------------------------------------------------------
Nested Loop
(13 rows)
/*+Leading(t4 t3 t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1, c2, c3, c4), s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
+EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t1 (c1, c2, c3, c4), s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
LOG: pg_hint_plan:
used hint:
not used hint:
-> Tid Scan on t1 b2t1
TID Cond: (ctid = '(1,1)'::tid)
Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 4 (returns $3)
+ InitPlan 4 (returns $4)
-> Aggregate
-> Tid Scan on t1 b3t1
TID Cond: (ctid = '(1,1)'::tid)
Join Filter: (bmt1.c1 = bmt2.c1)
-> Tid Scan on t1 bmt1
TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $3)
+ Filter: (c1 <> $4)
-> Seq Scan on t2 bmt2
Filter: (ctid = '(1,1)'::tid)
-> Tid Scan on t3 bmt3
-> Tid Scan on t1 b2t1
TID Cond: (ctid = '(1,1)'::tid)
Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 4 (returns $3)
+ InitPlan 4 (returns $4)
-> Aggregate
-> Tid Scan on t1 b3t1
TID Cond: (ctid = '(1,1)'::tid)
Filter: (ctid = '(1,1)'::tid)
-> Tid Scan on t1 bmt1
TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $3)
+ Filter: (c1 <> $4)
(46 rows)
----
/*+Leading(v1t1 v1t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
-INFO: hint syntax error at or near "Leading(v1t1 v1t1)"
+INFO: pg_hint_plan: hint syntax error at or near "Leading(v1t1 v1t1)"
DETAIL: Relation name "v1t1" is ambiguous.
LOG: pg_hint_plan:
used hint:
/*+Leading(r4t1 r4t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
-INFO: hint syntax error at or near "Leading(r4t1 r4t1)"
+INFO: pg_hint_plan: hint syntax error at or near "Leading(r4t1 r4t1)"
DETAIL: Relation name "r4t1" is ambiguous.
LOG: pg_hint_plan:
used hint:
---- No. L-2-4 VALUES clause
----
-- No. L-2-4-1
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
QUERY PLAN
-------------------------------------------------
Nested Loop
(8 rows)
/*+ Leading(t3 t1 t2) */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
LOG: pg_hint_plan:
used hint:
not used hint:
(8 rows)
/*+ Leading(*VALUES* t1 t2) */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
LOG: pg_hint_plan:
used hint:
Leading(*VALUES* t1 t2)
(7 rows)
-- No. L-2-4-2
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
QUERY PLAN
-------------------------------------------------------
Nested Loop
- Join Filter: (t1.c1 = "*VALUES*_1".column1)
-> Nested Loop
+ Join Filter: (t2.c1 = "*VALUES*_1".column1)
-> Hash Join
Hash Cond: (t2.c1 = "*VALUES*".column1)
-> Seq Scan on t2
-> Hash
-> Values Scan on "*VALUES*"
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
- -> Values Scan on "*VALUES*_1"
-(11 rows)
+ -> Materialize
+ -> Values Scan on "*VALUES*_1"
+ -> Index Scan using t1_i1 on t1
+ Index Cond: (c1 = t2.c1)
+(12 rows)
/*+ Leading(t4 t3 t2 t1) */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
LOG: pg_hint_plan:
used hint:
not used hint:
QUERY PLAN
-------------------------------------------------------
Nested Loop
- Join Filter: (t1.c1 = "*VALUES*_1".column1)
-> Nested Loop
+ Join Filter: (t2.c1 = "*VALUES*_1".column1)
-> Hash Join
Hash Cond: (t2.c1 = "*VALUES*".column1)
-> Seq Scan on t2
-> Hash
-> Values Scan on "*VALUES*"
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
- -> Values Scan on "*VALUES*_1"
-(11 rows)
+ -> Materialize
+ -> Values Scan on "*VALUES*_1"
+ -> Index Scan using t1_i1 on t1
+ Index Cond: (c1 = t2.c1)
+(12 rows)
/*+ Leading(*VALUES* t3 t2 t1) */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near "Leading(*VALUES* t3 t2 t1) "
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
+INFO: pg_hint_plan: hint syntax error at or near "Leading(*VALUES* t3 t2 t1) "
DETAIL: Relation name "*VALUES*" is ambiguous.
LOG: pg_hint_plan:
used hint:
QUERY PLAN
-------------------------------------------------------
Nested Loop
- Join Filter: (t1.c1 = "*VALUES*_1".column1)
-> Nested Loop
+ Join Filter: (t2.c1 = "*VALUES*_1".column1)
-> Hash Join
Hash Cond: (t2.c1 = "*VALUES*".column1)
-> Seq Scan on t2
-> Hash
-> Values Scan on "*VALUES*"
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
- -> Values Scan on "*VALUES*_1"
-(11 rows)
+ -> Materialize
+ -> Values Scan on "*VALUES*_1"
+ -> Index Scan using t1_i1 on t1
+ Index Cond: (c1 = t2.c1)
+(12 rows)
----
---- No. L-3-1 leading the order of table joins
EXPLAIN (COSTS false) SELECT * FROM s1.t1
JOIN s1.t2 ON (t1.c1 = t2.c1)
JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO: hint syntax error at or near "Leading(t2 t3 t1)Leading(t1 t2 t3)"
+INFO: pg_hint_plan: hint syntax error at or near "Leading(t2 t3 t1)Leading(t1 t2 t3)"
DETAIL: Conflict leading hint.
LOG: pg_hint_plan:
used hint:
EXPLAIN (COSTS false) SELECT * FROM s1.t1
JOIN s1.t2 ON (t1.c1 = t2.c1)
JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO: hint syntax error at or near "Leading(t3 t1 t2)Leading(t2 t3 t1)Leading(t1 t2 t3)"
+INFO: pg_hint_plan: hint syntax error at or near "Leading(t3 t1 t2)Leading(t2 t3 t1)Leading(t1 t2 t3)"
DETAIL: Conflict leading hint.
-INFO: hint syntax error at or near "Leading(t2 t3 t1)Leading(t1 t2 t3)"
+INFO: pg_hint_plan: hint syntax error at or near "Leading(t2 t3 t1)Leading(t1 t2 t3)"
DETAIL: Conflict leading hint.
LOG: pg_hint_plan:
used hint:
EXPLAIN (COSTS false) SELECT * FROM s1.t1
JOIN s1.t2 ON (t1.c1 = t2.c1)
JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO: hint syntax error at or near "Leading()"
+INFO: pg_hint_plan: hint syntax error at or near "Leading()"
DETAIL: Leading hint requires at least two relations.
LOG: pg_hint_plan:
used hint:
EXPLAIN (COSTS false) SELECT * FROM s1.t1
JOIN s1.t2 ON (t1.c1 = t2.c1)
JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO: hint syntax error at or near "Leading()"
+INFO: pg_hint_plan: hint syntax error at or near "Leading()"
DETAIL: Leading hint requires at least two relations.
-INFO: hint syntax error at or near "Leading(t3 t1 t2)Leading(t2 t3 t1)Leading()"
+INFO: pg_hint_plan: hint syntax error at or near "Leading(t3 t1 t2)Leading(t2 t3 t1)Leading()"
DETAIL: Conflict leading hint.
LOG: pg_hint_plan:
used hint:
EXPLAIN (COSTS false) SELECT * FROM s1.t1
JOIN s1.t2 ON (t1.c1 = t2.c1)
JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO: hint syntax error at or near "Leading()"
+INFO: pg_hint_plan: hint syntax error at or near "Leading()"
DETAIL: Leading hint requires at least two relations.
LOG: pg_hint_plan:
used hint:
EXPLAIN (COSTS false) SELECT * FROM s1.t1
JOIN s1.t2 ON (t1.c1 = t2.c1)
JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO: hint syntax error at or near "Leading(t1)"
+INFO: pg_hint_plan: hint syntax error at or near "Leading(t1)"
DETAIL: Leading hint requires at least two relations.
LOG: pg_hint_plan:
used hint:
-- No. L-3-6-1
/*+Leading((t2))*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near "Leading((t2))"
+INFO: pg_hint_plan: hint syntax error at or near "Leading((t2))"
DETAIL: Leading hint requires two sets of relations when parentheses nests.
LOG: pg_hint_plan:
used hint:
-- No. L-3-6-3
/*+Leading((t2 t3 t4))*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near "Leading((t2 t3 t4))"
+INFO: pg_hint_plan: hint syntax error at or near "Leading((t2 t3 t4))"
DETAIL: Leading hint requires two sets of relations when parentheses nests.
LOG: pg_hint_plan:
used hint:
-- No. L-3-6-5
/*+Leading((((t1 t3) t4) t2)))*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near ")"
+INFO: pg_hint_plan: hint syntax error at or near ")"
DETAIL: Unrecognized hint keyword ")".
LOG: pg_hint_plan:
used hint: