ORDER BY t_1.c1 LIMIT 1;
$$ LANGUAGE SQL IMMUTABLE;
--No.13-4-1
+-- recall_planner() is reduced to constant while planning using the
+-- hint defined in the function. Then the outer query is planned based
+-- on the following hint. pg_hint_plan shows the log for the function
+-- but the resulting explain output doesn't contain the corresponding
+-- plan.
/*+HashJoin(t_1 t_2)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 t_1
ORDER BY t_1.c1;
LOG: pg_hint_plan:
used hint:
-HashJoin(t_1 t_2)
+IndexScan(t_1)
not used hint:
duplication hint:
error hint:
(7 rows)
--No.13-4-2
+--See description for No.13-4-1
/*+HashJoin(st_1 st_2)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 st_1
ORDER BY st_1.c1;
LOG: pg_hint_plan:
used hint:
+IndexScan(t_1)
not used hint:
-HashJoin(st_1 st_2)
duplication hint:
error hint:
(7 rows)
--No.13-4-3
+--See description for No.13-4-1
/*+HashJoin(t_1 t_2)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 st_1
ORDER BY st_1.c1;
LOG: pg_hint_plan:
used hint:
-HashJoin(t_1 t_2)
+IndexScan(t_1)
not used hint:
duplication hint:
error hint:
(6 rows)
--No.13-4-4
+--See description for No.13-4-1
/*+HashJoin(st_1 st_2)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 t_1
ORDER BY t_1.c1;
LOG: pg_hint_plan:
used hint:
+IndexScan(t_1)
not used hint:
-HashJoin(st_1 st_2)
duplication hint:
error hint:
(6 rows)
--No.13-4-5
+-- See description for No.13-4-1. No joins in ths plan, so
+-- pg_hint_plan doesn't complain on the wrongly written error hint.
/*+HashJoin(t_1 t_1)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 t_1
ORDER BY t_1.c1;
-INFO: pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
-DETAIL: Relation name "t_1" is duplicated.
LOG: pg_hint_plan:
used hint:
+IndexScan(t_1)
not used hint:
duplication hint:
error hint:
-HashJoin(t_1 t_1)
LOG: pg_hint_plan:
used hint:
SELECT recall_planner_one_t() FROM s1.t1 t_1
JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
ORDER BY t_1.c1;
+LOG: pg_hint_plan:
+used hint:
+IndexScan(t_1)
+not used hint:
+duplication hint:
+error hint:
+
QUERY PLAN
---------------------------------------------
Merge Join
ORDER BY t_1.c1;
LOG: pg_hint_plan:
used hint:
+IndexScan(t_1)
not used hint:
-HashJoin(t_1 t_1)
duplication hint:
error hint:
DROP FUNCTION recall_planner_one_t(int);
ERROR: function recall_planner_one_t(integer) does not exist
--No.13-4-7
+-- See description for No.13-4-1. Complains on the wrongly written hint.
/*+HashJoin(t_1 t_1)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 t_1
JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
ORDER BY t_1.c1;
-INFO: pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
-DETAIL: Relation name "t_1" is duplicated.
LOG: pg_hint_plan:
used hint:
+IndexScan(t_1)
not used hint:
duplication hint:
error hint:
-HashJoin(t_1 t_1)
INFO: pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
DETAIL: Relation name "t_1" is duplicated.
ORDER BY t_1.c1;
INFO: pg_hint_plan: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
DETAIL: Conflict join method hint.
-INFO: pg_hint_plan: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
-DETAIL: Conflict join method hint.
LOG: pg_hint_plan:
used hint:
-HashJoin(t_1 t_2)
+IndexScan(t_1)
not used hint:
duplication hint:
-MergeJoin(t_1 t_2)
error hint:
LOG: pg_hint_plan:
* case of DESCRIBE message handling or EXECUTE command. We may still see a
* candidate top-level query in pstate in the case.
*/
- if (!p && pstate)
+ if (pstate && pstate->p_sourcetext)
p = pstate->p_sourcetext;
/* We don't see a query string, return NULL */
*/
recurse_level++;
prev_hint_str = current_hint_str;
+ current_hint_str = NULL;
/*
* Use PG_TRY mechanism to recover GUC parameters and current_hint_state to
$$ LANGUAGE SQL IMMUTABLE;
--No.13-4-1
+-- recall_planner() is reduced to constant while planning using the
+-- hint defined in the function. Then the outer query is planned based
+-- on the following hint. pg_hint_plan shows the log for the function
+-- but the resulting explain output doesn't contain the corresponding
+-- plan.
/*+HashJoin(t_1 t_2)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 t_1
ORDER BY t_1.c1;
--No.13-4-2
+--See description for No.13-4-1
/*+HashJoin(st_1 st_2)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 st_1
ORDER BY st_1.c1;
--No.13-4-3
+--See description for No.13-4-1
/*+HashJoin(t_1 t_2)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 st_1
ORDER BY st_1.c1;
--No.13-4-4
+--See description for No.13-4-1
/*+HashJoin(st_1 st_2)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 t_1
ORDER BY t_1.c1;
--No.13-4-5
+-- See description for No.13-4-1. No joins in ths plan, so
+-- pg_hint_plan doesn't complain on the wrongly written error hint.
/*+HashJoin(t_1 t_1)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 t_1
DROP FUNCTION recall_planner_one_t(int);
--No.13-4-7
+-- See description for No.13-4-1. Complains on the wrongly written hint.
/*+HashJoin(t_1 t_1)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 t_1