OSDN Git Service

Fix a crash bug in case debug_query_string is NULL
[pghintplan/pg_hint_plan.git] / expected / ut-fdw.out~
1 LOAD 'pg_hint_plan';
2 SET search_path TO public;
3 SET pg_hint_plan.debug_print TO on;
4 SET client_min_messages TO LOG;
5 SET pg_hint_plan.enable_hint TO on;
6 CREATE EXTENSION file_fdw;
7 CREATE SERVER file_server FOREIGN DATA WRAPPER file_fdw;
8 CREATE USER MAPPING FOR PUBLIC SERVER file_server;
9 CREATE FOREIGN TABLE ft1 (id int, val int) SERVER file_server OPTIONS (format 'csv', filename '/home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv');
10 -- foreign table test
11 SELECT * FROM ft1;
12  id | val 
13 ----+-----
14   1 |   1
15   2 |   2
16   3 |   3
17   4 |   4
18   5 |   5
19   6 |   6
20   7 |   7
21   8 |   8
22   9 |   9
23  10 |  10
24 (10 rows)
25
26 \t
27 EXPLAIN (COSTS false) SELECT * FROM s1.t1, ft1 ft_1, ft1 ft_2 WHERE t1.c1 = ft_1.id AND t1.c1 = ft_2.id;
28  Nested Loop
29    Join Filter: (t1.c1 = ft_2.id)
30    ->  Nested Loop
31          ->  Foreign Scan on ft1 ft_1
32                Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
33          ->  Index Scan using t1_i1 on t1
34                Index Cond: (c1 = ft_1.id)
35    ->  Foreign Scan on ft1 ft_2
36          Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
37
38 ----
39 ---- No. S-1-5 object type for the hint
40 ----
41 -- No. S-1-5-6
42 /*+SeqScan(t1)SeqScan(ft_1)SeqScan(ft_2)*/
43 EXPLAIN (COSTS false) SELECT * FROM s1.t1, ft1 ft_1, ft1 ft_2 WHERE t1.c1 = ft_1.id AND t1.c1 = ft_2.id;
44 LOG:  pg_hint_plan:
45 used hint:
46 SeqScan(t1)
47 not used hint:
48 SeqScan(ft_1)
49 SeqScan(ft_2)
50 duplication hint:
51 error hint:
52
53  Nested Loop
54    Join Filter: (t1.c1 = ft_2.id)
55    ->  Hash Join
56          Hash Cond: (t1.c1 = ft_1.id)
57          ->  Seq Scan on t1
58          ->  Hash
59                ->  Foreign Scan on ft1 ft_1
60                      Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
61    ->  Foreign Scan on ft1 ft_2
62          Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
63
64 ----
65 ---- No. J-1-6 object type for the hint
66 ----
67 -- No. J-1-6-6
68 /*+MergeJoin(ft_1 ft_2)Leading(ft_1 ft_2 t1)*/
69 EXPLAIN (COSTS false) SELECT * FROM s1.t1, ft1 ft_1, ft1 ft_2 WHERE t1.c1 = ft_1.id AND t1.c1 = ft_2.id;
70 LOG:  pg_hint_plan:
71 used hint:
72 MergeJoin(ft_1 ft_2)
73 Leading(ft_1 ft_2 t1)
74 not used hint:
75 duplication hint:
76 error hint:
77
78  Nested Loop
79    ->  Merge Join
80          Merge Cond: (ft_1.id = ft_2.id)
81          ->  Sort
82                Sort Key: ft_1.id
83                ->  Foreign Scan on ft1 ft_1
84                      Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
85          ->  Sort
86                Sort Key: ft_2.id
87                ->  Foreign Scan on ft1 ft_2
88                      Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
89    ->  Index Scan using t1_i1 on t1
90          Index Cond: (c1 = ft_1.id)
91
92 ----
93 ---- No. L-1-6 object type for the hint
94 ----
95 -- No. L-1-6-6
96 /*+Leading(ft_1 ft_2 t1)*/
97 EXPLAIN (COSTS false) SELECT * FROM s1.t1, ft1 ft_1, ft1 ft_2 WHERE t1.c1 = ft_1.id AND t1.c1 = ft_2.id;
98 LOG:  pg_hint_plan:
99 used hint:
100 Leading(ft_1 ft_2 t1)
101 not used hint:
102 duplication hint:
103 error hint:
104
105  Nested Loop
106    ->  Nested Loop
107          Join Filter: (ft_1.id = ft_2.id)
108          ->  Foreign Scan on ft1 ft_1
109                Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
110          ->  Foreign Scan on ft1 ft_2
111                Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
112    ->  Index Scan using t1_i1 on t1
113          Index Cond: (c1 = ft_1.id)
114
115 ----
116 ---- No. R-1-6 object type for the hint
117 ----
118 -- No. R-1-6-6
119 \o results/ut-fdw.tmpout
120 /*+Rows(ft_1 ft_2 #1)Leading(ft_1 ft_2 t1)*/
121 EXPLAIN SELECT * FROM s1.t1, ft1 ft_1, ft1 ft_2 WHERE t1.c1 = ft_1.id AND t1.c1 = ft_2.id;
122 LOG:  pg_hint_plan:
123 used hint:
124 Leading(ft_1 ft_2 t1)
125 Rows(ft_1 ft_2 #1)
126 not used hint:
127 duplication hint:
128 error hint:
129
130 \o
131 \! sql/maskout.sh results/ut-fdw.tmpout
132  Nested Loop  (cost=xxx rows=1 width=xxx)
133    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
134          Join Filter: (ft_1.id = ft_2.id)
135          ->  Foreign Scan on ft1 ft_1  (cost=xxx rows=1 width=xxx)
136                Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
137                Foreign File Size: 42
138          ->  Foreign Scan on ft1 ft_2  (cost=xxx rows=1 width=xxx)
139                Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
140                Foreign File Size: 42
141    ->  Index Scan using t1_i1 on t1  (cost=xxx rows=1 width=xxx)
142          Index Cond: (c1 = ft_1.id)
143
144 \! rm results/ut-fdw.tmpout