OSDN Git Service

Add forgotten test files
[pghintplan/pg_hint_plan.git] / sql / hints_anywhere.sql
1 LOAD 'pg_hint_plan';
2 SET client_min_messages TO log;
3 \set SHOW_CONTEXT always
4 SET pg_hint_plan.debug_print TO on;
5
6 explain (costs false)
7 select * from t1 join t2 on t1.id = t2.id where '/*+HashJoin(t1 t2)*/' <> '';
8
9 set pg_hint_plan.hints_anywhere = on;
10 explain (costs false)
11 select * from t1 join t2 on t1.id = t2.id where '/*+HashJoin(t1 t2)*/' <> '';
12
13 set pg_hint_plan.hints_anywhere = off;
14 explain (costs false)
15 select * from t1 join t2 on t1.id = t2.id where '/*+HashJoin(t1 t2)*/' <> '';
16
17 set pg_hint_plan.hints_anywhere = on;
18 /*+ MergeJoin(t1 t2) */
19 explain (costs false)
20 select * from t1 join t2 on t1.val = t2.val where '/*+HashJoin(t1 t2)*/' <> '';
21
22 /*+ HashJoin(t1 t2) */
23 explain (costs false)
24 select * from t1 join t2 on t1.val = t2.val where '/*+MergeJoin(t1 t2)*/' <> '';