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 '@abs_srcdir@/data/data.csv');
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;
29 Join Filter: (t1.c1 = ft_2.id)
31 -> Foreign Scan on ft1 ft_1
32 Foreign File: @abs_srcdir@/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: @abs_srcdir@/data/data.csv
39 ---- No. S-1-5 object type for the hint
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;
54 Join Filter: (t1.c1 = ft_2.id)
56 Hash Cond: (t1.c1 = ft_1.id)
59 -> Foreign Scan on ft1 ft_1
60 Foreign File: @abs_srcdir@/data/data.csv
61 -> Foreign Scan on ft1 ft_2
62 Foreign File: @abs_srcdir@/data/data.csv
65 ---- No. J-1-6 object type for the hint
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;
80 Merge Cond: (ft_1.id = ft_2.id)
83 -> Foreign Scan on ft1 ft_1
84 Foreign File: @abs_srcdir@/data/data.csv
87 -> Foreign Scan on ft1 ft_2
88 Foreign File: @abs_srcdir@/data/data.csv
89 -> Index Scan using t1_i1 on t1
90 Index Cond: (c1 = ft_1.id)
93 ---- No. L-1-6 object type for the hint
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;
100 Leading(ft_1 ft_2 t1)
107 Join Filter: (ft_1.id = ft_2.id)
108 -> Foreign Scan on ft1 ft_1
109 Foreign File: @abs_srcdir@/data/data.csv
110 -> Foreign Scan on ft1 ft_2
111 Foreign File: @abs_srcdir@/data/data.csv
112 -> Index Scan using t1_i1 on t1
113 Index Cond: (c1 = ft_1.id)