firtst release
Revision | 890dc402187cbebdc2a49ea2ef8d728c8a70c65c (tree) |
---|---|
Time | 2014-09-17 16:47:34 |
Author | Kyotaro Horiguchi <horiguchi.kyotaro@lab....> |
Commiter | Kyotaro Horiguchi |
Fix regtests. Drop 9.2 support, RPM automation
@@ -1,10 +1,11 @@ | ||
1 | 1 | # |
2 | 2 | # pg_hint_plan: Makefile |
3 | 3 | # |
4 | -# Copyright (c) 2012-2013, NIPPON TELEGRAPH AND TELEPHONE CORPORATION | |
4 | +# Copyright (c) 2012-2014, NIPPON TELEGRAPH AND TELEPHONE CORPORATION | |
5 | 5 | # |
6 | 6 | |
7 | 7 | MODULES = pg_hint_plan |
8 | +HINTPLANVER = 1.0.1 | |
8 | 9 | REGRESS = init base_plan pg_hint_plan ut-init ut-A ut-S ut-J ut-L ut-G ut-fdw ut-fini |
9 | 10 | |
10 | 11 | REGRESSION_EXPECTED = expected/init.out expected/base_plan.out expected/pg_hint_plan.out expected/ut-A.out expected/ut-S.out expected/ut-J.out expected/ut-L.out expected/ut-G.out |
@@ -12,7 +13,7 @@ REGRESSION_EXPECTED = expected/init.out expected/base_plan.out expected/pg_hint_ | ||
12 | 13 | REGRESS_OPTS = --encoding=UTF8 |
13 | 14 | |
14 | 15 | EXTENSION = pg_hint_plan |
15 | -DATA = pg_hint_plan--1.0.sql | |
16 | +DATA = pg_hint_plan--1.0--1.0.1.sql pg_hint_plan--1.0.1.sql | |
16 | 17 | |
17 | 18 | EXTRA_CLEAN = core.c sql/ut-fdw.sql expected/ut-fdw.out $(REGRESSION_EXPECTED) |
18 | 19 |
@@ -26,7 +27,34 @@ core.c: core-$(MAJORVERSION).c | ||
26 | 27 | $(REGRESSION_EXPECTED): %.out: %-$(MAJORVERSION).out |
27 | 28 | cp $< $@ |
28 | 29 | |
30 | +STARBALL = pg_dbms_stats-$(DBMSSTATSVER).tar.gz | |
31 | +STARBALL91 = pg_hint_plan91-$(HINTPLANVER).tar.gz | |
32 | +STARBALLS = $(STARBALL) $(STARBALL91) | |
33 | + | |
34 | +TARSOURCES = Makefile *.c *.h \ | |
35 | + pg_hint_plan--*.sql \ | |
36 | + pg_hint_plan.control \ | |
37 | + doc/* expected/*.out sql/*.sql \ | |
38 | + input/*.source output/*.source SPECS/*.spec | |
39 | + | |
29 | 40 | installcheck: $(REGRESSION_EXPECTED) |
30 | 41 | |
42 | +rpms: rpm91 | |
43 | + | |
31 | 44 | # pg_hint_plan.c includes core.c and make_join_rel.c |
32 | 45 | pg_hint_plan.o: core.c make_join_rel.c pg_stat_statements.c |
46 | + | |
47 | +$(STARBALLS): $(TARSOURCES) | |
48 | + if [ -h $(subst .tar.gz,,$@) ]; then rm $(subst .tar.gz,,$@); fi | |
49 | + if [ -e $(subst .tar.gz,,$@) ]; then \ | |
50 | + echo "$(subst .tar.gz,,$@) is not a symlink. Stop."; \ | |
51 | + exit 1; \ | |
52 | + fi | |
53 | + ln -s . $(subst .tar.gz,,$@) | |
54 | + tar -chzf $@ $(addprefix $(subst .tar.gz,,$@)/, $^) | |
55 | + rm $(subst .tar.gz,,$@) | |
56 | + | |
57 | +rpm91: $(STARBALL91) | |
58 | + MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_hint_plan91.spec | |
59 | + | |
60 | + |
@@ -5,11 +5,15 @@ | ||
5 | 5 | %define _bindir %{_pgdir}/bin |
6 | 6 | %define _libdir %{_pgdir}/lib |
7 | 7 | %define _datadir %{_pgdir}/share |
8 | +%if "%(echo ${MAKE_ROOT})" != "" | |
9 | + %define _rpmdir %(echo ${MAKE_ROOT})/RPMS | |
10 | + %define _sourcedir %(echo ${MAKE_ROOT}) | |
11 | +%endif | |
8 | 12 | |
9 | 13 | ## Set general information for pg_hint_plan. |
10 | 14 | Summary: Optimizer hint for PostgreSQL 9.1 |
11 | 15 | Name: pg_hint_plan91 |
12 | -Version: 1.1.0 | |
16 | +Version: 1.0.1 | |
13 | 17 | Release: 1%{?dist} |
14 | 18 | License: BSD |
15 | 19 | Group: Applications/Databases |
@@ -36,11 +40,19 @@ Note that this package is available for only PostgreSQL 9.1. | ||
36 | 40 | |
37 | 41 | ## pre work for build pg_hint_plan |
38 | 42 | %prep |
43 | +PATH=/usr/pgsql-9.1/bin:$PATH | |
44 | +if [ "${MAKE_ROOT}" != "" ]; then | |
45 | + pushd ${MAKE_ROOT} | |
46 | + make clean %{name}-%{version}.tar.gz | |
47 | + popd | |
48 | +fi | |
49 | +if [ ! -d %{_rpmdir} ]; then mkdir -p %{_rpmdir}; fi | |
39 | 50 | %setup -q |
40 | 51 | |
41 | 52 | ## Set variables for build environment |
42 | 53 | %build |
43 | -make %{?_smp_mflags} | |
54 | +PATH=/usr/pgsql-9.1/bin:$PATH | |
55 | +make USE_PGXS=1 %{?_smp_mflags} | |
44 | 56 | |
45 | 57 | ## Set variables for install |
46 | 58 | %install |
@@ -48,7 +60,8 @@ rm -rf %{buildroot} | ||
48 | 60 | install -d %{buildroot}%{_libdir} |
49 | 61 | install pg_hint_plan.so %{buildroot}%{_libdir}/pg_hint_plan.so |
50 | 62 | install -d %{buildroot}%{_datadir}/extension |
51 | -install -m 644 pg_hint_plan--1.0.sql %{buildroot}%{_datadir}/extension/pg_hint_plan--1.0.sql | |
63 | +install -m 644 pg_hint_plan--1.0.1.sql %{buildroot}%{_datadir}/extension/pg_hint_plan--1.0.1.sql | |
64 | +install -m 644 pg_hint_plan--1.0--1.0.1.sql %{buildroot}%{_datadir}/extension/pg_hint_plan--1.0--1.0.1.sql | |
52 | 65 | install -m 644 pg_hint_plan.control %{buildroot}%{_datadir}/extension/pg_hint_plan.control |
53 | 66 | |
54 | 67 | %clean |
@@ -58,11 +71,14 @@ rm -rf %{buildroot} | ||
58 | 71 | %defattr(0755,root,root) |
59 | 72 | %{_libdir}/pg_hint_plan.so |
60 | 73 | %defattr(0644,root,root) |
61 | -%{_datadir}/extension/pg_hint_plan--1.0.sql | |
74 | +%{_datadir}/extension/pg_hint_plan--1.0.1.sql | |
75 | +%{_datadir}/extension/pg_hint_plan--1.0--1.0.1.sql | |
62 | 76 | %{_datadir}/extension/pg_hint_plan.control |
63 | 77 | |
64 | 78 | # History of pg_hint_plan. |
65 | 79 | %changelog |
80 | +* Thu Sep 14 2014 Kyotaro Horiguchi | |
81 | +- Bug fix. | |
66 | 82 | * Mon Sep 02 2013 Takashi Suzuki |
67 | 83 | - Initial cut for 1.1.0 |
68 | 84 | * Mon Sep 24 2012 Shigeru Hanada <shigeru.hanada@gmail.com> |
@@ -1,70 +0,0 @@ | ||
1 | -# SPEC file for pg_hint_plan | |
2 | -# Copyright(C) 2013 NIPPON TELEGRAPH AND TELEPHONE CORPORATION | |
3 | - | |
4 | -%define _pgdir /usr/pgsql-9.2 | |
5 | -%define _bindir %{_pgdir}/bin | |
6 | -%define _libdir %{_pgdir}/lib | |
7 | -%define _datadir %{_pgdir}/share | |
8 | - | |
9 | -## Set general information for pg_hint_plan. | |
10 | -Summary: Optimizer hint for PostgreSQL 9.2 | |
11 | -Name: pg_hint_plan92 | |
12 | -Version: 1.1.0 | |
13 | -Release: 1%{?dist} | |
14 | -License: BSD | |
15 | -Group: Applications/Databases | |
16 | -Source0: %{name}-%{version}.tar.gz | |
17 | -#URL: http://example.com/pg_hint_plan/ | |
18 | -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n) | |
19 | -Vendor: NIPPON TELEGRAPH AND TELEPHONE CORPORATION | |
20 | - | |
21 | -## We use postgresql-devel package | |
22 | -BuildRequires: postgresql92-devel | |
23 | -Requires: postgresql92-libs | |
24 | - | |
25 | -## Description for "pg_hint_plan" | |
26 | -%description | |
27 | -pg_hint_plan provides capability to force arbitrary plan to PostgreSQL' planner | |
28 | -to optimize queries by hand directly. | |
29 | - | |
30 | -If you have query plan better than which PostgreSQL chooses, you can force your | |
31 | -plan by adding special comment block with optimizer hint before the query you | |
32 | -want to optimize. You can control scan method, join method, join order, and | |
33 | -planner-related GUC parameters during planning. | |
34 | - | |
35 | -Note that this package is available for only PostgreSQL 9.2. | |
36 | - | |
37 | -## pre work for build pg_hint_plan | |
38 | -%prep | |
39 | -%setup -q | |
40 | - | |
41 | -## Set variables for build environment | |
42 | -%build | |
43 | -make %{?_smp_mflags} | |
44 | - | |
45 | -## Set variables for install | |
46 | -%install | |
47 | -rm -rf %{buildroot} | |
48 | -install -d %{buildroot}%{_libdir} | |
49 | -install pg_hint_plan.so %{buildroot}%{_libdir}/pg_hint_plan.so | |
50 | -install -d %{buildroot}%{_datadir}/extension | |
51 | -install -m 644 pg_hint_plan--1.0.sql %{buildroot}%{_datadir}/extension/pg_hint_plan--1.0.sql | |
52 | -install -m 644 pg_hint_plan.control %{buildroot}%{_datadir}/extension/pg_hint_plan.control | |
53 | - | |
54 | -%clean | |
55 | -rm -rf %{buildroot} | |
56 | - | |
57 | -%files | |
58 | -%defattr(0755,root,root) | |
59 | -%{_libdir}/pg_hint_plan.so | |
60 | -%defattr(0644,root,root) | |
61 | -%{_datadir}/extension/pg_hint_plan--1.0.sql | |
62 | -%{_datadir}/extension/pg_hint_plan.control | |
63 | - | |
64 | -# History of pg_hint_plan. | |
65 | -%changelog | |
66 | -* Mon Sep 02 2013 Takashi Suzuki | |
67 | -- Initial cut for 1.1.0 | |
68 | -* Mon Sep 24 2012 Shigeru Hanada <shigeru.hanada@gmail.com> | |
69 | -- Initial cut for 1.0.0 | |
70 | - |
@@ -1,1048 +0,0 @@ | ||
1 | -/*------------------------------------------------------------------------- | |
2 | - * | |
3 | - * core.c | |
4 | - * Routines copied from PostgreSQL core distribution. | |
5 | - * | |
6 | - * src/backend/optimizer/path/allpaths.c | |
7 | - * set_append_rel_pathlist() | |
8 | - * generate_mergeappend_paths() | |
9 | - * accumulate_append_subpath() | |
10 | - * standard_join_search() | |
11 | - * | |
12 | - * src/backend/optimizer/path/joinrels.c | |
13 | - * join_search_one_level() | |
14 | - * make_rels_by_clause_joins() | |
15 | - * make_rels_by_clauseless_joins() | |
16 | - * join_is_legal() | |
17 | - * has_join_restriction() | |
18 | - * is_dummy_rel() | |
19 | - * mark_dummy_rel() | |
20 | - * restriction_is_constant_false() | |
21 | - * | |
22 | - * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group | |
23 | - * Portions Copyright (c) 1994, Regents of the University of California | |
24 | - * | |
25 | - *------------------------------------------------------------------------- | |
26 | - */ | |
27 | - | |
28 | -/* | |
29 | - * set_append_rel_pathlist | |
30 | - * Build access paths for an "append relation" | |
31 | - */ | |
32 | -static void | |
33 | -set_append_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, | |
34 | - Index rti, RangeTblEntry *rte) | |
35 | -{ | |
36 | - int parentRTindex = rti; | |
37 | - List *live_childrels = NIL; | |
38 | - List *subpaths = NIL; | |
39 | - List *all_child_pathkeys = NIL; | |
40 | - List *all_child_outers = NIL; | |
41 | - ListCell *l; | |
42 | - | |
43 | - /* | |
44 | - * Generate access paths for each member relation, and remember the | |
45 | - * cheapest path for each one. Also, identify all pathkeys (orderings) | |
46 | - * and parameterizations (required_outer sets) available for the member | |
47 | - * relations. | |
48 | - */ | |
49 | - foreach(l, root->append_rel_list) | |
50 | - { | |
51 | - AppendRelInfo *appinfo = (AppendRelInfo *) lfirst(l); | |
52 | - int childRTindex; | |
53 | - RangeTblEntry *childRTE; | |
54 | - RelOptInfo *childrel; | |
55 | - ListCell *lcp; | |
56 | - | |
57 | - /* append_rel_list contains all append rels; ignore others */ | |
58 | - if (appinfo->parent_relid != parentRTindex) | |
59 | - continue; | |
60 | - | |
61 | - /* Re-locate the child RTE and RelOptInfo */ | |
62 | - childRTindex = appinfo->child_relid; | |
63 | - childRTE = root->simple_rte_array[childRTindex]; | |
64 | - childrel = root->simple_rel_array[childRTindex]; | |
65 | - | |
66 | - /* | |
67 | - * Compute the child's access paths. | |
68 | - */ | |
69 | - set_rel_pathlist(root, childrel, childRTindex, childRTE); | |
70 | - | |
71 | - /* | |
72 | - * If child is dummy, ignore it. | |
73 | - */ | |
74 | - if (IS_DUMMY_REL(childrel)) | |
75 | - continue; | |
76 | - | |
77 | - /* | |
78 | - * Child is live, so add its cheapest access path to the Append path | |
79 | - * we are constructing for the parent. | |
80 | - */ | |
81 | - subpaths = accumulate_append_subpath(subpaths, | |
82 | - childrel->cheapest_total_path); | |
83 | - | |
84 | - /* Remember which childrels are live, for logic below */ | |
85 | - live_childrels = lappend(live_childrels, childrel); | |
86 | - | |
87 | - /* | |
88 | - * Collect lists of all the available path orderings and | |
89 | - * parameterizations for all the children. We use these as a | |
90 | - * heuristic to indicate which sort orderings and parameterizations we | |
91 | - * should build Append and MergeAppend paths for. | |
92 | - */ | |
93 | - foreach(lcp, childrel->pathlist) | |
94 | - { | |
95 | - Path *childpath = (Path *) lfirst(lcp); | |
96 | - List *childkeys = childpath->pathkeys; | |
97 | - Relids childouter = PATH_REQ_OUTER(childpath); | |
98 | - | |
99 | - /* Unsorted paths don't contribute to pathkey list */ | |
100 | - if (childkeys != NIL) | |
101 | - { | |
102 | - ListCell *lpk; | |
103 | - bool found = false; | |
104 | - | |
105 | - /* Have we already seen this ordering? */ | |
106 | - foreach(lpk, all_child_pathkeys) | |
107 | - { | |
108 | - List *existing_pathkeys = (List *) lfirst(lpk); | |
109 | - | |
110 | - if (compare_pathkeys(existing_pathkeys, | |
111 | - childkeys) == PATHKEYS_EQUAL) | |
112 | - { | |
113 | - found = true; | |
114 | - break; | |
115 | - } | |
116 | - } | |
117 | - if (!found) | |
118 | - { | |
119 | - /* No, so add it to all_child_pathkeys */ | |
120 | - all_child_pathkeys = lappend(all_child_pathkeys, | |
121 | - childkeys); | |
122 | - } | |
123 | - } | |
124 | - | |
125 | - /* Unparameterized paths don't contribute to param-set list */ | |
126 | - if (childouter) | |
127 | - { | |
128 | - ListCell *lco; | |
129 | - bool found = false; | |
130 | - | |
131 | - /* Have we already seen this param set? */ | |
132 | - foreach(lco, all_child_outers) | |
133 | - { | |
134 | - Relids existing_outers = (Relids) lfirst(lco); | |
135 | - | |
136 | - if (bms_equal(existing_outers, childouter)) | |
137 | - { | |
138 | - found = true; | |
139 | - break; | |
140 | - } | |
141 | - } | |
142 | - if (!found) | |
143 | - { | |
144 | - /* No, so add it to all_child_outers */ | |
145 | - all_child_outers = lappend(all_child_outers, | |
146 | - childouter); | |
147 | - } | |
148 | - } | |
149 | - } | |
150 | - } | |
151 | - | |
152 | - /* | |
153 | - * Next, build an unordered, unparameterized Append path for the rel. | |
154 | - * (Note: this is correct even if we have zero or one live subpath due to | |
155 | - * constraint exclusion.) | |
156 | - */ | |
157 | - add_path(rel, (Path *) create_append_path(rel, subpaths, NULL)); | |
158 | - | |
159 | - /* | |
160 | - * Build unparameterized MergeAppend paths based on the collected list of | |
161 | - * child pathkeys. | |
162 | - */ | |
163 | - generate_mergeappend_paths(root, rel, live_childrels, all_child_pathkeys); | |
164 | - | |
165 | - /* | |
166 | - * Build Append paths for each parameterization seen among the child rels. | |
167 | - * (This may look pretty expensive, but in most cases of practical | |
168 | - * interest, the child rels will expose mostly the same parameterizations, | |
169 | - * so that not that many cases actually get considered here.) | |
170 | - * | |
171 | - * The Append node itself cannot enforce quals, so all qual checking must | |
172 | - * be done in the child paths. This means that to have a parameterized | |
173 | - * Append path, we must have the exact same parameterization for each | |
174 | - * child path; otherwise some children might be failing to check the | |
175 | - * moved-down quals. To make them match up, we can try to increase the | |
176 | - * parameterization of lesser-parameterized paths. | |
177 | - */ | |
178 | - foreach(l, all_child_outers) | |
179 | - { | |
180 | - Relids required_outer = (Relids) lfirst(l); | |
181 | - bool ok = true; | |
182 | - ListCell *lcr; | |
183 | - | |
184 | - /* Select the child paths for an Append with this parameterization */ | |
185 | - subpaths = NIL; | |
186 | - foreach(lcr, live_childrels) | |
187 | - { | |
188 | - RelOptInfo *childrel = (RelOptInfo *) lfirst(lcr); | |
189 | - Path *cheapest_total; | |
190 | - | |
191 | - cheapest_total = | |
192 | - get_cheapest_path_for_pathkeys(childrel->pathlist, | |
193 | - NIL, | |
194 | - required_outer, | |
195 | - TOTAL_COST); | |
196 | - Assert(cheapest_total != NULL); | |
197 | - | |
198 | - /* Children must have exactly the desired parameterization */ | |
199 | - if (!bms_equal(PATH_REQ_OUTER(cheapest_total), required_outer)) | |
200 | - { | |
201 | - cheapest_total = reparameterize_path(root, cheapest_total, | |
202 | - required_outer, 1.0); | |
203 | - if (cheapest_total == NULL) | |
204 | - { | |
205 | - ok = false; | |
206 | - break; | |
207 | - } | |
208 | - } | |
209 | - | |
210 | - subpaths = accumulate_append_subpath(subpaths, cheapest_total); | |
211 | - } | |
212 | - | |
213 | - if (ok) | |
214 | - add_path(rel, (Path *) | |
215 | - create_append_path(rel, subpaths, required_outer)); | |
216 | - } | |
217 | - | |
218 | - /* Select cheapest paths */ | |
219 | - set_cheapest(rel); | |
220 | -} | |
221 | - | |
222 | -/* | |
223 | - * generate_mergeappend_paths | |
224 | - * Generate MergeAppend paths for an append relation | |
225 | - * | |
226 | - * Generate a path for each ordering (pathkey list) appearing in | |
227 | - * all_child_pathkeys. | |
228 | - * | |
229 | - * We consider both cheapest-startup and cheapest-total cases, ie, for each | |
230 | - * interesting ordering, collect all the cheapest startup subpaths and all the | |
231 | - * cheapest total paths, and build a MergeAppend path for each case. | |
232 | - * | |
233 | - * We don't currently generate any parameterized MergeAppend paths. While | |
234 | - * it would not take much more code here to do so, it's very unclear that it | |
235 | - * is worth the planning cycles to investigate such paths: there's little | |
236 | - * use for an ordered path on the inside of a nestloop. In fact, it's likely | |
237 | - * that the current coding of add_path would reject such paths out of hand, | |
238 | - * because add_path gives no credit for sort ordering of parameterized paths, | |
239 | - * and a parameterized MergeAppend is going to be more expensive than the | |
240 | - * corresponding parameterized Append path. If we ever try harder to support | |
241 | - * parameterized mergejoin plans, it might be worth adding support for | |
242 | - * parameterized MergeAppends to feed such joins. (See notes in | |
243 | - * optimizer/README for why that might not ever happen, though.) | |
244 | - */ | |
245 | -static void | |
246 | -generate_mergeappend_paths(PlannerInfo *root, RelOptInfo *rel, | |
247 | - List *live_childrels, | |
248 | - List *all_child_pathkeys) | |
249 | -{ | |
250 | - ListCell *lcp; | |
251 | - | |
252 | - foreach(lcp, all_child_pathkeys) | |
253 | - { | |
254 | - List *pathkeys = (List *) lfirst(lcp); | |
255 | - List *startup_subpaths = NIL; | |
256 | - List *total_subpaths = NIL; | |
257 | - bool startup_neq_total = false; | |
258 | - ListCell *lcr; | |
259 | - | |
260 | - /* Select the child paths for this ordering... */ | |
261 | - foreach(lcr, live_childrels) | |
262 | - { | |
263 | - RelOptInfo *childrel = (RelOptInfo *) lfirst(lcr); | |
264 | - Path *cheapest_startup, | |
265 | - *cheapest_total; | |
266 | - | |
267 | - /* Locate the right paths, if they are available. */ | |
268 | - cheapest_startup = | |
269 | - get_cheapest_path_for_pathkeys(childrel->pathlist, | |
270 | - pathkeys, | |
271 | - NULL, | |
272 | - STARTUP_COST); | |
273 | - cheapest_total = | |
274 | - get_cheapest_path_for_pathkeys(childrel->pathlist, | |
275 | - pathkeys, | |
276 | - NULL, | |
277 | - TOTAL_COST); | |
278 | - | |
279 | - /* | |
280 | - * If we can't find any paths with the right order just use the | |
281 | - * cheapest-total path; we'll have to sort it later. | |
282 | - */ | |
283 | - if (cheapest_startup == NULL || cheapest_total == NULL) | |
284 | - { | |
285 | - cheapest_startup = cheapest_total = | |
286 | - childrel->cheapest_total_path; | |
287 | - Assert(cheapest_total != NULL); | |
288 | - } | |
289 | - | |
290 | - /* | |
291 | - * Notice whether we actually have different paths for the | |
292 | - * "cheapest" and "total" cases; frequently there will be no point | |
293 | - * in two create_merge_append_path() calls. | |
294 | - */ | |
295 | - if (cheapest_startup != cheapest_total) | |
296 | - startup_neq_total = true; | |
297 | - | |
298 | - startup_subpaths = | |
299 | - accumulate_append_subpath(startup_subpaths, cheapest_startup); | |
300 | - total_subpaths = | |
301 | - accumulate_append_subpath(total_subpaths, cheapest_total); | |
302 | - } | |
303 | - | |
304 | - /* ... and build the MergeAppend paths */ | |
305 | - add_path(rel, (Path *) create_merge_append_path(root, | |
306 | - rel, | |
307 | - startup_subpaths, | |
308 | - pathkeys, | |
309 | - NULL)); | |
310 | - if (startup_neq_total) | |
311 | - add_path(rel, (Path *) create_merge_append_path(root, | |
312 | - rel, | |
313 | - total_subpaths, | |
314 | - pathkeys, | |
315 | - NULL)); | |
316 | - } | |
317 | -} | |
318 | - | |
319 | -/* | |
320 | - * accumulate_append_subpath | |
321 | - * Add a subpath to the list being built for an Append or MergeAppend | |
322 | - * | |
323 | - * It's possible that the child is itself an Append path, in which case | |
324 | - * we can "cut out the middleman" and just add its child paths to our | |
325 | - * own list. (We don't try to do this earlier because we need to | |
326 | - * apply both levels of transformation to the quals.) | |
327 | - */ | |
328 | -static List * | |
329 | -accumulate_append_subpath(List *subpaths, Path *path) | |
330 | -{ | |
331 | - if (IsA(path, AppendPath)) | |
332 | - { | |
333 | - AppendPath *apath = (AppendPath *) path; | |
334 | - | |
335 | - /* list_copy is important here to avoid sharing list substructure */ | |
336 | - return list_concat(subpaths, list_copy(apath->subpaths)); | |
337 | - } | |
338 | - else | |
339 | - return lappend(subpaths, path); | |
340 | -} | |
341 | - | |
342 | -/* | |
343 | - * standard_join_search | |
344 | - * Find possible joinpaths for a query by successively finding ways | |
345 | - * to join component relations into join relations. | |
346 | - * | |
347 | - * 'levels_needed' is the number of iterations needed, ie, the number of | |
348 | - * independent jointree items in the query. This is > 1. | |
349 | - * | |
350 | - * 'initial_rels' is a list of RelOptInfo nodes for each independent | |
351 | - * jointree item. These are the components to be joined together. | |
352 | - * Note that levels_needed == list_length(initial_rels). | |
353 | - * | |
354 | - * Returns the final level of join relations, i.e., the relation that is | |
355 | - * the result of joining all the original relations together. | |
356 | - * At least one implementation path must be provided for this relation and | |
357 | - * all required sub-relations. | |
358 | - * | |
359 | - * To support loadable plugins that modify planner behavior by changing the | |
360 | - * join searching algorithm, we provide a hook variable that lets a plugin | |
361 | - * replace or supplement this function. Any such hook must return the same | |
362 | - * final join relation as the standard code would, but it might have a | |
363 | - * different set of implementation paths attached, and only the sub-joinrels | |
364 | - * needed for these paths need have been instantiated. | |
365 | - * | |
366 | - * Note to plugin authors: the functions invoked during standard_join_search() | |
367 | - * modify root->join_rel_list and root->join_rel_hash. If you want to do more | |
368 | - * than one join-order search, you'll probably need to save and restore the | |
369 | - * original states of those data structures. See geqo_eval() for an example. | |
370 | - */ | |
371 | -RelOptInfo * | |
372 | -standard_join_search(PlannerInfo *root, int levels_needed, List *initial_rels) | |
373 | -{ | |
374 | - int lev; | |
375 | - RelOptInfo *rel; | |
376 | - | |
377 | - /* | |
378 | - * This function cannot be invoked recursively within any one planning | |
379 | - * problem, so join_rel_level[] can't be in use already. | |
380 | - */ | |
381 | - Assert(root->join_rel_level == NULL); | |
382 | - | |
383 | - /* | |
384 | - * We employ a simple "dynamic programming" algorithm: we first find all | |
385 | - * ways to build joins of two jointree items, then all ways to build joins | |
386 | - * of three items (from two-item joins and single items), then four-item | |
387 | - * joins, and so on until we have considered all ways to join all the | |
388 | - * items into one rel. | |
389 | - * | |
390 | - * root->join_rel_level[j] is a list of all the j-item rels. Initially we | |
391 | - * set root->join_rel_level[1] to represent all the single-jointree-item | |
392 | - * relations. | |
393 | - */ | |
394 | - root->join_rel_level = (List **) palloc0((levels_needed + 1) * sizeof(List *)); | |
395 | - | |
396 | - root->join_rel_level[1] = initial_rels; | |
397 | - | |
398 | - for (lev = 2; lev <= levels_needed; lev++) | |
399 | - { | |
400 | - ListCell *lc; | |
401 | - | |
402 | - /* | |
403 | - * Determine all possible pairs of relations to be joined at this | |
404 | - * level, and build paths for making each one from every available | |
405 | - * pair of lower-level relations. | |
406 | - */ | |
407 | - join_search_one_level(root, lev); | |
408 | - | |
409 | - /* | |
410 | - * Do cleanup work on each just-processed rel. | |
411 | - */ | |
412 | - foreach(lc, root->join_rel_level[lev]) | |
413 | - { | |
414 | - rel = (RelOptInfo *) lfirst(lc); | |
415 | - | |
416 | - /* Find and save the cheapest paths for this rel */ | |
417 | - set_cheapest(rel); | |
418 | - | |
419 | -#ifdef OPTIMIZER_DEBUG | |
420 | - debug_print_rel(root, rel); | |
421 | -#endif | |
422 | - } | |
423 | - } | |
424 | - | |
425 | - /* | |
426 | - * We should have a single rel at the final level. | |
427 | - */ | |
428 | - if (root->join_rel_level[levels_needed] == NIL) | |
429 | - elog(ERROR, "failed to build any %d-way joins", levels_needed); | |
430 | - Assert(list_length(root->join_rel_level[levels_needed]) == 1); | |
431 | - | |
432 | - rel = (RelOptInfo *) linitial(root->join_rel_level[levels_needed]); | |
433 | - | |
434 | - root->join_rel_level = NULL; | |
435 | - | |
436 | - return rel; | |
437 | -} | |
438 | - | |
439 | -/* | |
440 | - * join_search_one_level | |
441 | - * Consider ways to produce join relations containing exactly 'level' | |
442 | - * jointree items. (This is one step of the dynamic-programming method | |
443 | - * embodied in standard_join_search.) Join rel nodes for each feasible | |
444 | - * combination of lower-level rels are created and returned in a list. | |
445 | - * Implementation paths are created for each such joinrel, too. | |
446 | - * | |
447 | - * level: level of rels we want to make this time | |
448 | - * root->join_rel_level[j], 1 <= j < level, is a list of rels containing j items | |
449 | - * | |
450 | - * The result is returned in root->join_rel_level[level]. | |
451 | - */ | |
452 | -void | |
453 | -join_search_one_level(PlannerInfo *root, int level) | |
454 | -{ | |
455 | - List **joinrels = root->join_rel_level; | |
456 | - ListCell *r; | |
457 | - int k; | |
458 | - | |
459 | - Assert(joinrels[level] == NIL); | |
460 | - | |
461 | - /* Set join_cur_level so that new joinrels are added to proper list */ | |
462 | - root->join_cur_level = level; | |
463 | - | |
464 | - /* | |
465 | - * First, consider left-sided and right-sided plans, in which rels of | |
466 | - * exactly level-1 member relations are joined against initial relations. | |
467 | - * We prefer to join using join clauses, but if we find a rel of level-1 | |
468 | - * members that has no join clauses, we will generate Cartesian-product | |
469 | - * joins against all initial rels not already contained in it. | |
470 | - */ | |
471 | - foreach(r, joinrels[level - 1]) | |
472 | - { | |
473 | - RelOptInfo *old_rel = (RelOptInfo *) lfirst(r); | |
474 | - | |
475 | - if (old_rel->joininfo != NIL || old_rel->has_eclass_joins || | |
476 | - has_join_restriction(root, old_rel)) | |
477 | - { | |
478 | - /* | |
479 | - * There are join clauses or join order restrictions relevant to | |
480 | - * this rel, so consider joins between this rel and (only) those | |
481 | - * initial rels it is linked to by a clause or restriction. | |
482 | - * | |
483 | - * At level 2 this condition is symmetric, so there is no need to | |
484 | - * look at initial rels before this one in the list; we already | |
485 | - * considered such joins when we were at the earlier rel. (The | |
486 | - * mirror-image joins are handled automatically by make_join_rel.) | |
487 | - * In later passes (level > 2), we join rels of the previous level | |
488 | - * to each initial rel they don't already include but have a join | |
489 | - * clause or restriction with. | |
490 | - */ | |
491 | - ListCell *other_rels; | |
492 | - | |
493 | - if (level == 2) /* consider remaining initial rels */ | |
494 | - other_rels = lnext(r); | |
495 | - else /* consider all initial rels */ | |
496 | - other_rels = list_head(joinrels[1]); | |
497 | - | |
498 | - make_rels_by_clause_joins(root, | |
499 | - old_rel, | |
500 | - other_rels); | |
501 | - } | |
502 | - else | |
503 | - { | |
504 | - /* | |
505 | - * Oops, we have a relation that is not joined to any other | |
506 | - * relation, either directly or by join-order restrictions. | |
507 | - * Cartesian product time. | |
508 | - * | |
509 | - * We consider a cartesian product with each not-already-included | |
510 | - * initial rel, whether it has other join clauses or not. At | |
511 | - * level 2, if there are two or more clauseless initial rels, we | |
512 | - * will redundantly consider joining them in both directions; but | |
513 | - * such cases aren't common enough to justify adding complexity to | |
514 | - * avoid the duplicated effort. | |
515 | - */ | |
516 | - make_rels_by_clauseless_joins(root, | |
517 | - old_rel, | |
518 | - list_head(joinrels[1])); | |
519 | - } | |
520 | - } | |
521 | - | |
522 | - /* | |
523 | - * Now, consider "bushy plans" in which relations of k initial rels are | |
524 | - * joined to relations of level-k initial rels, for 2 <= k <= level-2. | |
525 | - * | |
526 | - * We only consider bushy-plan joins for pairs of rels where there is a | |
527 | - * suitable join clause (or join order restriction), in order to avoid | |
528 | - * unreasonable growth of planning time. | |
529 | - */ | |
530 | - for (k = 2;; k++) | |
531 | - { | |
532 | - int other_level = level - k; | |
533 | - | |
534 | - /* | |
535 | - * Since make_join_rel(x, y) handles both x,y and y,x cases, we only | |
536 | - * need to go as far as the halfway point. | |
537 | - */ | |
538 | - if (k > other_level) | |
539 | - break; | |
540 | - | |
541 | - foreach(r, joinrels[k]) | |
542 | - { | |
543 | - RelOptInfo *old_rel = (RelOptInfo *) lfirst(r); | |
544 | - ListCell *other_rels; | |
545 | - ListCell *r2; | |
546 | - | |
547 | - /* | |
548 | - * We can ignore relations without join clauses here, unless they | |
549 | - * participate in join-order restrictions --- then we might have | |
550 | - * to force a bushy join plan. | |
551 | - */ | |
552 | - if (old_rel->joininfo == NIL && !old_rel->has_eclass_joins && | |
553 | - !has_join_restriction(root, old_rel)) | |
554 | - continue; | |
555 | - | |
556 | - if (k == other_level) | |
557 | - other_rels = lnext(r); /* only consider remaining rels */ | |
558 | - else | |
559 | - other_rels = list_head(joinrels[other_level]); | |
560 | - | |
561 | - for_each_cell(r2, other_rels) | |
562 | - { | |
563 | - RelOptInfo *new_rel = (RelOptInfo *) lfirst(r2); | |
564 | - | |
565 | - if (!bms_overlap(old_rel->relids, new_rel->relids)) | |
566 | - { | |
567 | - /* | |
568 | - * OK, we can build a rel of the right level from this | |
569 | - * pair of rels. Do so if there is at least one relevant | |
570 | - * join clause or join order restriction. | |
571 | - */ | |
572 | - if (have_relevant_joinclause(root, old_rel, new_rel) || | |
573 | - have_join_order_restriction(root, old_rel, new_rel)) | |
574 | - { | |
575 | - (void) make_join_rel(root, old_rel, new_rel); | |
576 | - } | |
577 | - } | |
578 | - } | |
579 | - } | |
580 | - } | |
581 | - | |
582 | - /*---------- | |
583 | - * Last-ditch effort: if we failed to find any usable joins so far, force | |
584 | - * a set of cartesian-product joins to be generated. This handles the | |
585 | - * special case where all the available rels have join clauses but we | |
586 | - * cannot use any of those clauses yet. This can only happen when we are | |
587 | - * considering a join sub-problem (a sub-joinlist) and all the rels in the | |
588 | - * sub-problem have only join clauses with rels outside the sub-problem. | |
589 | - * An example is | |
590 | - * | |
591 | - * SELECT ... FROM a INNER JOIN b ON TRUE, c, d, ... | |
592 | - * WHERE a.w = c.x and b.y = d.z; | |
593 | - * | |
594 | - * If the "a INNER JOIN b" sub-problem does not get flattened into the | |
595 | - * upper level, we must be willing to make a cartesian join of a and b; | |
596 | - * but the code above will not have done so, because it thought that both | |
597 | - * a and b have joinclauses. We consider only left-sided and right-sided | |
598 | - * cartesian joins in this case (no bushy). | |
599 | - *---------- | |
600 | - */ | |
601 | - if (joinrels[level] == NIL) | |
602 | - { | |
603 | - /* | |
604 | - * This loop is just like the first one, except we always call | |
605 | - * make_rels_by_clauseless_joins(). | |
606 | - */ | |
607 | - foreach(r, joinrels[level - 1]) | |
608 | - { | |
609 | - RelOptInfo *old_rel = (RelOptInfo *) lfirst(r); | |
610 | - | |
611 | - make_rels_by_clauseless_joins(root, | |
612 | - old_rel, | |
613 | - list_head(joinrels[1])); | |
614 | - } | |
615 | - | |
616 | - /*---------- | |
617 | - * When special joins are involved, there may be no legal way | |
618 | - * to make an N-way join for some values of N. For example consider | |
619 | - * | |
620 | - * SELECT ... FROM t1 WHERE | |
621 | - * x IN (SELECT ... FROM t2,t3 WHERE ...) AND | |
622 | - * y IN (SELECT ... FROM t4,t5 WHERE ...) | |
623 | - * | |
624 | - * We will flatten this query to a 5-way join problem, but there are | |
625 | - * no 4-way joins that join_is_legal() will consider legal. We have | |
626 | - * to accept failure at level 4 and go on to discover a workable | |
627 | - * bushy plan at level 5. | |
628 | - * | |
629 | - * However, if there are no special joins then join_is_legal() should | |
630 | - * never fail, and so the following sanity check is useful. | |
631 | - *---------- | |
632 | - */ | |
633 | - if (joinrels[level] == NIL && root->join_info_list == NIL) | |
634 | - elog(ERROR, "failed to build any %d-way joins", level); | |
635 | - } | |
636 | -} | |
637 | - | |
638 | -/* | |
639 | - * make_rels_by_clause_joins | |
640 | - * Build joins between the given relation 'old_rel' and other relations | |
641 | - * that participate in join clauses that 'old_rel' also participates in | |
642 | - * (or participate in join-order restrictions with it). | |
643 | - * The join rels are returned in root->join_rel_level[join_cur_level]. | |
644 | - * | |
645 | - * Note: at levels above 2 we will generate the same joined relation in | |
646 | - * multiple ways --- for example (a join b) join c is the same RelOptInfo as | |
647 | - * (b join c) join a, though the second case will add a different set of Paths | |
648 | - * to it. This is the reason for using the join_rel_level mechanism, which | |
649 | - * automatically ensures that each new joinrel is only added to the list once. | |
650 | - * | |
651 | - * 'old_rel' is the relation entry for the relation to be joined | |
652 | - * 'other_rels': the first cell in a linked list containing the other | |
653 | - * rels to be considered for joining | |
654 | - * | |
655 | - * Currently, this is only used with initial rels in other_rels, but it | |
656 | - * will work for joining to joinrels too. | |
657 | - */ | |
658 | -static void | |
659 | -make_rels_by_clause_joins(PlannerInfo *root, | |
660 | - RelOptInfo *old_rel, | |
661 | - ListCell *other_rels) | |
662 | -{ | |
663 | - ListCell *l; | |
664 | - | |
665 | - for_each_cell(l, other_rels) | |
666 | - { | |
667 | - RelOptInfo *other_rel = (RelOptInfo *) lfirst(l); | |
668 | - | |
669 | - if (!bms_overlap(old_rel->relids, other_rel->relids) && | |
670 | - (have_relevant_joinclause(root, old_rel, other_rel) || | |
671 | - have_join_order_restriction(root, old_rel, other_rel))) | |
672 | - { | |
673 | - (void) make_join_rel(root, old_rel, other_rel); | |
674 | - } | |
675 | - } | |
676 | -} | |
677 | - | |
678 | -/* | |
679 | - * make_rels_by_clauseless_joins | |
680 | - * Given a relation 'old_rel' and a list of other relations | |
681 | - * 'other_rels', create a join relation between 'old_rel' and each | |
682 | - * member of 'other_rels' that isn't already included in 'old_rel'. | |
683 | - * The join rels are returned in root->join_rel_level[join_cur_level]. | |
684 | - * | |
685 | - * 'old_rel' is the relation entry for the relation to be joined | |
686 | - * 'other_rels': the first cell of a linked list containing the | |
687 | - * other rels to be considered for joining | |
688 | - * | |
689 | - * Currently, this is only used with initial rels in other_rels, but it would | |
690 | - * work for joining to joinrels too. | |
691 | - */ | |
692 | -static void | |
693 | -make_rels_by_clauseless_joins(PlannerInfo *root, | |
694 | - RelOptInfo *old_rel, | |
695 | - ListCell *other_rels) | |
696 | -{ | |
697 | - ListCell *l; | |
698 | - | |
699 | - for_each_cell(l, other_rels) | |
700 | - { | |
701 | - RelOptInfo *other_rel = (RelOptInfo *) lfirst(l); | |
702 | - | |
703 | - if (!bms_overlap(other_rel->relids, old_rel->relids)) | |
704 | - { | |
705 | - (void) make_join_rel(root, old_rel, other_rel); | |
706 | - } | |
707 | - } | |
708 | -} | |
709 | - | |
710 | -/* | |
711 | - * join_is_legal | |
712 | - * Determine whether a proposed join is legal given the query's | |
713 | - * join order constraints; and if it is, determine the join type. | |
714 | - * | |
715 | - * Caller must supply not only the two rels, but the union of their relids. | |
716 | - * (We could simplify the API by computing joinrelids locally, but this | |
717 | - * would be redundant work in the normal path through make_join_rel.) | |
718 | - * | |
719 | - * On success, *sjinfo_p is set to NULL if this is to be a plain inner join, | |
720 | - * else it's set to point to the associated SpecialJoinInfo node. Also, | |
721 | - * *reversed_p is set TRUE if the given relations need to be swapped to | |
722 | - * match the SpecialJoinInfo node. | |
723 | - */ | |
724 | -static bool | |
725 | -join_is_legal(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2, | |
726 | - Relids joinrelids, | |
727 | - SpecialJoinInfo **sjinfo_p, bool *reversed_p) | |
728 | -{ | |
729 | - SpecialJoinInfo *match_sjinfo; | |
730 | - bool reversed; | |
731 | - bool unique_ified; | |
732 | - bool is_valid_inner; | |
733 | - ListCell *l; | |
734 | - | |
735 | - /* | |
736 | - * Ensure output params are set on failure return. This is just to | |
737 | - * suppress uninitialized-variable warnings from overly anal compilers. | |
738 | - */ | |
739 | - *sjinfo_p = NULL; | |
740 | - *reversed_p = false; | |
741 | - | |
742 | - /* | |
743 | - * If we have any special joins, the proposed join might be illegal; and | |
744 | - * in any case we have to determine its join type. Scan the join info | |
745 | - * list for conflicts. | |
746 | - */ | |
747 | - match_sjinfo = NULL; | |
748 | - reversed = false; | |
749 | - unique_ified = false; | |
750 | - is_valid_inner = true; | |
751 | - | |
752 | - foreach(l, root->join_info_list) | |
753 | - { | |
754 | - SpecialJoinInfo *sjinfo = (SpecialJoinInfo *) lfirst(l); | |
755 | - | |
756 | - /* | |
757 | - * This special join is not relevant unless its RHS overlaps the | |
758 | - * proposed join. (Check this first as a fast path for dismissing | |
759 | - * most irrelevant SJs quickly.) | |
760 | - */ | |
761 | - if (!bms_overlap(sjinfo->min_righthand, joinrelids)) | |
762 | - continue; | |
763 | - | |
764 | - /* | |
765 | - * Also, not relevant if proposed join is fully contained within RHS | |
766 | - * (ie, we're still building up the RHS). | |
767 | - */ | |
768 | - if (bms_is_subset(joinrelids, sjinfo->min_righthand)) | |
769 | - continue; | |
770 | - | |
771 | - /* | |
772 | - * Also, not relevant if SJ is already done within either input. | |
773 | - */ | |
774 | - if (bms_is_subset(sjinfo->min_lefthand, rel1->relids) && | |
775 | - bms_is_subset(sjinfo->min_righthand, rel1->relids)) | |
776 | - continue; | |
777 | - if (bms_is_subset(sjinfo->min_lefthand, rel2->relids) && | |
778 | - bms_is_subset(sjinfo->min_righthand, rel2->relids)) | |
779 | - continue; | |
780 | - | |
781 | - /* | |
782 | - * If it's a semijoin and we already joined the RHS to any other rels | |
783 | - * within either input, then we must have unique-ified the RHS at that | |
784 | - * point (see below). Therefore the semijoin is no longer relevant in | |
785 | - * this join path. | |
786 | - */ | |
787 | - if (sjinfo->jointype == JOIN_SEMI) | |
788 | - { | |
789 | - if (bms_is_subset(sjinfo->syn_righthand, rel1->relids) && | |
790 | - !bms_equal(sjinfo->syn_righthand, rel1->relids)) | |
791 | - continue; | |
792 | - if (bms_is_subset(sjinfo->syn_righthand, rel2->relids) && | |
793 | - !bms_equal(sjinfo->syn_righthand, rel2->relids)) | |
794 | - continue; | |
795 | - } | |
796 | - | |
797 | - /* | |
798 | - * If one input contains min_lefthand and the other contains | |
799 | - * min_righthand, then we can perform the SJ at this join. | |
800 | - * | |
801 | - * Barf if we get matches to more than one SJ (is that possible?) | |
802 | - */ | |
803 | - if (bms_is_subset(sjinfo->min_lefthand, rel1->relids) && | |
804 | - bms_is_subset(sjinfo->min_righthand, rel2->relids)) | |
805 | - { | |
806 | - if (match_sjinfo) | |
807 | - return false; /* invalid join path */ | |
808 | - match_sjinfo = sjinfo; | |
809 | - reversed = false; | |
810 | - } | |
811 | - else if (bms_is_subset(sjinfo->min_lefthand, rel2->relids) && | |
812 | - bms_is_subset(sjinfo->min_righthand, rel1->relids)) | |
813 | - { | |
814 | - if (match_sjinfo) | |
815 | - return false; /* invalid join path */ | |
816 | - match_sjinfo = sjinfo; | |
817 | - reversed = true; | |
818 | - } | |
819 | - else if (sjinfo->jointype == JOIN_SEMI && | |
820 | - bms_equal(sjinfo->syn_righthand, rel2->relids) && | |
821 | - create_unique_path(root, rel2, rel2->cheapest_total_path, | |
822 | - sjinfo) != NULL) | |
823 | - { | |
824 | - /*---------- | |
825 | - * For a semijoin, we can join the RHS to anything else by | |
826 | - * unique-ifying the RHS (if the RHS can be unique-ified). | |
827 | - * We will only get here if we have the full RHS but less | |
828 | - * than min_lefthand on the LHS. | |
829 | - * | |
830 | - * The reason to consider such a join path is exemplified by | |
831 | - * SELECT ... FROM a,b WHERE (a.x,b.y) IN (SELECT c1,c2 FROM c) | |
832 | - * If we insist on doing this as a semijoin we will first have | |
833 | - * to form the cartesian product of A*B. But if we unique-ify | |
834 | - * C then the semijoin becomes a plain innerjoin and we can join | |
835 | - * in any order, eg C to A and then to B. When C is much smaller | |
836 | - * than A and B this can be a huge win. So we allow C to be | |
837 | - * joined to just A or just B here, and then make_join_rel has | |
838 | - * to handle the case properly. | |
839 | - * | |
840 | - * Note that actually we'll allow unique-ified C to be joined to | |
841 | - * some other relation D here, too. That is legal, if usually not | |
842 | - * very sane, and this routine is only concerned with legality not | |
843 | - * with whether the join is good strategy. | |
844 | - *---------- | |
845 | - */ | |
846 | - if (match_sjinfo) | |
847 | - return false; /* invalid join path */ | |
848 | - match_sjinfo = sjinfo; | |
849 | - reversed = false; | |
850 | - unique_ified = true; | |
851 | - } | |
852 | - else if (sjinfo->jointype == JOIN_SEMI && | |
853 | - bms_equal(sjinfo->syn_righthand, rel1->relids) && | |
854 | - create_unique_path(root, rel1, rel1->cheapest_total_path, | |
855 | - sjinfo) != NULL) | |
856 | - { | |
857 | - /* Reversed semijoin case */ | |
858 | - if (match_sjinfo) | |
859 | - return false; /* invalid join path */ | |
860 | - match_sjinfo = sjinfo; | |
861 | - reversed = true; | |
862 | - unique_ified = true; | |
863 | - } | |
864 | - else | |
865 | - { | |
866 | - /*---------- | |
867 | - * Otherwise, the proposed join overlaps the RHS but isn't | |
868 | - * a valid implementation of this SJ. It might still be | |
869 | - * a legal join, however. If both inputs overlap the RHS, | |
870 | - * assume that it's OK. Since the inputs presumably got past | |
871 | - * this function's checks previously, they can't overlap the | |
872 | - * LHS and their violations of the RHS boundary must represent | |
873 | - * SJs that have been determined to commute with this one. | |
874 | - * We have to allow this to work correctly in cases like | |
875 | - * (a LEFT JOIN (b JOIN (c LEFT JOIN d))) | |
876 | - * when the c/d join has been determined to commute with the join | |
877 | - * to a, and hence d is not part of min_righthand for the upper | |
878 | - * join. It should be legal to join b to c/d but this will appear | |
879 | - * as a violation of the upper join's RHS. | |
880 | - * Furthermore, if one input overlaps the RHS and the other does | |
881 | - * not, we should still allow the join if it is a valid | |
882 | - * implementation of some other SJ. We have to allow this to | |
883 | - * support the associative identity | |
884 | - * (a LJ b on Pab) LJ c ON Pbc = a LJ (b LJ c ON Pbc) on Pab | |
885 | - * since joining B directly to C violates the lower SJ's RHS. | |
886 | - * We assume that make_outerjoininfo() set things up correctly | |
887 | - * so that we'll only match to some SJ if the join is valid. | |
888 | - * Set flag here to check at bottom of loop. | |
889 | - *---------- | |
890 | - */ | |
891 | - if (sjinfo->jointype != JOIN_SEMI && | |
892 | - bms_overlap(rel1->relids, sjinfo->min_righthand) && | |
893 | - bms_overlap(rel2->relids, sjinfo->min_righthand)) | |
894 | - { | |
895 | - /* seems OK */ | |
896 | - Assert(!bms_overlap(joinrelids, sjinfo->min_lefthand)); | |
897 | - } | |
898 | - else | |
899 | - is_valid_inner = false; | |
900 | - } | |
901 | - } | |
902 | - | |
903 | - /* | |
904 | - * Fail if violated some SJ's RHS and didn't match to another SJ. However, | |
905 | - * "matching" to a semijoin we are implementing by unique-ification | |
906 | - * doesn't count (think: it's really an inner join). | |
907 | - */ | |
908 | - if (!is_valid_inner && | |
909 | - (match_sjinfo == NULL || unique_ified)) | |
910 | - return false; /* invalid join path */ | |
911 | - | |
912 | - /* Otherwise, it's a valid join */ | |
913 | - *sjinfo_p = match_sjinfo; | |
914 | - *reversed_p = reversed; | |
915 | - return true; | |
916 | -} | |
917 | - | |
918 | -/* | |
919 | - * has_join_restriction | |
920 | - * Detect whether the specified relation has join-order restrictions | |
921 | - * due to being inside an outer join or an IN (sub-SELECT). | |
922 | - * | |
923 | - * Essentially, this tests whether have_join_order_restriction() could | |
924 | - * succeed with this rel and some other one. It's OK if we sometimes | |
925 | - * say "true" incorrectly. (Therefore, we don't bother with the relatively | |
926 | - * expensive has_legal_joinclause test.) | |
927 | - */ | |
928 | -static bool | |
929 | -has_join_restriction(PlannerInfo *root, RelOptInfo *rel) | |
930 | -{ | |
931 | - ListCell *l; | |
932 | - | |
933 | - foreach(l, root->join_info_list) | |
934 | - { | |
935 | - SpecialJoinInfo *sjinfo = (SpecialJoinInfo *) lfirst(l); | |
936 | - | |
937 | - /* ignore full joins --- other mechanisms preserve their ordering */ | |
938 | - if (sjinfo->jointype == JOIN_FULL) | |
939 | - continue; | |
940 | - | |
941 | - /* ignore if SJ is already contained in rel */ | |
942 | - if (bms_is_subset(sjinfo->min_lefthand, rel->relids) && | |
943 | - bms_is_subset(sjinfo->min_righthand, rel->relids)) | |
944 | - continue; | |
945 | - | |
946 | - /* restricted if it overlaps LHS or RHS, but doesn't contain SJ */ | |
947 | - if (bms_overlap(sjinfo->min_lefthand, rel->relids) || | |
948 | - bms_overlap(sjinfo->min_righthand, rel->relids)) | |
949 | - return true; | |
950 | - } | |
951 | - | |
952 | - return false; | |
953 | -} | |
954 | - | |
955 | -/* | |
956 | - * is_dummy_rel --- has relation been proven empty? | |
957 | - */ | |
958 | -static bool | |
959 | -is_dummy_rel(RelOptInfo *rel) | |
960 | -{ | |
961 | - return IS_DUMMY_REL(rel); | |
962 | -} | |
963 | - | |
964 | -/* | |
965 | - * Mark a relation as proven empty. | |
966 | - * | |
967 | - * During GEQO planning, this can get invoked more than once on the same | |
968 | - * baserel struct, so it's worth checking to see if the rel is already marked | |
969 | - * dummy. | |
970 | - * | |
971 | - * Also, when called during GEQO join planning, we are in a short-lived | |
972 | - * memory context. We must make sure that the dummy path attached to a | |
973 | - * baserel survives the GEQO cycle, else the baserel is trashed for future | |
974 | - * GEQO cycles. On the other hand, when we are marking a joinrel during GEQO, | |
975 | - * we don't want the dummy path to clutter the main planning context. Upshot | |
976 | - * is that the best solution is to explicitly make the dummy path in the same | |
977 | - * context the given RelOptInfo is in. | |
978 | - */ | |
979 | -static void | |
980 | -mark_dummy_rel(RelOptInfo *rel) | |
981 | -{ | |
982 | - MemoryContext oldcontext; | |
983 | - | |
984 | - /* Already marked? */ | |
985 | - if (is_dummy_rel(rel)) | |
986 | - return; | |
987 | - | |
988 | - /* No, so choose correct context to make the dummy path in */ | |
989 | - oldcontext = MemoryContextSwitchTo(GetMemoryChunkContext(rel)); | |
990 | - | |
991 | - /* Set dummy size estimate */ | |
992 | - rel->rows = 0; | |
993 | - | |
994 | - /* Evict any previously chosen paths */ | |
995 | - rel->pathlist = NIL; | |
996 | - | |
997 | - /* Set up the dummy path */ | |
998 | - add_path(rel, (Path *) create_append_path(rel, NIL, NULL)); | |
999 | - | |
1000 | - /* Set or update cheapest_total_path and related fields */ | |
1001 | - set_cheapest(rel); | |
1002 | - | |
1003 | - MemoryContextSwitchTo(oldcontext); | |
1004 | -} | |
1005 | - | |
1006 | -/* | |
1007 | - * restriction_is_constant_false --- is a restrictlist just FALSE? | |
1008 | - * | |
1009 | - * In cases where a qual is provably constant FALSE, eval_const_expressions | |
1010 | - * will generally have thrown away anything that's ANDed with it. In outer | |
1011 | - * join situations this will leave us computing cartesian products only to | |
1012 | - * decide there's no match for an outer row, which is pretty stupid. So, | |
1013 | - * we need to detect the case. | |
1014 | - * | |
1015 | - * If only_pushed_down is TRUE, then consider only pushed-down quals. | |
1016 | - */ | |
1017 | -static bool | |
1018 | -restriction_is_constant_false(List *restrictlist, bool only_pushed_down) | |
1019 | -{ | |
1020 | - ListCell *lc; | |
1021 | - | |
1022 | - /* | |
1023 | - * Despite the above comment, the restriction list we see here might | |
1024 | - * possibly have other members besides the FALSE constant, since other | |
1025 | - * quals could get "pushed down" to the outer join level. So we check | |
1026 | - * each member of the list. | |
1027 | - */ | |
1028 | - foreach(lc, restrictlist) | |
1029 | - { | |
1030 | - RestrictInfo *rinfo = (RestrictInfo *) lfirst(lc); | |
1031 | - | |
1032 | - Assert(IsA(rinfo, RestrictInfo)); | |
1033 | - if (only_pushed_down && !rinfo->is_pushed_down) | |
1034 | - continue; | |
1035 | - | |
1036 | - if (rinfo->clause && IsA(rinfo->clause, Const)) | |
1037 | - { | |
1038 | - Const *con = (Const *) rinfo->clause; | |
1039 | - | |
1040 | - /* constant NULL is as good as constant FALSE for our purposes */ | |
1041 | - if (con->constisnull) | |
1042 | - return true; | |
1043 | - if (!DatumGetBool(con->constvalue)) | |
1044 | - return true; | |
1045 | - } | |
1046 | - } | |
1047 | - return false; | |
1048 | -} |
@@ -1,77 +0,0 @@ | ||
1 | -SET search_path TO public; | |
2 | --- query type 1 | |
3 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
4 | - QUERY PLAN | |
5 | --------------------------------------- | |
6 | - Merge Join | |
7 | - Merge Cond: (t1.id = t2.id) | |
8 | - -> Index Scan using t1_pkey on t1 | |
9 | - -> Index Scan using t2_pkey on t2 | |
10 | -(4 rows) | |
11 | - | |
12 | --- query type 2 | |
13 | -EXPLAIN (COSTS false) SELECT * FROM t1, t4 WHERE t1.val < 10; | |
14 | - QUERY PLAN | |
15 | ------------------------------------------ | |
16 | - Nested Loop | |
17 | - -> Bitmap Heap Scan on t1 | |
18 | - Recheck Cond: (val < 10) | |
19 | - -> Bitmap Index Scan on t1_val | |
20 | - Index Cond: (val < 10) | |
21 | - -> Materialize | |
22 | - -> Seq Scan on t4 | |
23 | -(7 rows) | |
24 | - | |
25 | --- query type 3 | |
26 | -EXPLAIN (COSTS false) SELECT * FROM t3, t4 WHERE t3.id = t4.id AND t4.ctid = '(1,1)'; | |
27 | - QUERY PLAN | |
28 | ---------------------------------------------- | |
29 | - Merge Join | |
30 | - Merge Cond: (t3.id = t4.id) | |
31 | - -> Index Scan using t3_pkey on t3 | |
32 | - -> Sort | |
33 | - Sort Key: t4.id | |
34 | - -> Seq Scan on t4 | |
35 | - Filter: (ctid = '(1,1)'::tid) | |
36 | -(7 rows) | |
37 | - | |
38 | --- query type 4 | |
39 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)'; | |
40 | - QUERY PLAN | |
41 | ------------------------------------------ | |
42 | - Nested Loop | |
43 | - -> Tid Scan on t1 | |
44 | - TID Cond: (ctid = '(1,1)'::tid) | |
45 | - -> Index Scan using t2_pkey on t2 | |
46 | - Index Cond: (id = t1.id) | |
47 | -(5 rows) | |
48 | - | |
49 | --- query type 5 | |
50 | -EXPLAIN (COSTS false) SELECT * FROM t1, t3 WHERE t1.val = t3.val; | |
51 | - QUERY PLAN | |
52 | --------------------------------- | |
53 | - Hash Join | |
54 | - Hash Cond: (t1.val = t3.val) | |
55 | - -> Seq Scan on t1 | |
56 | - -> Hash | |
57 | - -> Seq Scan on t3 | |
58 | -(5 rows) | |
59 | - | |
60 | --- query type 6 | |
61 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id; | |
62 | - QUERY PLAN | |
63 | --------------------------------------------------- | |
64 | - Nested Loop | |
65 | - -> Merge Join | |
66 | - Merge Cond: (t1.id = t4.id) | |
67 | - -> Merge Join | |
68 | - Merge Cond: (t1.id = t2.id) | |
69 | - -> Index Scan using t1_pkey on t1 | |
70 | - -> Index Scan using t2_pkey on t2 | |
71 | - -> Sort | |
72 | - Sort Key: t4.id | |
73 | - -> Seq Scan on t4 | |
74 | - -> Index Scan using t3_pkey on t3 | |
75 | - Index Cond: (id = t1.id) | |
76 | -(12 rows) | |
77 | - |
@@ -1,210 +0,0 @@ | ||
1 | -SET search_path TO public; | |
2 | -CREATE EXTENSION pg_hint_plan; | |
3 | -CREATE SCHEMA s0; | |
4 | -CREATE TABLE t1 (id int PRIMARY KEY, val int); | |
5 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for table "t1" | |
6 | -CREATE TABLE t2 (id int PRIMARY KEY, val int); | |
7 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t2_pkey" for table "t2" | |
8 | -CREATE TABLE t3 (id int PRIMARY KEY, val int); | |
9 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t3_pkey" for table "t3" | |
10 | -CREATE TABLE t4 (id int PRIMARY KEY, val int); | |
11 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t4_pkey" for table "t4" | |
12 | -CREATE TABLE t5 (id int PRIMARY KEY, val int); | |
13 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t5_pkey" for table "t5" | |
14 | -CREATE TABLE p1 (id int PRIMARY KEY, val int); | |
15 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_pkey" for table "p1" | |
16 | -CREATE TABLE p1_c1 (LIKE p1 INCLUDING ALL, CHECK (id <= 100)) INHERITS(p1); | |
17 | -NOTICE: merging column "id" with inherited definition | |
18 | -NOTICE: merging column "val" with inherited definition | |
19 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_c1_pkey" for table "p1_c1" | |
20 | -CREATE TABLE p1_c2 (LIKE p1 INCLUDING ALL, CHECK (id > 100 AND id <= 200)) INHERITS(p1); | |
21 | -NOTICE: merging column "id" with inherited definition | |
22 | -NOTICE: merging column "val" with inherited definition | |
23 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_c2_pkey" for table "p1_c2" | |
24 | -CREATE TABLE p1_c3 (LIKE p1 INCLUDING ALL, CHECK (id > 200 AND id <= 300)) INHERITS(p1); | |
25 | -NOTICE: merging column "id" with inherited definition | |
26 | -NOTICE: merging column "val" with inherited definition | |
27 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_c3_pkey" for table "p1_c3" | |
28 | -CREATE TABLE p1_c4 (LIKE p1 INCLUDING ALL, CHECK (id > 300)) INHERITS(p1); | |
29 | -NOTICE: merging column "id" with inherited definition | |
30 | -NOTICE: merging column "val" with inherited definition | |
31 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_c4_pkey" for table "p1_c4" | |
32 | -CREATE TABLE p1_c1_c1 (LIKE p1 INCLUDING ALL, CHECK (id <= 50)) INHERITS(p1_c1); | |
33 | -NOTICE: merging column "id" with inherited definition | |
34 | -NOTICE: merging column "val" with inherited definition | |
35 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_c1_c1_pkey" for table "p1_c1_c1" | |
36 | -CREATE TABLE p1_c1_c2 (LIKE p1 INCLUDING ALL, CHECK (id > 50 AND id <= 100)) INHERITS(p1_c1); | |
37 | -NOTICE: merging column "id" with inherited definition | |
38 | -NOTICE: merging column "val" with inherited definition | |
39 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_c1_c2_pkey" for table "p1_c1_c2" | |
40 | -CREATE TABLE p1_c3_c1 (LIKE p1 INCLUDING ALL, CHECK (id > 200 AND id <= 250)) INHERITS(p1_c3); | |
41 | -NOTICE: merging column "id" with inherited definition | |
42 | -NOTICE: merging column "val" with inherited definition | |
43 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_c3_c1_pkey" for table "p1_c3_c1" | |
44 | -CREATE TABLE p1_c3_c2 (LIKE p1 INCLUDING ALL, CHECK (id > 250 AND id <= 300)) INHERITS(p1_c3); | |
45 | -NOTICE: merging column "id" with inherited definition | |
46 | -NOTICE: merging column "val" with inherited definition | |
47 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_c3_c2_pkey" for table "p1_c3_c2" | |
48 | -CREATE TABLE p2 (id int PRIMARY KEY, val text); | |
49 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_pkey" for table "p2" | |
50 | -CREATE INDEX p2_id_val_idx ON p2 (id, val); | |
51 | -CREATE UNIQUE INDEX p2_val_idx ON p2 (val); | |
52 | -CREATE INDEX p2_ununi_id_val_idx ON p2 (val); | |
53 | -CREATE INDEX p2_val_idx_1 ON p2 USING hash (val); | |
54 | -CREATE INDEX p2_val_id_idx ON p2 (val, id); | |
55 | -CREATE INDEX p2_val_idx2 ON p2 (val COLLATE "ja_JP"); | |
56 | -CREATE INDEX p2_val_idx3 ON p2 (val varchar_ops); | |
57 | -CREATE INDEX p2_val_idx4 ON p2 (val DESC NULLS LAST); | |
58 | -CREATE INDEX p2_val_idx5 ON p2 (val NULLS FIRST); | |
59 | -CREATE INDEX p2_expr ON p2 ((val < '120')); | |
60 | -CREATE INDEX p2_expr2 ON p2 ((id * 2 < 120)); | |
61 | -CREATE INDEX p2_val_idx6 ON p2 (val) WHERE val >= '50' AND val < '51'; | |
62 | -CREATE INDEX p2_val_idx7 ON p2 (val) WHERE id < 120; | |
63 | -CREATE TABLE p2_c1 (LIKE p2 INCLUDING ALL, CHECK (id <= 100)) INHERITS(p2); | |
64 | -NOTICE: merging column "id" with inherited definition | |
65 | -NOTICE: merging column "val" with inherited definition | |
66 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_c1_pkey" for table "p2_c1" | |
67 | -CREATE TABLE p2_c2 (LIKE p2 INCLUDING ALL, CHECK (id > 100 AND id <= 200)) INHERITS(p2); | |
68 | -NOTICE: merging column "id" with inherited definition | |
69 | -NOTICE: merging column "val" with inherited definition | |
70 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_c2_pkey" for table "p2_c2" | |
71 | -CREATE TABLE p2_c3 (LIKE p2 INCLUDING ALL, CHECK (id > 200 AND id <= 300)) INHERITS(p2); | |
72 | -NOTICE: merging column "id" with inherited definition | |
73 | -NOTICE: merging column "val" with inherited definition | |
74 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_c3_pkey" for table "p2_c3" | |
75 | -CREATE TABLE p2_c4 (LIKE p2 INCLUDING ALL, CHECK (id > 300)) INHERITS(p2); | |
76 | -NOTICE: merging column "id" with inherited definition | |
77 | -NOTICE: merging column "val" with inherited definition | |
78 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_c4_pkey" for table "p2_c4" | |
79 | -CREATE TABLE p2_c1_c1 (LIKE p2 INCLUDING ALL, CHECK (id <= 50)) INHERITS(p2_c1); | |
80 | -NOTICE: merging column "id" with inherited definition | |
81 | -NOTICE: merging column "val" with inherited definition | |
82 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_c1_c1_pkey" for table "p2_c1_c1" | |
83 | -CREATE TABLE p2_c1_c2 (LIKE p2 INCLUDING ALL, CHECK (id > 50 AND id <= 100)) INHERITS(p2_c1); | |
84 | -NOTICE: merging column "id" with inherited definition | |
85 | -NOTICE: merging column "val" with inherited definition | |
86 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_c1_c2_pkey" for table "p2_c1_c2" | |
87 | -CREATE TABLE p2_c3_c1 (LIKE p2 INCLUDING ALL, CHECK (id > 200 AND id <= 250)) INHERITS(p2_c3); | |
88 | -NOTICE: merging column "id" with inherited definition | |
89 | -NOTICE: merging column "val" with inherited definition | |
90 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_c3_c1_pkey" for table "p2_c3_c1" | |
91 | -CREATE TABLE p2_c3_c2 (LIKE p2 INCLUDING ALL, CHECK (id > 250 AND id <= 300)) INHERITS(p2_c3); | |
92 | -NOTICE: merging column "id" with inherited definition | |
93 | -NOTICE: merging column "val" with inherited definition | |
94 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_c3_c2_pkey" for table "p2_c3_c2" | |
95 | -CREATE TABLE s0.t1 (id int PRIMARY KEY, val int); | |
96 | -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for table "t1" | |
97 | -INSERT INTO t1 SELECT i, i % 100 FROM (SELECT generate_series(1, 10000) i) t; | |
98 | -INSERT INTO t2 SELECT i, i % 10 FROM (SELECT generate_series(1, 1000) i) t; | |
99 | -INSERT INTO t3 SELECT i, i FROM (SELECT generate_series(1, 100) i) t; | |
100 | -INSERT INTO t4 SELECT i, i FROM (SELECT generate_series(1, 10) i) t; | |
101 | -INSERT INTO t5 SELECT i, i % 100 FROM (SELECT generate_series(1, 10000) i) t; | |
102 | -INSERT INTO p1_c1_c1 SELECT i, i % 100 FROM (SELECT generate_series(1, 50) i) t; | |
103 | -INSERT INTO p1_c1_c2 SELECT i, i % 100 FROM (SELECT generate_series(51, 100) i) t; | |
104 | -INSERT INTO p1_c2 SELECT i, i % 100 FROM (SELECT generate_series(101, 200) i) t; | |
105 | -INSERT INTO p1_c3_c1 SELECT i, i % 100 FROM (SELECT generate_series(201, 250) i) t; | |
106 | -INSERT INTO p1_c3_c2 SELECT i, i % 100 FROM (SELECT generate_series(251, 300) i) t; | |
107 | -INSERT INTO p1_c4 SELECT i, i % 100 FROM (SELECT generate_series(301, 400) i) t; | |
108 | -INSERT INTO p2_c1_c1 SELECT i, i % 100 FROM (SELECT generate_series(1, 50) i) t; | |
109 | -INSERT INTO p2_c1_c2 SELECT i, i % 100 FROM (SELECT generate_series(51, 100) i) t; | |
110 | -INSERT INTO p2_c2 SELECT i, i % 100 FROM (SELECT generate_series(101, 200) i) t; | |
111 | -INSERT INTO p2_c3_c1 SELECT i, i % 100 FROM (SELECT generate_series(201, 250) i) t; | |
112 | -INSERT INTO p2_c3_c2 SELECT i, i % 100 FROM (SELECT generate_series(251, 300) i) t; | |
113 | -INSERT INTO p2_c4 SELECT i, i % 100 FROM (SELECT generate_series(301, 400) i) t; | |
114 | -CREATE INDEX t1_val ON t1 (val); | |
115 | -CREATE INDEX t2_val ON t2 (val); | |
116 | -CREATE INDEX t5_id1 ON t5 (id); | |
117 | -CREATE INDEX t5_id2 ON t5 (id); | |
118 | -CREATE INDEX t5_id3 ON t5 (id); | |
119 | -CREATE INDEX t5_val ON t5 (val); | |
120 | -DROP INDEX p2_c4_val_id_idx; | |
121 | -CREATE INDEX p2_id2_val ON p2 (id, id, val); | |
122 | -CREATE INDEX p2_c1_id2_val ON p2_c1 (id, id, val); | |
123 | -CREATE INDEX p2_c2_id2_val ON p2_c2 (id, id, val); | |
124 | -CREATE INDEX p2_val2_id ON p2 (val, id, val); | |
125 | -CREATE INDEX t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ON t5 (id); | |
126 | -CREATE INDEX p1_val1 ON p1 (val); | |
127 | -CREATE INDEX p1_val2 ON p1 (val); | |
128 | -CREATE INDEX p1_val3 ON p1 (val); | |
129 | -CREATE INDEX p1_c1_val1 ON p1_c1 (val); | |
130 | -CREATE INDEX p1_c1_val2 ON p1_c1 (val); | |
131 | -CREATE INDEX p1_c1_val3 ON p1_c1 (val); | |
132 | -CREATE INDEX p1_c1_c1_val1 ON p1_c1_c1 (val); | |
133 | -CREATE INDEX p1_c1_c1_val2 ON p1_c1_c1 (val); | |
134 | -CREATE INDEX p1_c1_c1_val3 ON p1_c1_c1 (val); | |
135 | -CREATE INDEX p1_c1_c2_val1 ON p1_c1_c2 (val); | |
136 | -CREATE INDEX p1_c1_c2_val2 ON p1_c1_c2 (val); | |
137 | -CREATE INDEX p1_c1_c2_val3 ON p1_c1_c2 (val); | |
138 | -CREATE INDEX p1_c2_val1 ON p1_c2 (val); | |
139 | -CREATE INDEX p1_c2_val2 ON p1_c2 (val); | |
140 | -CREATE INDEX p1_c2_val3 ON p1_c2 (val); | |
141 | -CREATE INDEX p1_c3_val1 ON p1_c3 (val); | |
142 | -CREATE INDEX p1_c3_val2 ON p1_c3 (val); | |
143 | -CREATE INDEX p1_c3_val3 ON p1_c3 (val); | |
144 | -CREATE INDEX p1_c3_c1_val1 ON p1_c3_c1 (val); | |
145 | -CREATE INDEX p1_c3_c1_val2 ON p1_c3_c1 (val); | |
146 | -CREATE INDEX p1_c3_c1_val3 ON p1_c3_c1 (val); | |
147 | -CREATE INDEX p1_c3_c2_val1 ON p1_c3_c2 (val); | |
148 | -CREATE INDEX p1_c3_c2_val2 ON p1_c3_c2 (val); | |
149 | -CREATE INDEX p1_c3_c2_val3 ON p1_c3_c2 (val); | |
150 | -CREATE INDEX p1_c4_val1 ON p1_c4 (val); | |
151 | -CREATE INDEX p1_c4_val2 ON p1_c4 (val); | |
152 | -CREATE INDEX p1_c4_val3 ON p1_c4 (val); | |
153 | -ANALYZE t1; | |
154 | -ANALYZE t2; | |
155 | -ANALYZE t3; | |
156 | -ANALYZE t4; | |
157 | -ANALYZE t5; | |
158 | -ANALYZE p1; | |
159 | -ANALYZE p1_c1; | |
160 | -ANALYZE p1_c2; | |
161 | -ANALYZE p2; | |
162 | -CREATE VIEW v1 AS SELECT id, val FROM t1; | |
163 | -CREATE VIEW v2 AS SELECT t1.id t1_id, t1.val t1_val, t2.id t2_id, t2.val t2_val FROM t1, t2 WHERE t1.id = t2.id; | |
164 | -CREATE VIEW v3 AS SELECT t_1.id t1_id, t_1.val t1_val, t_2.id t2_id, t_2.val t2_val FROM t1 t_1, t2 t_2 WHERE t_1.id = t_2.id; | |
165 | -CREATE VIEW v4 AS SELECT v_2.t1_id, t_3.id FROM v2 v_2, t3 t_3 WHERE v_2.t1_id = t_3.id; | |
166 | -/* | |
167 | - * The following GUC parameters need the setting of the default value to | |
168 | - * succeed in regression test. | |
169 | - */ | |
170 | -CREATE VIEW settings AS | |
171 | -SELECT name, setting, category | |
172 | - FROM pg_settings | |
173 | - WHERE category LIKE 'Query Tuning%' | |
174 | - OR name = 'client_min_messages' | |
175 | - ORDER BY category, name; | |
176 | -SELECT * FROM settings; | |
177 | - name | setting | category | |
178 | ----------------------------+-----------+--------------------------------------------- | |
179 | - geqo | on | Query Tuning / Genetic Query Optimizer | |
180 | - geqo_effort | 5 | Query Tuning / Genetic Query Optimizer | |
181 | - geqo_generations | 0 | Query Tuning / Genetic Query Optimizer | |
182 | - geqo_pool_size | 0 | Query Tuning / Genetic Query Optimizer | |
183 | - geqo_seed | 0 | Query Tuning / Genetic Query Optimizer | |
184 | - geqo_selection_bias | 2 | Query Tuning / Genetic Query Optimizer | |
185 | - geqo_threshold | 12 | Query Tuning / Genetic Query Optimizer | |
186 | - constraint_exclusion | partition | Query Tuning / Other Planner Options | |
187 | - cursor_tuple_fraction | 0.1 | Query Tuning / Other Planner Options | |
188 | - default_statistics_target | 100 | Query Tuning / Other Planner Options | |
189 | - from_collapse_limit | 8 | Query Tuning / Other Planner Options | |
190 | - join_collapse_limit | 8 | Query Tuning / Other Planner Options | |
191 | - cpu_index_tuple_cost | 0.005 | Query Tuning / Planner Cost Constants | |
192 | - cpu_operator_cost | 0.0025 | Query Tuning / Planner Cost Constants | |
193 | - cpu_tuple_cost | 0.01 | Query Tuning / Planner Cost Constants | |
194 | - effective_cache_size | 16384 | Query Tuning / Planner Cost Constants | |
195 | - random_page_cost | 4 | Query Tuning / Planner Cost Constants | |
196 | - seq_page_cost | 1 | Query Tuning / Planner Cost Constants | |
197 | - enable_bitmapscan | on | Query Tuning / Planner Method Configuration | |
198 | - enable_hashagg | on | Query Tuning / Planner Method Configuration | |
199 | - enable_hashjoin | on | Query Tuning / Planner Method Configuration | |
200 | - enable_indexonlyscan | on | Query Tuning / Planner Method Configuration | |
201 | - enable_indexscan | on | Query Tuning / Planner Method Configuration | |
202 | - enable_material | on | Query Tuning / Planner Method Configuration | |
203 | - enable_mergejoin | on | Query Tuning / Planner Method Configuration | |
204 | - enable_nestloop | on | Query Tuning / Planner Method Configuration | |
205 | - enable_seqscan | on | Query Tuning / Planner Method Configuration | |
206 | - enable_sort | on | Query Tuning / Planner Method Configuration | |
207 | - enable_tidscan | on | Query Tuning / Planner Method Configuration | |
208 | - client_min_messages | notice | Reporting and Logging / When to Log | |
209 | -(30 rows) | |
210 | - |
@@ -4498,7 +4498,7 @@ error hint: | ||
4498 | 4498 | -> Sort |
4499 | 4499 | Sort Key: t3_5.id |
4500 | 4500 | -> Seq Scan on t3 t3_5 |
4501 | - InitPlan 2 (returns $2) | |
4501 | + InitPlan 2 (returns $3) | |
4502 | 4502 | -> Aggregate |
4503 | 4503 | -> Merge Join |
4504 | 4504 | Merge Cond: (t1_2.id = t3_2.id) |
@@ -4509,7 +4509,7 @@ error hint: | ||
4509 | 4509 | -> Sort |
4510 | 4510 | Sort Key: t3_2.id |
4511 | 4511 | -> Seq Scan on t3 t3_2 |
4512 | - InitPlan 3 (returns $3) | |
4512 | + InitPlan 3 (returns $5) | |
4513 | 4513 | -> Aggregate |
4514 | 4514 | -> Merge Join |
4515 | 4515 | Merge Cond: (t1_4.id = t3_4.id) |
@@ -4526,19 +4526,19 @@ error hint: | ||
4526 | 4526 | -> Nested Loop |
4527 | 4527 | -> Nested Loop |
4528 | 4528 | -> Index Scan using t2_pkey on t2 t2_1 |
4529 | - Index Cond: (id = $3) | |
4529 | + Index Cond: (id = $5) | |
4530 | 4530 | -> Seq Scan on t3 t3_1 |
4531 | - Filter: (id = $3) | |
4531 | + Filter: (id = $5) | |
4532 | 4532 | -> Index Scan using t1_pkey on t1 t1_1 |
4533 | - Index Cond: (id = $3) | |
4533 | + Index Cond: (id = $5) | |
4534 | 4534 | -> Index Scan using t1_pkey on t1 t1_3 |
4535 | - Index Cond: (id = $3) | |
4535 | + Index Cond: (id = $5) | |
4536 | 4536 | -> Index Scan using t2_pkey on t2 t2_3 |
4537 | - Index Cond: (id = $3) | |
4537 | + Index Cond: (id = $5) | |
4538 | 4538 | -> Seq Scan on t3 t3_3 |
4539 | - Filter: (id = $3) | |
4539 | + Filter: (id = $5) | |
4540 | 4540 | -> CTE Scan on c1_1 |
4541 | - Filter: (id = $3) | |
4541 | + Filter: (id = $5) | |
4542 | 4542 | (53 rows) |
4543 | 4543 | |
4544 | 4544 | /*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(a t1_1 t1_2 t1_4 t1_5)*/ |
@@ -4579,7 +4579,7 @@ error hint: | ||
4579 | 4579 | -> Sort |
4580 | 4580 | Sort Key: t3_5.id |
4581 | 4581 | -> Seq Scan on t3 t3_5 |
4582 | - InitPlan 2 (returns $2) | |
4582 | + InitPlan 2 (returns $3) | |
4583 | 4583 | -> Aggregate |
4584 | 4584 | -> Merge Join |
4585 | 4585 | Merge Cond: (t1_2.id = t3_2.id) |
@@ -4590,7 +4590,7 @@ error hint: | ||
4590 | 4590 | -> Sort |
4591 | 4591 | Sort Key: t3_2.id |
4592 | 4592 | -> Seq Scan on t3 t3_2 |
4593 | - InitPlan 3 (returns $3) | |
4593 | + InitPlan 3 (returns $5) | |
4594 | 4594 | -> Aggregate |
4595 | 4595 | -> Merge Join |
4596 | 4596 | Merge Cond: (t1_4.id = t3_4.id) |
@@ -4607,19 +4607,19 @@ error hint: | ||
4607 | 4607 | -> Nested Loop |
4608 | 4608 | -> Nested Loop |
4609 | 4609 | -> Index Scan using t2_pkey on t2 t2_1 |
4610 | - Index Cond: (id = $3) | |
4610 | + Index Cond: (id = $5) | |
4611 | 4611 | -> Seq Scan on t3 t3_1 |
4612 | - Filter: (id = $3) | |
4612 | + Filter: (id = $5) | |
4613 | 4613 | -> Index Scan using t1_pkey on t1 t1_1 |
4614 | - Index Cond: (id = $3) | |
4614 | + Index Cond: (id = $5) | |
4615 | 4615 | -> Index Scan using t1_pkey on t1 t1_3 |
4616 | - Index Cond: (id = $3) | |
4616 | + Index Cond: (id = $5) | |
4617 | 4617 | -> Index Scan using t2_pkey on t2 t2_3 |
4618 | - Index Cond: (id = $3) | |
4618 | + Index Cond: (id = $5) | |
4619 | 4619 | -> Seq Scan on t3 t3_3 |
4620 | - Filter: (id = $3) | |
4620 | + Filter: (id = $5) | |
4621 | 4621 | -> CTE Scan on c1_1 |
4622 | - Filter: (id = $3) | |
4622 | + Filter: (id = $5) | |
4623 | 4623 | (53 rows) |
4624 | 4624 | |
4625 | 4625 | /*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(a t3_2 t3_5 t2_2 c1_1 t3_4 t3_3 t2_3 t2_4 t1_3 t2_5 t1_2 t3_1 t1_4 t2_1 t1_5 t1_1)*/ |
@@ -4660,7 +4660,7 @@ error hint: | ||
4660 | 4660 | -> Sort |
4661 | 4661 | Sort Key: t3_5.id |
4662 | 4662 | -> Seq Scan on t3 t3_5 |
4663 | - InitPlan 2 (returns $2) | |
4663 | + InitPlan 2 (returns $3) | |
4664 | 4664 | -> Aggregate |
4665 | 4665 | -> Merge Join |
4666 | 4666 | Merge Cond: (t1_2.id = t3_2.id) |
@@ -4671,7 +4671,7 @@ error hint: | ||
4671 | 4671 | -> Sort |
4672 | 4672 | Sort Key: t3_2.id |
4673 | 4673 | -> Seq Scan on t3 t3_2 |
4674 | - InitPlan 3 (returns $3) | |
4674 | + InitPlan 3 (returns $5) | |
4675 | 4675 | -> Aggregate |
4676 | 4676 | -> Merge Join |
4677 | 4677 | Merge Cond: (t1_4.id = t3_4.id) |
@@ -4688,19 +4688,19 @@ error hint: | ||
4688 | 4688 | -> Nested Loop |
4689 | 4689 | -> Nested Loop |
4690 | 4690 | -> Index Scan using t2_pkey on t2 t2_1 |
4691 | - Index Cond: (id = $3) | |
4691 | + Index Cond: (id = $5) | |
4692 | 4692 | -> Seq Scan on t3 t3_1 |
4693 | - Filter: (id = $3) | |
4693 | + Filter: (id = $5) | |
4694 | 4694 | -> Index Scan using t1_pkey on t1 t1_1 |
4695 | - Index Cond: (id = $3) | |
4695 | + Index Cond: (id = $5) | |
4696 | 4696 | -> Index Scan using t1_pkey on t1 t1_3 |
4697 | - Index Cond: (id = $3) | |
4697 | + Index Cond: (id = $5) | |
4698 | 4698 | -> Index Scan using t2_pkey on t2 t2_3 |
4699 | - Index Cond: (id = $3) | |
4699 | + Index Cond: (id = $5) | |
4700 | 4700 | -> Seq Scan on t3 t3_3 |
4701 | - Filter: (id = $3) | |
4701 | + Filter: (id = $5) | |
4702 | 4702 | -> CTE Scan on c1_1 |
4703 | - Filter: (id = $3) | |
4703 | + Filter: (id = $5) | |
4704 | 4704 | (53 rows) |
4705 | 4705 | |
4706 | 4706 | /*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(t3_5 t2_5 t1_5)Leading(t3_2 t2_2 t1_2)Leading(t3_4 t2_4 t1_4)Leading(c1_1 t3_3 t2_3 t1_3 t3_1 t2_1 t1_1)*/ |
@@ -4893,7 +4893,7 @@ error hint: | ||
4893 | 4893 | -> Sort |
4894 | 4894 | Sort Key: t3_5.id |
4895 | 4895 | -> Seq Scan on t3 t3_5 |
4896 | - InitPlan 2 (returns $2) | |
4896 | + InitPlan 2 (returns $3) | |
4897 | 4897 | -> Aggregate |
4898 | 4898 | -> Merge Join |
4899 | 4899 | Merge Cond: (t1_2.id = t3_2.id) |
@@ -4904,7 +4904,7 @@ error hint: | ||
4904 | 4904 | -> Sort |
4905 | 4905 | Sort Key: t3_2.id |
4906 | 4906 | -> Seq Scan on t3 t3_2 |
4907 | - InitPlan 3 (returns $3) | |
4907 | + InitPlan 3 (returns $5) | |
4908 | 4908 | -> Aggregate |
4909 | 4909 | -> Merge Join |
4910 | 4910 | Merge Cond: (t1_4.id = t3_4.id) |
@@ -4919,21 +4919,21 @@ error hint: | ||
4919 | 4919 | -> Nested Loop |
4920 | 4920 | -> Nested Loop |
4921 | 4921 | -> Index Scan using t2_pkey on t2 t2_1 |
4922 | - Index Cond: (id = $3) | |
4922 | + Index Cond: (id = $5) | |
4923 | 4923 | -> Seq Scan on t3 t3_1 |
4924 | - Filter: (id = $3) | |
4924 | + Filter: (id = $5) | |
4925 | 4925 | -> Index Scan using t1_pkey on t1 t1_1 |
4926 | - Index Cond: (id = $3) | |
4926 | + Index Cond: (id = $5) | |
4927 | 4927 | -> Nested Loop |
4928 | 4928 | -> Nested Loop |
4929 | 4929 | -> Index Scan using t2_pkey on t2 t2_3 |
4930 | - Index Cond: (id = $3) | |
4930 | + Index Cond: (id = $5) | |
4931 | 4931 | -> Seq Scan on t3 t3_3 |
4932 | - Filter: (id = $3) | |
4932 | + Filter: (id = $5) | |
4933 | 4933 | -> Index Scan using t1_pkey on t1 t1_3 |
4934 | - Index Cond: (id = $3) | |
4934 | + Index Cond: (id = $5) | |
4935 | 4935 | -> CTE Scan on c1_1 |
4936 | - Filter: (id = $3) | |
4936 | + Filter: (id = $5) | |
4937 | 4937 | (53 rows) |
4938 | 4938 | |
4939 | 4939 | /*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(a t1_1 t1_2 t1_4 t1_5)*/ |
@@ -4974,7 +4974,7 @@ error hint: | ||
4974 | 4974 | -> Sort |
4975 | 4975 | Sort Key: t3_5.id |
4976 | 4976 | -> Seq Scan on t3 t3_5 |
4977 | - InitPlan 2 (returns $2) | |
4977 | + InitPlan 2 (returns $3) | |
4978 | 4978 | -> Aggregate |
4979 | 4979 | -> Merge Join |
4980 | 4980 | Merge Cond: (t1_2.id = t3_2.id) |
@@ -4985,7 +4985,7 @@ error hint: | ||
4985 | 4985 | -> Sort |
4986 | 4986 | Sort Key: t3_2.id |
4987 | 4987 | -> Seq Scan on t3 t3_2 |
4988 | - InitPlan 3 (returns $3) | |
4988 | + InitPlan 3 (returns $5) | |
4989 | 4989 | -> Aggregate |
4990 | 4990 | -> Merge Join |
4991 | 4991 | Merge Cond: (t1_4.id = t3_4.id) |
@@ -5000,21 +5000,21 @@ error hint: | ||
5000 | 5000 | -> Nested Loop |
5001 | 5001 | -> Nested Loop |
5002 | 5002 | -> Index Scan using t2_pkey on t2 t2_1 |
5003 | - Index Cond: (id = $3) | |
5003 | + Index Cond: (id = $5) | |
5004 | 5004 | -> Seq Scan on t3 t3_1 |
5005 | - Filter: (id = $3) | |
5005 | + Filter: (id = $5) | |
5006 | 5006 | -> Index Scan using t1_pkey on t1 t1_1 |
5007 | - Index Cond: (id = $3) | |
5007 | + Index Cond: (id = $5) | |
5008 | 5008 | -> Nested Loop |
5009 | 5009 | -> Nested Loop |
5010 | 5010 | -> Index Scan using t2_pkey on t2 t2_3 |
5011 | - Index Cond: (id = $3) | |
5011 | + Index Cond: (id = $5) | |
5012 | 5012 | -> Seq Scan on t3 t3_3 |
5013 | - Filter: (id = $3) | |
5013 | + Filter: (id = $5) | |
5014 | 5014 | -> Index Scan using t1_pkey on t1 t1_3 |
5015 | - Index Cond: (id = $3) | |
5015 | + Index Cond: (id = $5) | |
5016 | 5016 | -> CTE Scan on c1_1 |
5017 | - Filter: (id = $3) | |
5017 | + Filter: (id = $5) | |
5018 | 5018 | (53 rows) |
5019 | 5019 | |
5020 | 5020 | /*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(a t3_2 t3_5 t2_2 c1_1 t3_4 t3_3 t2_3 t2_4 t1_3 t2_5 t1_2 t3_1 t1_4 t2_1 t1_5 t1_1)*/ |
@@ -5055,7 +5055,7 @@ error hint: | ||
5055 | 5055 | -> Sort |
5056 | 5056 | Sort Key: t3_5.id |
5057 | 5057 | -> Seq Scan on t3 t3_5 |
5058 | - InitPlan 2 (returns $2) | |
5058 | + InitPlan 2 (returns $3) | |
5059 | 5059 | -> Aggregate |
5060 | 5060 | -> Merge Join |
5061 | 5061 | Merge Cond: (t1_2.id = t3_2.id) |
@@ -5066,7 +5066,7 @@ error hint: | ||
5066 | 5066 | -> Sort |
5067 | 5067 | Sort Key: t3_2.id |
5068 | 5068 | -> Seq Scan on t3 t3_2 |
5069 | - InitPlan 3 (returns $3) | |
5069 | + InitPlan 3 (returns $5) | |
5070 | 5070 | -> Aggregate |
5071 | 5071 | -> Merge Join |
5072 | 5072 | Merge Cond: (t1_4.id = t3_4.id) |
@@ -5081,21 +5081,21 @@ error hint: | ||
5081 | 5081 | -> Nested Loop |
5082 | 5082 | -> Nested Loop |
5083 | 5083 | -> Index Scan using t2_pkey on t2 t2_1 |
5084 | - Index Cond: (id = $3) | |
5084 | + Index Cond: (id = $5) | |
5085 | 5085 | -> Seq Scan on t3 t3_1 |
5086 | - Filter: (id = $3) | |
5086 | + Filter: (id = $5) | |
5087 | 5087 | -> Index Scan using t1_pkey on t1 t1_1 |
5088 | - Index Cond: (id = $3) | |
5088 | + Index Cond: (id = $5) | |
5089 | 5089 | -> Nested Loop |
5090 | 5090 | -> Nested Loop |
5091 | 5091 | -> Index Scan using t2_pkey on t2 t2_3 |
5092 | - Index Cond: (id = $3) | |
5092 | + Index Cond: (id = $5) | |
5093 | 5093 | -> Seq Scan on t3 t3_3 |
5094 | - Filter: (id = $3) | |
5094 | + Filter: (id = $5) | |
5095 | 5095 | -> Index Scan using t1_pkey on t1 t1_3 |
5096 | - Index Cond: (id = $3) | |
5096 | + Index Cond: (id = $5) | |
5097 | 5097 | -> CTE Scan on c1_1 |
5098 | - Filter: (id = $3) | |
5098 | + Filter: (id = $5) | |
5099 | 5099 | (53 rows) |
5100 | 5100 | |
5101 | 5101 | /*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(t3_5 t2_5 t1_5)Leading(t3_2 t2_2 t1_2)Leading(t3_4 t2_4 t1_4)Leading(c1_1 t3_3 t2_3 t1_3 t3_1 t2_1 t1_1)*/ |
@@ -1,8030 +0,0 @@ | ||
1 | -SET search_path TO public; | |
2 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
3 | - QUERY PLAN | |
4 | --------------------------------------- | |
5 | - Merge Join | |
6 | - Merge Cond: (t1.id = t2.id) | |
7 | - -> Index Scan using t1_pkey on t1 | |
8 | - -> Index Scan using t2_pkey on t2 | |
9 | -(4 rows) | |
10 | - | |
11 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.val = t2.val; | |
12 | - QUERY PLAN | |
13 | -------------------------------------------- | |
14 | - Merge Join | |
15 | - Merge Cond: (t2.val = t1.val) | |
16 | - -> Index Scan using t2_val on t2 | |
17 | - -> Materialize | |
18 | - -> Index Scan using t1_val on t1 | |
19 | -(5 rows) | |
20 | - | |
21 | -LOAD 'pg_hint_plan'; | |
22 | -SET pg_hint_plan.debug_print TO on; | |
23 | -SET client_min_messages TO LOG; | |
24 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
25 | - QUERY PLAN | |
26 | --------------------------------------- | |
27 | - Merge Join | |
28 | - Merge Cond: (t1.id = t2.id) | |
29 | - -> Index Scan using t1_pkey on t1 | |
30 | - -> Index Scan using t2_pkey on t2 | |
31 | -(4 rows) | |
32 | - | |
33 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.val = t2.val; | |
34 | - QUERY PLAN | |
35 | -------------------------------------------- | |
36 | - Merge Join | |
37 | - Merge Cond: (t2.val = t1.val) | |
38 | - -> Index Scan using t2_val on t2 | |
39 | - -> Materialize | |
40 | - -> Index Scan using t1_val on t1 | |
41 | -(5 rows) | |
42 | - | |
43 | -/*+ Test (t1 t2) */ | |
44 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
45 | -INFO: hint syntax error at or near "Test (t1 t2) " | |
46 | -DETAIL: Unrecognized hint keyword "Test". | |
47 | - QUERY PLAN | |
48 | --------------------------------------- | |
49 | - Merge Join | |
50 | - Merge Cond: (t1.id = t2.id) | |
51 | - -> Index Scan using t1_pkey on t1 | |
52 | - -> Index Scan using t2_pkey on t2 | |
53 | -(4 rows) | |
54 | - | |
55 | -SET pg_hint_plan.enable_hint TO off; | |
56 | -/*+ Test (t1 t2) */ | |
57 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
58 | - QUERY PLAN | |
59 | --------------------------------------- | |
60 | - Merge Join | |
61 | - Merge Cond: (t1.id = t2.id) | |
62 | - -> Index Scan using t1_pkey on t1 | |
63 | - -> Index Scan using t2_pkey on t2 | |
64 | -(4 rows) | |
65 | - | |
66 | -SET pg_hint_plan.enable_hint TO on; | |
67 | -/*Set(enable_indexscan off)*/ | |
68 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
69 | - QUERY PLAN | |
70 | --------------------------------------- | |
71 | - Merge Join | |
72 | - Merge Cond: (t1.id = t2.id) | |
73 | - -> Index Scan using t1_pkey on t1 | |
74 | - -> Index Scan using t2_pkey on t2 | |
75 | -(4 rows) | |
76 | - | |
77 | ---+Set(enable_indexscan off) | |
78 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
79 | - QUERY PLAN | |
80 | --------------------------------------- | |
81 | - Merge Join | |
82 | - Merge Cond: (t1.id = t2.id) | |
83 | - -> Index Scan using t1_pkey on t1 | |
84 | - -> Index Scan using t2_pkey on t2 | |
85 | -(4 rows) | |
86 | - | |
87 | -/*+Set(enable_indexscan off) /* nest comment */ */ | |
88 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
89 | -INFO: hint syntax error at or near "/* nest comment */ */ | |
90 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;" | |
91 | -DETAIL: Nested block comments are not supported. | |
92 | - QUERY PLAN | |
93 | --------------------------------------- | |
94 | - Merge Join | |
95 | - Merge Cond: (t1.id = t2.id) | |
96 | - -> Index Scan using t1_pkey on t1 | |
97 | - -> Index Scan using t2_pkey on t2 | |
98 | -(4 rows) | |
99 | - | |
100 | -/*+Set(enable_indexscan off)*/ | |
101 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
102 | -LOG: pg_hint_plan: | |
103 | -used hint: | |
104 | -Set(enable_indexscan off) | |
105 | -not used hint: | |
106 | -duplication hint: | |
107 | -error hint: | |
108 | - | |
109 | - QUERY PLAN | |
110 | ------------------------------- | |
111 | - Hash Join | |
112 | - Hash Cond: (t1.id = t2.id) | |
113 | - -> Seq Scan on t1 | |
114 | - -> Hash | |
115 | - -> Seq Scan on t2 | |
116 | -(5 rows) | |
117 | - | |
118 | -EXPLAIN (COSTS false) /*+Set(enable_indexscan off)*/ | |
119 | - SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
120 | -LOG: pg_hint_plan: | |
121 | -used hint: | |
122 | -Set(enable_indexscan off) | |
123 | -not used hint: | |
124 | -duplication hint: | |
125 | -error hint: | |
126 | - | |
127 | - QUERY PLAN | |
128 | ------------------------------- | |
129 | - Hash Join | |
130 | - Hash Cond: (t1.id = t2.id) | |
131 | - -> Seq Scan on t1 | |
132 | - -> Hash | |
133 | - -> Seq Scan on t2 | |
134 | -(5 rows) | |
135 | - | |
136 | -/*+ Set(enable_indexscan off) Set(enable_hashjoin off) */ | |
137 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
138 | -LOG: pg_hint_plan: | |
139 | -used hint: | |
140 | -Set(enable_hashjoin off) | |
141 | -Set(enable_indexscan off) | |
142 | -not used hint: | |
143 | -duplication hint: | |
144 | -error hint: | |
145 | - | |
146 | - QUERY PLAN | |
147 | -------------------------------- | |
148 | - Merge Join | |
149 | - Merge Cond: (t1.id = t2.id) | |
150 | - -> Sort | |
151 | - Sort Key: t1.id | |
152 | - -> Seq Scan on t1 | |
153 | - -> Sort | |
154 | - Sort Key: t2.id | |
155 | - -> Seq Scan on t2 | |
156 | -(8 rows) | |
157 | - | |
158 | -/*+ Set ( enable_indexscan off ) */ | |
159 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
160 | -LOG: pg_hint_plan: | |
161 | -used hint: | |
162 | -Set(enable_indexscan off) | |
163 | -not used hint: | |
164 | -duplication hint: | |
165 | -error hint: | |
166 | - | |
167 | - QUERY PLAN | |
168 | ------------------------------- | |
169 | - Hash Join | |
170 | - Hash Cond: (t1.id = t2.id) | |
171 | - -> Seq Scan on t1 | |
172 | - -> Hash | |
173 | - -> Seq Scan on t2 | |
174 | -(5 rows) | |
175 | - | |
176 | -/*+ | |
177 | - Set | |
178 | - ( | |
179 | - enable_indexscan | |
180 | - off | |
181 | - ) | |
182 | - */ | |
183 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
184 | -LOG: pg_hint_plan: | |
185 | -used hint: | |
186 | -Set(enable_indexscan off) | |
187 | -not used hint: | |
188 | -duplication hint: | |
189 | -error hint: | |
190 | - | |
191 | - QUERY PLAN | |
192 | ------------------------------- | |
193 | - Hash Join | |
194 | - Hash Cond: (t1.id = t2.id) | |
195 | - -> Seq Scan on t1 | |
196 | - -> Hash | |
197 | - -> Seq Scan on t2 | |
198 | -(5 rows) | |
199 | - | |
200 | -/*+ Set(enable_indexscan off)Set(enable_nestloop off)Set(enable_mergejoin off) | |
201 | - Set(enable_seqscan off) | |
202 | - */ | |
203 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
204 | -LOG: pg_hint_plan: | |
205 | -used hint: | |
206 | -Set(enable_indexscan off) | |
207 | -Set(enable_mergejoin off) | |
208 | -Set(enable_nestloop off) | |
209 | -Set(enable_seqscan off) | |
210 | -not used hint: | |
211 | -duplication hint: | |
212 | -error hint: | |
213 | - | |
214 | - QUERY PLAN | |
215 | ------------------------------------------- | |
216 | - Nested Loop | |
217 | - -> Index Scan using t2_pkey on t2 | |
218 | - -> Bitmap Heap Scan on t1 | |
219 | - Recheck Cond: (id = t2.id) | |
220 | - -> Bitmap Index Scan on t1_pkey | |
221 | - Index Cond: (id = t2.id) | |
222 | -(6 rows) | |
223 | - | |
224 | -/*+Set(work_mem "1M")*/ | |
225 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
226 | -INFO: invalid value for parameter "work_mem": "1M" | |
227 | -HINT: Valid units for this parameter are "kB", "MB", and "GB". | |
228 | -LOG: pg_hint_plan: | |
229 | -used hint: | |
230 | -not used hint: | |
231 | -duplication hint: | |
232 | -error hint: | |
233 | -Set(work_mem 1M) | |
234 | - | |
235 | - QUERY PLAN | |
236 | --------------------------------------- | |
237 | - Merge Join | |
238 | - Merge Cond: (t1.id = t2.id) | |
239 | - -> Index Scan using t1_pkey on t1 | |
240 | - -> Index Scan using t2_pkey on t2 | |
241 | -(4 rows) | |
242 | - | |
243 | -/*+Set(work_mem "1MB")*/ | |
244 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
245 | -LOG: pg_hint_plan: | |
246 | -used hint: | |
247 | -Set(work_mem 1MB) | |
248 | -not used hint: | |
249 | -duplication hint: | |
250 | -error hint: | |
251 | - | |
252 | - QUERY PLAN | |
253 | --------------------------------------- | |
254 | - Merge Join | |
255 | - Merge Cond: (t1.id = t2.id) | |
256 | - -> Index Scan using t1_pkey on t1 | |
257 | - -> Index Scan using t2_pkey on t2 | |
258 | -(4 rows) | |
259 | - | |
260 | -/*+Set(work_mem TO "1MB")*/ | |
261 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
262 | -INFO: hint syntax error at or near "Set(work_mem TO "1MB")" | |
263 | -DETAIL: Set hint requires name and value of GUC parameter. | |
264 | -LOG: pg_hint_plan: | |
265 | -used hint: | |
266 | -not used hint: | |
267 | -duplication hint: | |
268 | -error hint: | |
269 | -Set(work_mem TO 1MB) | |
270 | - | |
271 | - QUERY PLAN | |
272 | --------------------------------------- | |
273 | - Merge Join | |
274 | - Merge Cond: (t1.id = t2.id) | |
275 | - -> Index Scan using t1_pkey on t1 | |
276 | - -> Index Scan using t2_pkey on t2 | |
277 | -(4 rows) | |
278 | - | |
279 | -/*+SeqScan(t1 t2)*/ | |
280 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
281 | -INFO: hint syntax error at or near "" | |
282 | -DETAIL: SeqScan hint accepts only one relation. | |
283 | -LOG: pg_hint_plan: | |
284 | -used hint: | |
285 | -not used hint: | |
286 | -duplication hint: | |
287 | -error hint: | |
288 | -SeqScan(t1 t2) | |
289 | - | |
290 | - QUERY PLAN | |
291 | --------------------------------------- | |
292 | - Merge Join | |
293 | - Merge Cond: (t1.id = t2.id) | |
294 | - -> Index Scan using t1_pkey on t1 | |
295 | - -> Index Scan using t2_pkey on t2 | |
296 | -(4 rows) | |
297 | - | |
298 | -/*+SeqScan(t1)*/ | |
299 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
300 | -LOG: pg_hint_plan: | |
301 | -used hint: | |
302 | -SeqScan(t1) | |
303 | -not used hint: | |
304 | -duplication hint: | |
305 | -error hint: | |
306 | - | |
307 | - QUERY PLAN | |
308 | ------------------------------- | |
309 | - Hash Join | |
310 | - Hash Cond: (t1.id = t2.id) | |
311 | - -> Seq Scan on t1 | |
312 | - -> Hash | |
313 | - -> Seq Scan on t2 | |
314 | -(5 rows) | |
315 | - | |
316 | -/*+SeqScan(t1)IndexScan(t2)*/ | |
317 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
318 | -LOG: pg_hint_plan: | |
319 | -used hint: | |
320 | -SeqScan(t1) | |
321 | -IndexScan(t2) | |
322 | -not used hint: | |
323 | -duplication hint: | |
324 | -error hint: | |
325 | - | |
326 | - QUERY PLAN | |
327 | --------------------------------------------- | |
328 | - Hash Join | |
329 | - Hash Cond: (t1.id = t2.id) | |
330 | - -> Seq Scan on t1 | |
331 | - -> Hash | |
332 | - -> Index Scan using t2_pkey on t2 | |
333 | -(5 rows) | |
334 | - | |
335 | -/*+BitmapScan(t2)*/ | |
336 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
337 | -LOG: pg_hint_plan: | |
338 | -used hint: | |
339 | -BitmapScan(t2) | |
340 | -not used hint: | |
341 | -duplication hint: | |
342 | -error hint: | |
343 | - | |
344 | - QUERY PLAN | |
345 | ------------------------------------------- | |
346 | - Nested Loop | |
347 | - -> Seq Scan on t1 | |
348 | - -> Bitmap Heap Scan on t2 | |
349 | - Recheck Cond: (id = t1.id) | |
350 | - -> Bitmap Index Scan on t2_pkey | |
351 | - Index Cond: (id = t1.id) | |
352 | -(6 rows) | |
353 | - | |
354 | -/*+BitmapScan(t2)NoSeqScan(t1)*/ | |
355 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
356 | -LOG: pg_hint_plan: | |
357 | -used hint: | |
358 | -NoSeqScan(t1) | |
359 | -BitmapScan(t2) | |
360 | -not used hint: | |
361 | -duplication hint: | |
362 | -error hint: | |
363 | - | |
364 | - QUERY PLAN | |
365 | ------------------------------------------- | |
366 | - Nested Loop | |
367 | - -> Index Scan using t1_pkey on t1 | |
368 | - -> Bitmap Heap Scan on t2 | |
369 | - Recheck Cond: (id = t1.id) | |
370 | - -> Bitmap Index Scan on t2_pkey | |
371 | - Index Cond: (id = t1.id) | |
372 | -(6 rows) | |
373 | - | |
374 | -/*+NoIndexScan(t1)*/ | |
375 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
376 | -LOG: pg_hint_plan: | |
377 | -used hint: | |
378 | -NoIndexScan(t1) | |
379 | -not used hint: | |
380 | -duplication hint: | |
381 | -error hint: | |
382 | - | |
383 | - QUERY PLAN | |
384 | ------------------------------- | |
385 | - Hash Join | |
386 | - Hash Cond: (t1.id = t2.id) | |
387 | - -> Seq Scan on t1 | |
388 | - -> Hash | |
389 | - -> Seq Scan on t2 | |
390 | -(5 rows) | |
391 | - | |
392 | -/*+NoBitmapScan(t1)*/ | |
393 | -EXPLAIN (COSTS false) SELECT * FROM t1, t4 WHERE t1.val < 10; | |
394 | -LOG: pg_hint_plan: | |
395 | -used hint: | |
396 | -NoBitmapScan(t1) | |
397 | -not used hint: | |
398 | -duplication hint: | |
399 | -error hint: | |
400 | - | |
401 | - QUERY PLAN | |
402 | ----------------------------- | |
403 | - Nested Loop | |
404 | - -> Seq Scan on t1 | |
405 | - Filter: (val < 10) | |
406 | - -> Materialize | |
407 | - -> Seq Scan on t4 | |
408 | -(5 rows) | |
409 | - | |
410 | -/*+TidScan(t4)*/ | |
411 | -EXPLAIN (COSTS false) SELECT * FROM t3, t4 WHERE t3.id = t4.id AND t4.ctid = '(1,1)'; | |
412 | -LOG: pg_hint_plan: | |
413 | -used hint: | |
414 | -TidScan(t4) | |
415 | -not used hint: | |
416 | -duplication hint: | |
417 | -error hint: | |
418 | - | |
419 | - QUERY PLAN | |
420 | ------------------------------------------------ | |
421 | - Merge Join | |
422 | - Merge Cond: (t3.id = t4.id) | |
423 | - -> Index Scan using t3_pkey on t3 | |
424 | - -> Sort | |
425 | - Sort Key: t4.id | |
426 | - -> Tid Scan on t4 | |
427 | - TID Cond: (ctid = '(1,1)'::tid) | |
428 | -(7 rows) | |
429 | - | |
430 | -/*+NoTidScan(t1)*/ | |
431 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)'; | |
432 | -LOG: pg_hint_plan: | |
433 | -used hint: | |
434 | -NoTidScan(t1) | |
435 | -not used hint: | |
436 | -duplication hint: | |
437 | -error hint: | |
438 | - | |
439 | - QUERY PLAN | |
440 | ---------------------------------------- | |
441 | - Nested Loop | |
442 | - -> Seq Scan on t1 | |
443 | - Filter: (ctid = '(1,1)'::tid) | |
444 | - -> Index Scan using t2_pkey on t2 | |
445 | - Index Cond: (id = t1.id) | |
446 | -(5 rows) | |
447 | - | |
448 | -/*+HashJoin(t1 t2)*/ | |
449 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
450 | -LOG: pg_hint_plan: | |
451 | -used hint: | |
452 | -HashJoin(t1 t2) | |
453 | -not used hint: | |
454 | -duplication hint: | |
455 | -error hint: | |
456 | - | |
457 | - QUERY PLAN | |
458 | ------------------------------- | |
459 | - Hash Join | |
460 | - Hash Cond: (t1.id = t2.id) | |
461 | - -> Seq Scan on t1 | |
462 | - -> Hash | |
463 | - -> Seq Scan on t2 | |
464 | -(5 rows) | |
465 | - | |
466 | -/*+NestLoop(t1 t2)*/ | |
467 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
468 | -LOG: pg_hint_plan: | |
469 | -used hint: | |
470 | -NestLoop(t1 t2) | |
471 | -not used hint: | |
472 | -duplication hint: | |
473 | -error hint: | |
474 | - | |
475 | - QUERY PLAN | |
476 | --------------------------------------- | |
477 | - Nested Loop | |
478 | - -> Seq Scan on t2 | |
479 | - -> Index Scan using t1_pkey on t1 | |
480 | - Index Cond: (id = t2.id) | |
481 | -(4 rows) | |
482 | - | |
483 | -/*+NoMergeJoin(t1 t2)*/ | |
484 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
485 | -LOG: pg_hint_plan: | |
486 | -used hint: | |
487 | -NoMergeJoin(t1 t2) | |
488 | -not used hint: | |
489 | -duplication hint: | |
490 | -error hint: | |
491 | - | |
492 | - QUERY PLAN | |
493 | ------------------------------- | |
494 | - Hash Join | |
495 | - Hash Cond: (t1.id = t2.id) | |
496 | - -> Seq Scan on t1 | |
497 | - -> Hash | |
498 | - -> Seq Scan on t2 | |
499 | -(5 rows) | |
500 | - | |
501 | -/*+MergeJoin(t1 t3)*/ | |
502 | -EXPLAIN (COSTS false) SELECT * FROM t1, t3 WHERE t1.val = t3.val; | |
503 | -LOG: pg_hint_plan: | |
504 | -used hint: | |
505 | -MergeJoin(t1 t3) | |
506 | -not used hint: | |
507 | -duplication hint: | |
508 | -error hint: | |
509 | - | |
510 | - QUERY PLAN | |
511 | -------------------------------------- | |
512 | - Merge Join | |
513 | - Merge Cond: (t1.val = t3.val) | |
514 | - -> Index Scan using t1_val on t1 | |
515 | - -> Sort | |
516 | - Sort Key: t3.val | |
517 | - -> Seq Scan on t3 | |
518 | -(6 rows) | |
519 | - | |
520 | -/*+NestLoop(t1 t3)*/ | |
521 | -EXPLAIN (COSTS false) SELECT * FROM t1, t3 WHERE t1.val = t3.val; | |
522 | -LOG: pg_hint_plan: | |
523 | -used hint: | |
524 | -NestLoop(t1 t3) | |
525 | -not used hint: | |
526 | -duplication hint: | |
527 | -error hint: | |
528 | - | |
529 | - QUERY PLAN | |
530 | -------------------------------------- | |
531 | - Nested Loop | |
532 | - -> Seq Scan on t3 | |
533 | - -> Index Scan using t1_val on t1 | |
534 | - Index Cond: (val = t3.val) | |
535 | -(4 rows) | |
536 | - | |
537 | -/*+NoHashJoin(t1 t3)*/ | |
538 | -EXPLAIN (COSTS false) SELECT * FROM t1, t3 WHERE t1.val = t3.val; | |
539 | -LOG: pg_hint_plan: | |
540 | -used hint: | |
541 | -NoHashJoin(t1 t3) | |
542 | -not used hint: | |
543 | -duplication hint: | |
544 | -error hint: | |
545 | - | |
546 | - QUERY PLAN | |
547 | -------------------------------------- | |
548 | - Nested Loop | |
549 | - -> Seq Scan on t3 | |
550 | - -> Index Scan using t1_val on t1 | |
551 | - Index Cond: (val = t3.val) | |
552 | -(4 rows) | |
553 | - | |
554 | -/*+MergeJoin(t4 t1 t2 t3)*/ | |
555 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id; | |
556 | -LOG: pg_hint_plan: | |
557 | -used hint: | |
558 | -MergeJoin(t1 t2 t3 t4) | |
559 | -not used hint: | |
560 | -duplication hint: | |
561 | -error hint: | |
562 | - | |
563 | - QUERY PLAN | |
564 | --------------------------------------------------- | |
565 | - Merge Join | |
566 | - Merge Cond: (t1.id = t4.id) | |
567 | - -> Merge Join | |
568 | - Merge Cond: (t1.id = t3.id) | |
569 | - -> Merge Join | |
570 | - Merge Cond: (t1.id = t2.id) | |
571 | - -> Index Scan using t1_pkey on t1 | |
572 | - -> Index Scan using t2_pkey on t2 | |
573 | - -> Index Scan using t3_pkey on t3 | |
574 | - -> Sort | |
575 | - Sort Key: t4.id | |
576 | - -> Seq Scan on t4 | |
577 | -(12 rows) | |
578 | - | |
579 | -/*+HashJoin(t3 t4 t1 t2)*/ | |
580 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id; | |
581 | -LOG: pg_hint_plan: | |
582 | -used hint: | |
583 | -HashJoin(t1 t2 t3 t4) | |
584 | -not used hint: | |
585 | -duplication hint: | |
586 | -error hint: | |
587 | - | |
588 | - QUERY PLAN | |
589 | --------------------------------------------------------- | |
590 | - Hash Join | |
591 | - Hash Cond: (t3.id = t1.id) | |
592 | - -> Seq Scan on t3 | |
593 | - -> Hash | |
594 | - -> Merge Join | |
595 | - Merge Cond: (t1.id = t4.id) | |
596 | - -> Merge Join | |
597 | - Merge Cond: (t1.id = t2.id) | |
598 | - -> Index Scan using t1_pkey on t1 | |
599 | - -> Index Scan using t2_pkey on t2 | |
600 | - -> Sort | |
601 | - Sort Key: t4.id | |
602 | - -> Seq Scan on t4 | |
603 | -(13 rows) | |
604 | - | |
605 | -/*+NestLoop(t2 t3 t4 t1) IndexScan(t3)*/ | |
606 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id; | |
607 | -LOG: pg_hint_plan: | |
608 | -used hint: | |
609 | -IndexScan(t3) | |
610 | -NestLoop(t1 t2 t3 t4) | |
611 | -not used hint: | |
612 | -duplication hint: | |
613 | -error hint: | |
614 | - | |
615 | - QUERY PLAN | |
616 | --------------------------------------------------- | |
617 | - Nested Loop | |
618 | - -> Merge Join | |
619 | - Merge Cond: (t1.id = t4.id) | |
620 | - -> Merge Join | |
621 | - Merge Cond: (t1.id = t2.id) | |
622 | - -> Index Scan using t1_pkey on t1 | |
623 | - -> Index Scan using t2_pkey on t2 | |
624 | - -> Sort | |
625 | - Sort Key: t4.id | |
626 | - -> Seq Scan on t4 | |
627 | - -> Index Scan using t3_pkey on t3 | |
628 | - Index Cond: (id = t1.id) | |
629 | -(12 rows) | |
630 | - | |
631 | -/*+NoNestLoop(t4 t1 t3 t2)*/ | |
632 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id; | |
633 | -LOG: pg_hint_plan: | |
634 | -used hint: | |
635 | -NoNestLoop(t1 t2 t3 t4) | |
636 | -not used hint: | |
637 | -duplication hint: | |
638 | -error hint: | |
639 | - | |
640 | - QUERY PLAN | |
641 | --------------------------------------------------- | |
642 | - Merge Join | |
643 | - Merge Cond: (t1.id = t4.id) | |
644 | - -> Merge Join | |
645 | - Merge Cond: (t1.id = t3.id) | |
646 | - -> Merge Join | |
647 | - Merge Cond: (t1.id = t2.id) | |
648 | - -> Index Scan using t1_pkey on t1 | |
649 | - -> Index Scan using t2_pkey on t2 | |
650 | - -> Index Scan using t3_pkey on t3 | |
651 | - -> Sort | |
652 | - Sort Key: t4.id | |
653 | - -> Seq Scan on t4 | |
654 | -(12 rows) | |
655 | - | |
656 | -/*+Leading( */ | |
657 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id; | |
658 | -INFO: hint syntax error at or near "" | |
659 | -DETAIL: Closing parenthesis is necessary. | |
660 | - QUERY PLAN | |
661 | --------------------------------------------------- | |
662 | - Nested Loop | |
663 | - -> Merge Join | |
664 | - Merge Cond: (t1.id = t4.id) | |
665 | - -> Merge Join | |
666 | - Merge Cond: (t1.id = t2.id) | |
667 | - -> Index Scan using t1_pkey on t1 | |
668 | - -> Index Scan using t2_pkey on t2 | |
669 | - -> Sort | |
670 | - Sort Key: t4.id | |
671 | - -> Seq Scan on t4 | |
672 | - -> Index Scan using t3_pkey on t3 | |
673 | - Index Cond: (id = t1.id) | |
674 | -(12 rows) | |
675 | - | |
676 | -/*+Leading( )*/ | |
677 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id; | |
678 | -INFO: hint syntax error at or near "Leading( )" | |
679 | -DETAIL: Leading hint requires at least two relations. | |
680 | -LOG: pg_hint_plan: | |
681 | -used hint: | |
682 | -not used hint: | |
683 | -duplication hint: | |
684 | -error hint: | |
685 | -Leading() | |
686 | - | |
687 | - QUERY PLAN | |
688 | --------------------------------------------------- | |
689 | - Nested Loop | |
690 | - -> Merge Join | |
691 | - Merge Cond: (t1.id = t4.id) | |
692 | - -> Merge Join | |
693 | - Merge Cond: (t1.id = t2.id) | |
694 | - -> Index Scan using t1_pkey on t1 | |
695 | - -> Index Scan using t2_pkey on t2 | |
696 | - -> Sort | |
697 | - Sort Key: t4.id | |
698 | - -> Seq Scan on t4 | |
699 | - -> Index Scan using t3_pkey on t3 | |
700 | - Index Cond: (id = t1.id) | |
701 | -(12 rows) | |
702 | - | |
703 | -/*+Leading( t3 )*/ | |
704 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id; | |
705 | -INFO: hint syntax error at or near "Leading( t3 )" | |
706 | -DETAIL: Leading hint requires at least two relations. | |
707 | -LOG: pg_hint_plan: | |
708 | -used hint: | |
709 | -not used hint: | |
710 | -duplication hint: | |
711 | -error hint: | |
712 | -Leading(t3) | |
713 | - | |
714 | - QUERY PLAN | |
715 | --------------------------------------------------- | |
716 | - Nested Loop | |
717 | - -> Merge Join | |
718 | - Merge Cond: (t1.id = t4.id) | |
719 | - -> Merge Join | |
720 | - Merge Cond: (t1.id = t2.id) | |
721 | - -> Index Scan using t1_pkey on t1 | |
722 | - -> Index Scan using t2_pkey on t2 | |
723 | - -> Sort | |
724 | - Sort Key: t4.id | |
725 | - -> Seq Scan on t4 | |
726 | - -> Index Scan using t3_pkey on t3 | |
727 | - Index Cond: (id = t1.id) | |
728 | -(12 rows) | |
729 | - | |
730 | -/*+Leading( t3 t4 )*/ | |
731 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id; | |
732 | -LOG: pg_hint_plan: | |
733 | -used hint: | |
734 | -Leading(t3 t4) | |
735 | -not used hint: | |
736 | -duplication hint: | |
737 | -error hint: | |
738 | - | |
739 | - QUERY PLAN | |
740 | --------------------------------------------------- | |
741 | - Nested Loop | |
742 | - -> Nested Loop | |
743 | - -> Merge Join | |
744 | - Merge Cond: (t3.id = t4.id) | |
745 | - -> Index Scan using t3_pkey on t3 | |
746 | - -> Sort | |
747 | - Sort Key: t4.id | |
748 | - -> Seq Scan on t4 | |
749 | - -> Index Scan using t2_pkey on t2 | |
750 | - Index Cond: (id = t3.id) | |
751 | - -> Index Scan using t1_pkey on t1 | |
752 | - Index Cond: (id = t2.id) | |
753 | -(12 rows) | |
754 | - | |
755 | -/*+Leading(t3 t4 t1)*/ | |
756 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id; | |
757 | -LOG: pg_hint_plan: | |
758 | -used hint: | |
759 | -Leading(t3 t4 t1) | |
760 | -not used hint: | |
761 | -duplication hint: | |
762 | -error hint: | |
763 | - | |
764 | - QUERY PLAN | |
765 | --------------------------------------------------- | |
766 | - Nested Loop | |
767 | - -> Merge Join | |
768 | - Merge Cond: (t3.id = t1.id) | |
769 | - -> Merge Join | |
770 | - Merge Cond: (t3.id = t4.id) | |
771 | - -> Index Scan using t3_pkey on t3 | |
772 | - -> Sort | |
773 | - Sort Key: t4.id | |
774 | - -> Seq Scan on t4 | |
775 | - -> Index Scan using t1_pkey on t1 | |
776 | - -> Index Scan using t2_pkey on t2 | |
777 | - Index Cond: (id = t1.id) | |
778 | -(12 rows) | |
779 | - | |
780 | -/*+Leading(t3 t4 t1 t2)*/ | |
781 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id; | |
782 | -LOG: pg_hint_plan: | |
783 | -used hint: | |
784 | -Leading(t3 t4 t1 t2) | |
785 | -not used hint: | |
786 | -duplication hint: | |
787 | -error hint: | |
788 | - | |
789 | - QUERY PLAN | |
790 | --------------------------------------------------- | |
791 | - Nested Loop | |
792 | - -> Merge Join | |
793 | - Merge Cond: (t3.id = t1.id) | |
794 | - -> Merge Join | |
795 | - Merge Cond: (t3.id = t4.id) | |
796 | - -> Index Scan using t3_pkey on t3 | |
797 | - -> Sort | |
798 | - Sort Key: t4.id | |
799 | - -> Seq Scan on t4 | |
800 | - -> Index Scan using t1_pkey on t1 | |
801 | - -> Index Scan using t2_pkey on t2 | |
802 | - Index Cond: (id = t1.id) | |
803 | -(12 rows) | |
804 | - | |
805 | -/*+Leading(t3 t4 t1 t2 t1)*/ | |
806 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id; | |
807 | -INFO: hint syntax error at or near "Leading(t3 t4 t1 t2 t1)" | |
808 | -DETAIL: Relation name "t1" is duplicated. | |
809 | -LOG: pg_hint_plan: | |
810 | -used hint: | |
811 | -not used hint: | |
812 | -duplication hint: | |
813 | -error hint: | |
814 | -Leading(t3 t4 t1 t2 t1) | |
815 | - | |
816 | - QUERY PLAN | |
817 | --------------------------------------------------- | |
818 | - Nested Loop | |
819 | - -> Merge Join | |
820 | - Merge Cond: (t1.id = t4.id) | |
821 | - -> Merge Join | |
822 | - Merge Cond: (t1.id = t2.id) | |
823 | - -> Index Scan using t1_pkey on t1 | |
824 | - -> Index Scan using t2_pkey on t2 | |
825 | - -> Sort | |
826 | - Sort Key: t4.id | |
827 | - -> Seq Scan on t4 | |
828 | - -> Index Scan using t3_pkey on t3 | |
829 | - Index Cond: (id = t1.id) | |
830 | -(12 rows) | |
831 | - | |
832 | -/*+Leading(t3 t4 t4)*/ | |
833 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id; | |
834 | -INFO: hint syntax error at or near "Leading(t3 t4 t4)" | |
835 | -DETAIL: Relation name "t4" is duplicated. | |
836 | -LOG: pg_hint_plan: | |
837 | -used hint: | |
838 | -not used hint: | |
839 | -duplication hint: | |
840 | -error hint: | |
841 | -Leading(t3 t4 t4) | |
842 | - | |
843 | - QUERY PLAN | |
844 | --------------------------------------------------- | |
845 | - Nested Loop | |
846 | - -> Merge Join | |
847 | - Merge Cond: (t1.id = t4.id) | |
848 | - -> Merge Join | |
849 | - Merge Cond: (t1.id = t2.id) | |
850 | - -> Index Scan using t1_pkey on t1 | |
851 | - -> Index Scan using t2_pkey on t2 | |
852 | - -> Sort | |
853 | - Sort Key: t4.id | |
854 | - -> Seq Scan on t4 | |
855 | - -> Index Scan using t3_pkey on t3 | |
856 | - Index Cond: (id = t1.id) | |
857 | -(12 rows) | |
858 | - | |
859 | -EXPLAIN (COSTS false) SELECT * FROM t1, (VALUES(1,1),(2,2),(3,3)) AS t2(id,val) WHERE t1.id = t2.id; | |
860 | - QUERY PLAN | |
861 | ------------------------------------------------ | |
862 | - Nested Loop | |
863 | - -> Values Scan on "*VALUES*" | |
864 | - -> Index Scan using t1_pkey on t1 | |
865 | - Index Cond: (id = "*VALUES*".column1) | |
866 | -(4 rows) | |
867 | - | |
868 | -/*+HashJoin(t1 t2)*/ | |
869 | -EXPLAIN (COSTS false) SELECT * FROM t1, (VALUES(1,1),(2,2),(3,3)) AS t2(id,val) WHERE t1.id = t2.id; | |
870 | -LOG: pg_hint_plan: | |
871 | -used hint: | |
872 | -not used hint: | |
873 | -HashJoin(t1 t2) | |
874 | -duplication hint: | |
875 | -error hint: | |
876 | - | |
877 | - QUERY PLAN | |
878 | ------------------------------------------------ | |
879 | - Nested Loop | |
880 | - -> Values Scan on "*VALUES*" | |
881 | - -> Index Scan using t1_pkey on t1 | |
882 | - Index Cond: (id = "*VALUES*".column1) | |
883 | -(4 rows) | |
884 | - | |
885 | -/*+HashJoin(t1 *VALUES*)*/ | |
886 | -EXPLAIN (COSTS false) SELECT * FROM t1, (VALUES(1,1),(2,2),(3,3)) AS t2(id,val) WHERE t1.id = t2.id; | |
887 | -LOG: pg_hint_plan: | |
888 | -used hint: | |
889 | -HashJoin(*VALUES* t1) | |
890 | -not used hint: | |
891 | -duplication hint: | |
892 | -error hint: | |
893 | - | |
894 | - QUERY PLAN | |
895 | -------------------------------------------- | |
896 | - Hash Join | |
897 | - Hash Cond: (t1.id = "*VALUES*".column1) | |
898 | - -> Seq Scan on t1 | |
899 | - -> Hash | |
900 | - -> Values Scan on "*VALUES*" | |
901 | -(5 rows) | |
902 | - | |
903 | -/*+HashJoin(t1 *VALUES*) IndexScan(t1) IndexScan(*VALUES*)*/ | |
904 | -EXPLAIN (COSTS false) SELECT * FROM t1, (VALUES(1,1),(2,2),(3,3)) AS t2(id,val) WHERE t1.id = t2.id; | |
905 | -LOG: pg_hint_plan: | |
906 | -used hint: | |
907 | -IndexScan(t1) | |
908 | -HashJoin(*VALUES* t1) | |
909 | -not used hint: | |
910 | -IndexScan(*VALUES*) | |
911 | -duplication hint: | |
912 | -error hint: | |
913 | - | |
914 | - QUERY PLAN | |
915 | -------------------------------------------- | |
916 | - Hash Join | |
917 | - Hash Cond: (t1.id = "*VALUES*".column1) | |
918 | - -> Index Scan using t1_pkey on t1 | |
919 | - -> Hash | |
920 | - -> Values Scan on "*VALUES*" | |
921 | -(5 rows) | |
922 | - | |
923 | --- single table scan hint test | |
924 | -EXPLAIN (COSTS false) SELECT (SELECT max(id) FROM t1 v_1 WHERE id < 10), id FROM v1 WHERE v1.id = (SELECT max(id) FROM t1 v_2 WHERE id < 10); | |
925 | - QUERY PLAN | |
926 | ------------------------------------------------------------------------- | |
927 | - Index Only Scan using t1_pkey on t1 | |
928 | - Index Cond: (id = $3) | |
929 | - InitPlan 2 (returns $1) | |
930 | - -> Result | |
931 | - InitPlan 1 (returns $0) | |
932 | - -> Limit | |
933 | - -> Index Only Scan Backward using t1_pkey on t1 v_1 | |
934 | - Index Cond: ((id IS NOT NULL) AND (id < 10)) | |
935 | - InitPlan 4 (returns $3) | |
936 | - -> Result | |
937 | - InitPlan 3 (returns $2) | |
938 | - -> Limit | |
939 | - -> Index Only Scan Backward using t1_pkey on t1 v_2 | |
940 | - Index Cond: ((id IS NOT NULL) AND (id < 10)) | |
941 | -(14 rows) | |
942 | - | |
943 | -/*+BitmapScan(v_1)*/ | |
944 | -EXPLAIN (COSTS false) SELECT (SELECT max(id) FROM t1 v_1 WHERE id < 10), id FROM v1 WHERE v1.id = (SELECT max(id) FROM t1 v_2 WHERE id < 10); | |
945 | -LOG: pg_hint_plan: | |
946 | -used hint: | |
947 | -BitmapScan(v_1) | |
948 | -not used hint: | |
949 | -duplication hint: | |
950 | -error hint: | |
951 | - | |
952 | - QUERY PLAN | |
953 | ------------------------------------------------------------------------- | |
954 | - Index Only Scan using t1_pkey on t1 | |
955 | - Index Cond: (id = $2) | |
956 | - InitPlan 1 (returns $0) | |
957 | - -> Aggregate | |
958 | - -> Bitmap Heap Scan on t1 v_1 | |
959 | - Recheck Cond: (id < 10) | |
960 | - -> Bitmap Index Scan on t1_pkey | |
961 | - Index Cond: (id < 10) | |
962 | - InitPlan 3 (returns $2) | |
963 | - -> Result | |
964 | - InitPlan 2 (returns $1) | |
965 | - -> Limit | |
966 | - -> Index Only Scan Backward using t1_pkey on t1 v_2 | |
967 | - Index Cond: ((id IS NOT NULL) AND (id < 10)) | |
968 | -(14 rows) | |
969 | - | |
970 | -/*+BitmapScan(v_2)*/ | |
971 | -EXPLAIN (COSTS false) SELECT (SELECT max(id) FROM t1 v_1 WHERE id < 10), id FROM v1 WHERE v1.id = (SELECT max(id) FROM t1 v_2 WHERE id < 10); | |
972 | -LOG: pg_hint_plan: | |
973 | -used hint: | |
974 | -BitmapScan(v_2) | |
975 | -not used hint: | |
976 | -duplication hint: | |
977 | -error hint: | |
978 | - | |
979 | - QUERY PLAN | |
980 | ------------------------------------------------------------------------- | |
981 | - Index Only Scan using t1_pkey on t1 | |
982 | - Index Cond: (id = $2) | |
983 | - InitPlan 2 (returns $1) | |
984 | - -> Result | |
985 | - InitPlan 1 (returns $0) | |
986 | - -> Limit | |
987 | - -> Index Only Scan Backward using t1_pkey on t1 v_1 | |
988 | - Index Cond: ((id IS NOT NULL) AND (id < 10)) | |
989 | - InitPlan 3 (returns $2) | |
990 | - -> Aggregate | |
991 | - -> Bitmap Heap Scan on t1 v_2 | |
992 | - Recheck Cond: (id < 10) | |
993 | - -> Bitmap Index Scan on t1_pkey | |
994 | - Index Cond: (id < 10) | |
995 | -(14 rows) | |
996 | - | |
997 | -/*+BitmapScan(t1)*/ | |
998 | -EXPLAIN (COSTS false) SELECT (SELECT max(id) FROM t1 v_1 WHERE id < 10), id FROM v1 WHERE v1.id = (SELECT max(id) FROM t1 v_2 WHERE id < 10); | |
999 | -LOG: pg_hint_plan: | |
1000 | -used hint: | |
1001 | -BitmapScan(t1) | |
1002 | -not used hint: | |
1003 | -duplication hint: | |
1004 | -error hint: | |
1005 | - | |
1006 | - QUERY PLAN | |
1007 | ------------------------------------------------------------------------- | |
1008 | - Bitmap Heap Scan on t1 | |
1009 | - Recheck Cond: (id = $3) | |
1010 | - InitPlan 2 (returns $1) | |
1011 | - -> Result | |
1012 | - InitPlan 1 (returns $0) | |
1013 | - -> Limit | |
1014 | - -> Index Only Scan Backward using t1_pkey on t1 v_1 | |
1015 | - Index Cond: ((id IS NOT NULL) AND (id < 10)) | |
1016 | - InitPlan 4 (returns $3) | |
1017 | - -> Result | |
1018 | - InitPlan 3 (returns $2) | |
1019 | - -> Limit | |
1020 | - -> Index Only Scan Backward using t1_pkey on t1 v_2 | |
1021 | - Index Cond: ((id IS NOT NULL) AND (id < 10)) | |
1022 | - -> Bitmap Index Scan on t1_pkey | |
1023 | - Index Cond: (id = $3) | |
1024 | -(16 rows) | |
1025 | - | |
1026 | -/*+BitmapScan(v_1)BitmapScan(v_2)*/ | |
1027 | -EXPLAIN (COSTS false) SELECT (SELECT max(id) FROM t1 v_1 WHERE id < 10), id FROM v1 WHERE v1.id = (SELECT max(id) FROM t1 v_2 WHERE id < 10); | |
1028 | -LOG: pg_hint_plan: | |
1029 | -used hint: | |
1030 | -BitmapScan(v_1) | |
1031 | -BitmapScan(v_2) | |
1032 | -not used hint: | |
1033 | -duplication hint: | |
1034 | -error hint: | |
1035 | - | |
1036 | - QUERY PLAN | |
1037 | --------------------------------------------------- | |
1038 | - Index Only Scan using t1_pkey on t1 | |
1039 | - Index Cond: (id = $1) | |
1040 | - InitPlan 1 (returns $0) | |
1041 | - -> Aggregate | |
1042 | - -> Bitmap Heap Scan on t1 v_1 | |
1043 | - Recheck Cond: (id < 10) | |
1044 | - -> Bitmap Index Scan on t1_pkey | |
1045 | - Index Cond: (id < 10) | |
1046 | - InitPlan 2 (returns $1) | |
1047 | - -> Aggregate | |
1048 | - -> Bitmap Heap Scan on t1 v_2 | |
1049 | - Recheck Cond: (id < 10) | |
1050 | - -> Bitmap Index Scan on t1_pkey | |
1051 | - Index Cond: (id < 10) | |
1052 | -(14 rows) | |
1053 | - | |
1054 | -/*+BitmapScan(v_1)BitmapScan(t1)*/ | |
1055 | -EXPLAIN (COSTS false) SELECT (SELECT max(id) FROM t1 v_1 WHERE id < 10), id FROM v1 WHERE v1.id = (SELECT max(id) FROM t1 v_2 WHERE id < 10); | |
1056 | -LOG: pg_hint_plan: | |
1057 | -used hint: | |
1058 | -BitmapScan(t1) | |
1059 | -BitmapScan(v_1) | |
1060 | -not used hint: | |
1061 | -duplication hint: | |
1062 | -error hint: | |
1063 | - | |
1064 | - QUERY PLAN | |
1065 | ------------------------------------------------------------------------- | |
1066 | - Bitmap Heap Scan on t1 | |
1067 | - Recheck Cond: (id = $2) | |
1068 | - InitPlan 1 (returns $0) | |
1069 | - -> Aggregate | |
1070 | - -> Bitmap Heap Scan on t1 v_1 | |
1071 | - Recheck Cond: (id < 10) | |
1072 | - -> Bitmap Index Scan on t1_pkey | |
1073 | - Index Cond: (id < 10) | |
1074 | - InitPlan 3 (returns $2) | |
1075 | - -> Result | |
1076 | - InitPlan 2 (returns $1) | |
1077 | - -> Limit | |
1078 | - -> Index Only Scan Backward using t1_pkey on t1 v_2 | |
1079 | - Index Cond: ((id IS NOT NULL) AND (id < 10)) | |
1080 | - -> Bitmap Index Scan on t1_pkey | |
1081 | - Index Cond: (id = $2) | |
1082 | -(16 rows) | |
1083 | - | |
1084 | -/*+BitmapScan(v_2)BitmapScan(t1)*/ | |
1085 | -EXPLAIN (COSTS false) SELECT (SELECT max(id) FROM t1 v_1 WHERE id < 10), id FROM v1 WHERE v1.id = (SELECT max(id) FROM t1 v_2 WHERE id < 10); | |
1086 | -LOG: pg_hint_plan: | |
1087 | -used hint: | |
1088 | -BitmapScan(t1) | |
1089 | -BitmapScan(v_2) | |
1090 | -not used hint: | |
1091 | -duplication hint: | |
1092 | -error hint: | |
1093 | - | |
1094 | - QUERY PLAN | |
1095 | ------------------------------------------------------------------------- | |
1096 | - Bitmap Heap Scan on t1 | |
1097 | - Recheck Cond: (id = $2) | |
1098 | - InitPlan 2 (returns $1) | |
1099 | - -> Result | |
1100 | - InitPlan 1 (returns $0) | |
1101 | - -> Limit | |
1102 | - -> Index Only Scan Backward using t1_pkey on t1 v_1 | |
1103 | - Index Cond: ((id IS NOT NULL) AND (id < 10)) | |
1104 | - InitPlan 3 (returns $2) | |
1105 | - -> Aggregate | |
1106 | - -> Bitmap Heap Scan on t1 v_2 | |
1107 | - Recheck Cond: (id < 10) | |
1108 | - -> Bitmap Index Scan on t1_pkey | |
1109 | - Index Cond: (id < 10) | |
1110 | - -> Bitmap Index Scan on t1_pkey | |
1111 | - Index Cond: (id = $2) | |
1112 | -(16 rows) | |
1113 | - | |
1114 | -/*+BitmapScan(v_1)BitmapScan(v_2)BitmapScan(t1)*/ | |
1115 | -EXPLAIN (COSTS false) SELECT (SELECT max(id) FROM t1 v_1 WHERE id < 10), id FROM v1 WHERE v1.id = (SELECT max(id) FROM t1 v_2 WHERE id < 10); | |
1116 | -LOG: pg_hint_plan: | |
1117 | -used hint: | |
1118 | -BitmapScan(t1) | |
1119 | -BitmapScan(v_1) | |
1120 | -BitmapScan(v_2) | |
1121 | -not used hint: | |
1122 | -duplication hint: | |
1123 | -error hint: | |
1124 | - | |
1125 | - QUERY PLAN | |
1126 | --------------------------------------------------- | |
1127 | - Bitmap Heap Scan on t1 | |
1128 | - Recheck Cond: (id = $1) | |
1129 | - InitPlan 1 (returns $0) | |
1130 | - -> Aggregate | |
1131 | - -> Bitmap Heap Scan on t1 v_1 | |
1132 | - Recheck Cond: (id < 10) | |
1133 | - -> Bitmap Index Scan on t1_pkey | |
1134 | - Index Cond: (id < 10) | |
1135 | - InitPlan 2 (returns $1) | |
1136 | - -> Aggregate | |
1137 | - -> Bitmap Heap Scan on t1 v_2 | |
1138 | - Recheck Cond: (id < 10) | |
1139 | - -> Bitmap Index Scan on t1_pkey | |
1140 | - Index Cond: (id < 10) | |
1141 | - -> Bitmap Index Scan on t1_pkey | |
1142 | - Index Cond: (id = $1) | |
1143 | -(16 rows) | |
1144 | - | |
1145 | --- full scan hint pattern test | |
1146 | -EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)'; | |
1147 | - QUERY PLAN | |
1148 | ------------------------------------ | |
1149 | - Tid Scan on t1 | |
1150 | - TID Cond: (ctid = '(1,1)'::tid) | |
1151 | - Filter: (id < 10) | |
1152 | -(3 rows) | |
1153 | - | |
1154 | -/*+SeqScan(t1)*/ | |
1155 | -EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)'; | |
1156 | -LOG: pg_hint_plan: | |
1157 | -used hint: | |
1158 | -SeqScan(t1) | |
1159 | -not used hint: | |
1160 | -duplication hint: | |
1161 | -error hint: | |
1162 | - | |
1163 | - QUERY PLAN | |
1164 | -------------------------------------------------- | |
1165 | - Seq Scan on t1 | |
1166 | - Filter: ((id < 10) AND (ctid = '(1,1)'::tid)) | |
1167 | -(2 rows) | |
1168 | - | |
1169 | -/*+IndexScan(t1)*/ | |
1170 | -EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)'; | |
1171 | -LOG: pg_hint_plan: | |
1172 | -used hint: | |
1173 | -IndexScan(t1) | |
1174 | -not used hint: | |
1175 | -duplication hint: | |
1176 | -error hint: | |
1177 | - | |
1178 | - QUERY PLAN | |
1179 | ---------------------------------- | |
1180 | - Index Scan using t1_pkey on t1 | |
1181 | - Index Cond: (id < 10) | |
1182 | - Filter: (ctid = '(1,1)'::tid) | |
1183 | -(3 rows) | |
1184 | - | |
1185 | -/*+BitmapScan(t1)*/ | |
1186 | -EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)'; | |
1187 | -LOG: pg_hint_plan: | |
1188 | -used hint: | |
1189 | -BitmapScan(t1) | |
1190 | -not used hint: | |
1191 | -duplication hint: | |
1192 | -error hint: | |
1193 | - | |
1194 | - QUERY PLAN | |
1195 | ------------------------------------- | |
1196 | - Bitmap Heap Scan on t1 | |
1197 | - Recheck Cond: (id < 10) | |
1198 | - Filter: (ctid = '(1,1)'::tid) | |
1199 | - -> Bitmap Index Scan on t1_pkey | |
1200 | - Index Cond: (id < 10) | |
1201 | -(5 rows) | |
1202 | - | |
1203 | -/*+TidScan(t1)*/ | |
1204 | -EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)'; | |
1205 | -LOG: pg_hint_plan: | |
1206 | -used hint: | |
1207 | -TidScan(t1) | |
1208 | -not used hint: | |
1209 | -duplication hint: | |
1210 | -error hint: | |
1211 | - | |
1212 | - QUERY PLAN | |
1213 | ------------------------------------ | |
1214 | - Tid Scan on t1 | |
1215 | - TID Cond: (ctid = '(1,1)'::tid) | |
1216 | - Filter: (id < 10) | |
1217 | -(3 rows) | |
1218 | - | |
1219 | -/*+NoSeqScan(t1)*/ | |
1220 | -EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)'; | |
1221 | -LOG: pg_hint_plan: | |
1222 | -used hint: | |
1223 | -NoSeqScan(t1) | |
1224 | -not used hint: | |
1225 | -duplication hint: | |
1226 | -error hint: | |
1227 | - | |
1228 | - QUERY PLAN | |
1229 | ------------------------------------ | |
1230 | - Tid Scan on t1 | |
1231 | - TID Cond: (ctid = '(1,1)'::tid) | |
1232 | - Filter: (id < 10) | |
1233 | -(3 rows) | |
1234 | - | |
1235 | -/*+NoIndexScan(t1)*/ | |
1236 | -EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)'; | |
1237 | -LOG: pg_hint_plan: | |
1238 | -used hint: | |
1239 | -NoIndexScan(t1) | |
1240 | -not used hint: | |
1241 | -duplication hint: | |
1242 | -error hint: | |
1243 | - | |
1244 | - QUERY PLAN | |
1245 | ------------------------------------ | |
1246 | - Tid Scan on t1 | |
1247 | - TID Cond: (ctid = '(1,1)'::tid) | |
1248 | - Filter: (id < 10) | |
1249 | -(3 rows) | |
1250 | - | |
1251 | -/*+NoBitmapScan(t1)*/ | |
1252 | -EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)'; | |
1253 | -LOG: pg_hint_plan: | |
1254 | -used hint: | |
1255 | -NoBitmapScan(t1) | |
1256 | -not used hint: | |
1257 | -duplication hint: | |
1258 | -error hint: | |
1259 | - | |
1260 | - QUERY PLAN | |
1261 | ------------------------------------ | |
1262 | - Tid Scan on t1 | |
1263 | - TID Cond: (ctid = '(1,1)'::tid) | |
1264 | - Filter: (id < 10) | |
1265 | -(3 rows) | |
1266 | - | |
1267 | -/*+NoTidScan(t1)*/ | |
1268 | -EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)'; | |
1269 | -LOG: pg_hint_plan: | |
1270 | -used hint: | |
1271 | -NoTidScan(t1) | |
1272 | -not used hint: | |
1273 | -duplication hint: | |
1274 | -error hint: | |
1275 | - | |
1276 | - QUERY PLAN | |
1277 | ---------------------------------- | |
1278 | - Index Scan using t1_pkey on t1 | |
1279 | - Index Cond: (id < 10) | |
1280 | - Filter: (ctid = '(1,1)'::tid) | |
1281 | -(3 rows) | |
1282 | - | |
1283 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1284 | - QUERY PLAN | |
1285 | ------------------------------------------ | |
1286 | - Nested Loop | |
1287 | - Join Filter: (t1.id = t2.id) | |
1288 | - -> Tid Scan on t1 | |
1289 | - TID Cond: (ctid = '(1,1)'::tid) | |
1290 | - -> Tid Scan on t2 | |
1291 | - TID Cond: (ctid = '(1,1)'::tid) | |
1292 | -(6 rows) | |
1293 | - | |
1294 | -/*+SeqScan(t1)*/ | |
1295 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1296 | -LOG: pg_hint_plan: | |
1297 | -used hint: | |
1298 | -SeqScan(t1) | |
1299 | -not used hint: | |
1300 | -duplication hint: | |
1301 | -error hint: | |
1302 | - | |
1303 | - QUERY PLAN | |
1304 | ------------------------------------------ | |
1305 | - Nested Loop | |
1306 | - Join Filter: (t1.id = t2.id) | |
1307 | - -> Seq Scan on t1 | |
1308 | - Filter: (ctid = '(1,1)'::tid) | |
1309 | - -> Tid Scan on t2 | |
1310 | - TID Cond: (ctid = '(1,1)'::tid) | |
1311 | -(6 rows) | |
1312 | - | |
1313 | -/*+SeqScan(t2)*/ | |
1314 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1315 | -LOG: pg_hint_plan: | |
1316 | -used hint: | |
1317 | -SeqScan(t2) | |
1318 | -not used hint: | |
1319 | -duplication hint: | |
1320 | -error hint: | |
1321 | - | |
1322 | - QUERY PLAN | |
1323 | ------------------------------------------ | |
1324 | - Nested Loop | |
1325 | - Join Filter: (t1.id = t2.id) | |
1326 | - -> Tid Scan on t1 | |
1327 | - TID Cond: (ctid = '(1,1)'::tid) | |
1328 | - -> Seq Scan on t2 | |
1329 | - Filter: (ctid = '(1,1)'::tid) | |
1330 | -(6 rows) | |
1331 | - | |
1332 | -/*+SeqScan(t1) SeqScan(t2)*/ | |
1333 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1334 | -LOG: pg_hint_plan: | |
1335 | -used hint: | |
1336 | -SeqScan(t1) | |
1337 | -SeqScan(t2) | |
1338 | -not used hint: | |
1339 | -duplication hint: | |
1340 | -error hint: | |
1341 | - | |
1342 | - QUERY PLAN | |
1343 | ---------------------------------------- | |
1344 | - Nested Loop | |
1345 | - Join Filter: (t1.id = t2.id) | |
1346 | - -> Seq Scan on t1 | |
1347 | - Filter: (ctid = '(1,1)'::tid) | |
1348 | - -> Seq Scan on t2 | |
1349 | - Filter: (ctid = '(1,1)'::tid) | |
1350 | -(6 rows) | |
1351 | - | |
1352 | -/*+SeqScan(t1) IndexScan(t2)*/ | |
1353 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1354 | -LOG: pg_hint_plan: | |
1355 | -used hint: | |
1356 | -SeqScan(t1) | |
1357 | -IndexScan(t2) | |
1358 | -not used hint: | |
1359 | -duplication hint: | |
1360 | -error hint: | |
1361 | - | |
1362 | - QUERY PLAN | |
1363 | ---------------------------------------- | |
1364 | - Nested Loop | |
1365 | - -> Seq Scan on t1 | |
1366 | - Filter: (ctid = '(1,1)'::tid) | |
1367 | - -> Index Scan using t2_pkey on t2 | |
1368 | - Index Cond: (id = t1.id) | |
1369 | - Filter: (ctid = '(1,1)'::tid) | |
1370 | -(6 rows) | |
1371 | - | |
1372 | -/*+SeqScan(t1) BitmapScan(t2)*/ | |
1373 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1374 | -LOG: pg_hint_plan: | |
1375 | -used hint: | |
1376 | -SeqScan(t1) | |
1377 | -BitmapScan(t2) | |
1378 | -not used hint: | |
1379 | -duplication hint: | |
1380 | -error hint: | |
1381 | - | |
1382 | - QUERY PLAN | |
1383 | ------------------------------------------- | |
1384 | - Nested Loop | |
1385 | - -> Seq Scan on t1 | |
1386 | - Filter: (ctid = '(1,1)'::tid) | |
1387 | - -> Bitmap Heap Scan on t2 | |
1388 | - Recheck Cond: (id = t1.id) | |
1389 | - Filter: (ctid = '(1,1)'::tid) | |
1390 | - -> Bitmap Index Scan on t2_pkey | |
1391 | - Index Cond: (id = t1.id) | |
1392 | -(8 rows) | |
1393 | - | |
1394 | -/*+SeqScan(t1) TidScan(t2)*/ | |
1395 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1396 | -LOG: pg_hint_plan: | |
1397 | -used hint: | |
1398 | -SeqScan(t1) | |
1399 | -TidScan(t2) | |
1400 | -not used hint: | |
1401 | -duplication hint: | |
1402 | -error hint: | |
1403 | - | |
1404 | - QUERY PLAN | |
1405 | ------------------------------------------ | |
1406 | - Nested Loop | |
1407 | - Join Filter: (t1.id = t2.id) | |
1408 | - -> Seq Scan on t1 | |
1409 | - Filter: (ctid = '(1,1)'::tid) | |
1410 | - -> Tid Scan on t2 | |
1411 | - TID Cond: (ctid = '(1,1)'::tid) | |
1412 | -(6 rows) | |
1413 | - | |
1414 | -/*+SeqScan(t1) NoSeqScan(t2)*/ | |
1415 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1416 | -LOG: pg_hint_plan: | |
1417 | -used hint: | |
1418 | -SeqScan(t1) | |
1419 | -NoSeqScan(t2) | |
1420 | -not used hint: | |
1421 | -duplication hint: | |
1422 | -error hint: | |
1423 | - | |
1424 | - QUERY PLAN | |
1425 | ------------------------------------------ | |
1426 | - Nested Loop | |
1427 | - Join Filter: (t1.id = t2.id) | |
1428 | - -> Seq Scan on t1 | |
1429 | - Filter: (ctid = '(1,1)'::tid) | |
1430 | - -> Tid Scan on t2 | |
1431 | - TID Cond: (ctid = '(1,1)'::tid) | |
1432 | -(6 rows) | |
1433 | - | |
1434 | -/*+SeqScan(t1) NoIndexScan(t2)*/ | |
1435 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1436 | -LOG: pg_hint_plan: | |
1437 | -used hint: | |
1438 | -SeqScan(t1) | |
1439 | -NoIndexScan(t2) | |
1440 | -not used hint: | |
1441 | -duplication hint: | |
1442 | -error hint: | |
1443 | - | |
1444 | - QUERY PLAN | |
1445 | ------------------------------------------ | |
1446 | - Nested Loop | |
1447 | - Join Filter: (t1.id = t2.id) | |
1448 | - -> Seq Scan on t1 | |
1449 | - Filter: (ctid = '(1,1)'::tid) | |
1450 | - -> Tid Scan on t2 | |
1451 | - TID Cond: (ctid = '(1,1)'::tid) | |
1452 | -(6 rows) | |
1453 | - | |
1454 | -/*+SeqScan(t1) NoBitmapScan(t2)*/ | |
1455 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1456 | -LOG: pg_hint_plan: | |
1457 | -used hint: | |
1458 | -SeqScan(t1) | |
1459 | -NoBitmapScan(t2) | |
1460 | -not used hint: | |
1461 | -duplication hint: | |
1462 | -error hint: | |
1463 | - | |
1464 | - QUERY PLAN | |
1465 | ------------------------------------------ | |
1466 | - Nested Loop | |
1467 | - Join Filter: (t1.id = t2.id) | |
1468 | - -> Seq Scan on t1 | |
1469 | - Filter: (ctid = '(1,1)'::tid) | |
1470 | - -> Tid Scan on t2 | |
1471 | - TID Cond: (ctid = '(1,1)'::tid) | |
1472 | -(6 rows) | |
1473 | - | |
1474 | -/*+SeqScan(t1) NoTidScan(t2)*/ | |
1475 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1476 | -LOG: pg_hint_plan: | |
1477 | -used hint: | |
1478 | -SeqScan(t1) | |
1479 | -NoTidScan(t2) | |
1480 | -not used hint: | |
1481 | -duplication hint: | |
1482 | -error hint: | |
1483 | - | |
1484 | - QUERY PLAN | |
1485 | ---------------------------------------- | |
1486 | - Nested Loop | |
1487 | - -> Seq Scan on t1 | |
1488 | - Filter: (ctid = '(1,1)'::tid) | |
1489 | - -> Index Scan using t2_pkey on t2 | |
1490 | - Index Cond: (id = t1.id) | |
1491 | - Filter: (ctid = '(1,1)'::tid) | |
1492 | -(6 rows) | |
1493 | - | |
1494 | -/*+IndexScan(t1)*/ | |
1495 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1496 | -LOG: pg_hint_plan: | |
1497 | -used hint: | |
1498 | -IndexScan(t1) | |
1499 | -not used hint: | |
1500 | -duplication hint: | |
1501 | -error hint: | |
1502 | - | |
1503 | - QUERY PLAN | |
1504 | ------------------------------------------ | |
1505 | - Nested Loop | |
1506 | - -> Tid Scan on t2 | |
1507 | - TID Cond: (ctid = '(1,1)'::tid) | |
1508 | - -> Index Scan using t1_pkey on t1 | |
1509 | - Index Cond: (id = t2.id) | |
1510 | - Filter: (ctid = '(1,1)'::tid) | |
1511 | -(6 rows) | |
1512 | - | |
1513 | -/*+IndexScan(t2)*/ | |
1514 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1515 | -LOG: pg_hint_plan: | |
1516 | -used hint: | |
1517 | -IndexScan(t2) | |
1518 | -not used hint: | |
1519 | -duplication hint: | |
1520 | -error hint: | |
1521 | - | |
1522 | - QUERY PLAN | |
1523 | ------------------------------------------ | |
1524 | - Nested Loop | |
1525 | - -> Tid Scan on t1 | |
1526 | - TID Cond: (ctid = '(1,1)'::tid) | |
1527 | - -> Index Scan using t2_pkey on t2 | |
1528 | - Index Cond: (id = t1.id) | |
1529 | - Filter: (ctid = '(1,1)'::tid) | |
1530 | -(6 rows) | |
1531 | - | |
1532 | -/*+IndexScan(t1) SeqScan(t2)*/ | |
1533 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1534 | -LOG: pg_hint_plan: | |
1535 | -used hint: | |
1536 | -IndexScan(t1) | |
1537 | -SeqScan(t2) | |
1538 | -not used hint: | |
1539 | -duplication hint: | |
1540 | -error hint: | |
1541 | - | |
1542 | - QUERY PLAN | |
1543 | ---------------------------------------- | |
1544 | - Nested Loop | |
1545 | - -> Seq Scan on t2 | |
1546 | - Filter: (ctid = '(1,1)'::tid) | |
1547 | - -> Index Scan using t1_pkey on t1 | |
1548 | - Index Cond: (id = t2.id) | |
1549 | - Filter: (ctid = '(1,1)'::tid) | |
1550 | -(6 rows) | |
1551 | - | |
1552 | -/*+IndexScan(t1) IndexScan(t2)*/ | |
1553 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1554 | -LOG: pg_hint_plan: | |
1555 | -used hint: | |
1556 | -IndexScan(t1) | |
1557 | -IndexScan(t2) | |
1558 | -not used hint: | |
1559 | -duplication hint: | |
1560 | -error hint: | |
1561 | - | |
1562 | - QUERY PLAN | |
1563 | ---------------------------------------- | |
1564 | - Nested Loop | |
1565 | - -> Index Scan using t2_pkey on t2 | |
1566 | - Filter: (ctid = '(1,1)'::tid) | |
1567 | - -> Index Scan using t1_pkey on t1 | |
1568 | - Index Cond: (id = t2.id) | |
1569 | - Filter: (ctid = '(1,1)'::tid) | |
1570 | -(6 rows) | |
1571 | - | |
1572 | -/*+IndexScan(t1) BitmapScan(t2)*/ | |
1573 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1574 | -LOG: pg_hint_plan: | |
1575 | -used hint: | |
1576 | -IndexScan(t1) | |
1577 | -BitmapScan(t2) | |
1578 | -not used hint: | |
1579 | -duplication hint: | |
1580 | -error hint: | |
1581 | - | |
1582 | - QUERY PLAN | |
1583 | ------------------------------------------- | |
1584 | - Nested Loop | |
1585 | - -> Index Scan using t1_pkey on t1 | |
1586 | - Filter: (ctid = '(1,1)'::tid) | |
1587 | - -> Bitmap Heap Scan on t2 | |
1588 | - Recheck Cond: (id = t1.id) | |
1589 | - Filter: (ctid = '(1,1)'::tid) | |
1590 | - -> Bitmap Index Scan on t2_pkey | |
1591 | - Index Cond: (id = t1.id) | |
1592 | -(8 rows) | |
1593 | - | |
1594 | -/*+IndexScan(t1) TidScan(t2)*/ | |
1595 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1596 | -LOG: pg_hint_plan: | |
1597 | -used hint: | |
1598 | -IndexScan(t1) | |
1599 | -TidScan(t2) | |
1600 | -not used hint: | |
1601 | -duplication hint: | |
1602 | -error hint: | |
1603 | - | |
1604 | - QUERY PLAN | |
1605 | ------------------------------------------ | |
1606 | - Nested Loop | |
1607 | - -> Tid Scan on t2 | |
1608 | - TID Cond: (ctid = '(1,1)'::tid) | |
1609 | - -> Index Scan using t1_pkey on t1 | |
1610 | - Index Cond: (id = t2.id) | |
1611 | - Filter: (ctid = '(1,1)'::tid) | |
1612 | -(6 rows) | |
1613 | - | |
1614 | -/*+IndexScan(t1) NoSeqScan(t2)*/ | |
1615 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1616 | -LOG: pg_hint_plan: | |
1617 | -used hint: | |
1618 | -IndexScan(t1) | |
1619 | -NoSeqScan(t2) | |
1620 | -not used hint: | |
1621 | -duplication hint: | |
1622 | -error hint: | |
1623 | - | |
1624 | - QUERY PLAN | |
1625 | ------------------------------------------ | |
1626 | - Nested Loop | |
1627 | - -> Tid Scan on t2 | |
1628 | - TID Cond: (ctid = '(1,1)'::tid) | |
1629 | - -> Index Scan using t1_pkey on t1 | |
1630 | - Index Cond: (id = t2.id) | |
1631 | - Filter: (ctid = '(1,1)'::tid) | |
1632 | -(6 rows) | |
1633 | - | |
1634 | -/*+IndexScan(t1) NoIndexScan(t2)*/ | |
1635 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1636 | -LOG: pg_hint_plan: | |
1637 | -used hint: | |
1638 | -IndexScan(t1) | |
1639 | -NoIndexScan(t2) | |
1640 | -not used hint: | |
1641 | -duplication hint: | |
1642 | -error hint: | |
1643 | - | |
1644 | - QUERY PLAN | |
1645 | ------------------------------------------ | |
1646 | - Nested Loop | |
1647 | - -> Tid Scan on t2 | |
1648 | - TID Cond: (ctid = '(1,1)'::tid) | |
1649 | - -> Index Scan using t1_pkey on t1 | |
1650 | - Index Cond: (id = t2.id) | |
1651 | - Filter: (ctid = '(1,1)'::tid) | |
1652 | -(6 rows) | |
1653 | - | |
1654 | -/*+IndexScan(t1) NoBitmapScan(t2)*/ | |
1655 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1656 | -LOG: pg_hint_plan: | |
1657 | -used hint: | |
1658 | -IndexScan(t1) | |
1659 | -NoBitmapScan(t2) | |
1660 | -not used hint: | |
1661 | -duplication hint: | |
1662 | -error hint: | |
1663 | - | |
1664 | - QUERY PLAN | |
1665 | ------------------------------------------ | |
1666 | - Nested Loop | |
1667 | - -> Tid Scan on t2 | |
1668 | - TID Cond: (ctid = '(1,1)'::tid) | |
1669 | - -> Index Scan using t1_pkey on t1 | |
1670 | - Index Cond: (id = t2.id) | |
1671 | - Filter: (ctid = '(1,1)'::tid) | |
1672 | -(6 rows) | |
1673 | - | |
1674 | -/*+IndexScan(t1) NoTidScan(t2)*/ | |
1675 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1676 | -LOG: pg_hint_plan: | |
1677 | -used hint: | |
1678 | -IndexScan(t1) | |
1679 | -NoTidScan(t2) | |
1680 | -not used hint: | |
1681 | -duplication hint: | |
1682 | -error hint: | |
1683 | - | |
1684 | - QUERY PLAN | |
1685 | ---------------------------------------- | |
1686 | - Nested Loop | |
1687 | - -> Seq Scan on t2 | |
1688 | - Filter: (ctid = '(1,1)'::tid) | |
1689 | - -> Index Scan using t1_pkey on t1 | |
1690 | - Index Cond: (id = t2.id) | |
1691 | - Filter: (ctid = '(1,1)'::tid) | |
1692 | -(6 rows) | |
1693 | - | |
1694 | -/*+BitmapScan(t1)*/ | |
1695 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1696 | -LOG: pg_hint_plan: | |
1697 | -used hint: | |
1698 | -BitmapScan(t1) | |
1699 | -not used hint: | |
1700 | -duplication hint: | |
1701 | -error hint: | |
1702 | - | |
1703 | - QUERY PLAN | |
1704 | ------------------------------------------- | |
1705 | - Nested Loop | |
1706 | - -> Tid Scan on t2 | |
1707 | - TID Cond: (ctid = '(1,1)'::tid) | |
1708 | - -> Bitmap Heap Scan on t1 | |
1709 | - Recheck Cond: (id = t2.id) | |
1710 | - Filter: (ctid = '(1,1)'::tid) | |
1711 | - -> Bitmap Index Scan on t1_pkey | |
1712 | - Index Cond: (id = t2.id) | |
1713 | -(8 rows) | |
1714 | - | |
1715 | -/*+BitmapScan(t2)*/ | |
1716 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1717 | -LOG: pg_hint_plan: | |
1718 | -used hint: | |
1719 | -BitmapScan(t2) | |
1720 | -not used hint: | |
1721 | -duplication hint: | |
1722 | -error hint: | |
1723 | - | |
1724 | - QUERY PLAN | |
1725 | ------------------------------------------- | |
1726 | - Nested Loop | |
1727 | - -> Tid Scan on t1 | |
1728 | - TID Cond: (ctid = '(1,1)'::tid) | |
1729 | - -> Bitmap Heap Scan on t2 | |
1730 | - Recheck Cond: (id = t1.id) | |
1731 | - Filter: (ctid = '(1,1)'::tid) | |
1732 | - -> Bitmap Index Scan on t2_pkey | |
1733 | - Index Cond: (id = t1.id) | |
1734 | -(8 rows) | |
1735 | - | |
1736 | -/*+BitmapScan(t2)*/ | |
1737 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1738 | -LOG: pg_hint_plan: | |
1739 | -used hint: | |
1740 | -BitmapScan(t2) | |
1741 | -not used hint: | |
1742 | -duplication hint: | |
1743 | -error hint: | |
1744 | - | |
1745 | - QUERY PLAN | |
1746 | ------------------------------------------- | |
1747 | - Nested Loop | |
1748 | - -> Tid Scan on t1 | |
1749 | - TID Cond: (ctid = '(1,1)'::tid) | |
1750 | - -> Bitmap Heap Scan on t2 | |
1751 | - Recheck Cond: (id = t1.id) | |
1752 | - Filter: (ctid = '(1,1)'::tid) | |
1753 | - -> Bitmap Index Scan on t2_pkey | |
1754 | - Index Cond: (id = t1.id) | |
1755 | -(8 rows) | |
1756 | - | |
1757 | -/*+BitmapScan(t1) SeqScan(t2)*/ | |
1758 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1759 | -LOG: pg_hint_plan: | |
1760 | -used hint: | |
1761 | -BitmapScan(t1) | |
1762 | -SeqScan(t2) | |
1763 | -not used hint: | |
1764 | -duplication hint: | |
1765 | -error hint: | |
1766 | - | |
1767 | - QUERY PLAN | |
1768 | ------------------------------------------- | |
1769 | - Nested Loop | |
1770 | - -> Seq Scan on t2 | |
1771 | - Filter: (ctid = '(1,1)'::tid) | |
1772 | - -> Bitmap Heap Scan on t1 | |
1773 | - Recheck Cond: (id = t2.id) | |
1774 | - Filter: (ctid = '(1,1)'::tid) | |
1775 | - -> Bitmap Index Scan on t1_pkey | |
1776 | - Index Cond: (id = t2.id) | |
1777 | -(8 rows) | |
1778 | - | |
1779 | -/*+BitmapScan(t1) IndexScan(t2)*/ | |
1780 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1781 | -LOG: pg_hint_plan: | |
1782 | -used hint: | |
1783 | -BitmapScan(t1) | |
1784 | -IndexScan(t2) | |
1785 | -not used hint: | |
1786 | -duplication hint: | |
1787 | -error hint: | |
1788 | - | |
1789 | - QUERY PLAN | |
1790 | ------------------------------------------- | |
1791 | - Nested Loop | |
1792 | - -> Index Scan using t2_pkey on t2 | |
1793 | - Filter: (ctid = '(1,1)'::tid) | |
1794 | - -> Bitmap Heap Scan on t1 | |
1795 | - Recheck Cond: (id = t2.id) | |
1796 | - Filter: (ctid = '(1,1)'::tid) | |
1797 | - -> Bitmap Index Scan on t1_pkey | |
1798 | - Index Cond: (id = t2.id) | |
1799 | -(8 rows) | |
1800 | - | |
1801 | -/*+BitmapScan(t1) BitmapScan(t2)*/ | |
1802 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1803 | -LOG: pg_hint_plan: | |
1804 | -used hint: | |
1805 | -BitmapScan(t1) | |
1806 | -BitmapScan(t2) | |
1807 | -not used hint: | |
1808 | -duplication hint: | |
1809 | -error hint: | |
1810 | - | |
1811 | - QUERY PLAN | |
1812 | ------------------------------------------- | |
1813 | - Nested Loop | |
1814 | - -> Index Scan using t2_pkey on t2 | |
1815 | - Filter: (ctid = '(1,1)'::tid) | |
1816 | - -> Bitmap Heap Scan on t1 | |
1817 | - Recheck Cond: (id = t2.id) | |
1818 | - Filter: (ctid = '(1,1)'::tid) | |
1819 | - -> Bitmap Index Scan on t1_pkey | |
1820 | - Index Cond: (id = t2.id) | |
1821 | -(8 rows) | |
1822 | - | |
1823 | -/*+BitmapScan(t1) TidScan(t2)*/ | |
1824 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1825 | -LOG: pg_hint_plan: | |
1826 | -used hint: | |
1827 | -BitmapScan(t1) | |
1828 | -TidScan(t2) | |
1829 | -not used hint: | |
1830 | -duplication hint: | |
1831 | -error hint: | |
1832 | - | |
1833 | - QUERY PLAN | |
1834 | ------------------------------------------- | |
1835 | - Nested Loop | |
1836 | - -> Tid Scan on t2 | |
1837 | - TID Cond: (ctid = '(1,1)'::tid) | |
1838 | - -> Bitmap Heap Scan on t1 | |
1839 | - Recheck Cond: (id = t2.id) | |
1840 | - Filter: (ctid = '(1,1)'::tid) | |
1841 | - -> Bitmap Index Scan on t1_pkey | |
1842 | - Index Cond: (id = t2.id) | |
1843 | -(8 rows) | |
1844 | - | |
1845 | -/*+BitmapScan(t1) NoSeqScan(t2)*/ | |
1846 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1847 | -LOG: pg_hint_plan: | |
1848 | -used hint: | |
1849 | -BitmapScan(t1) | |
1850 | -NoSeqScan(t2) | |
1851 | -not used hint: | |
1852 | -duplication hint: | |
1853 | -error hint: | |
1854 | - | |
1855 | - QUERY PLAN | |
1856 | ------------------------------------------- | |
1857 | - Nested Loop | |
1858 | - -> Tid Scan on t2 | |
1859 | - TID Cond: (ctid = '(1,1)'::tid) | |
1860 | - -> Bitmap Heap Scan on t1 | |
1861 | - Recheck Cond: (id = t2.id) | |
1862 | - Filter: (ctid = '(1,1)'::tid) | |
1863 | - -> Bitmap Index Scan on t1_pkey | |
1864 | - Index Cond: (id = t2.id) | |
1865 | -(8 rows) | |
1866 | - | |
1867 | -/*+BitmapScan(t1) NoIndexScan(t2)*/ | |
1868 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1869 | -LOG: pg_hint_plan: | |
1870 | -used hint: | |
1871 | -BitmapScan(t1) | |
1872 | -NoIndexScan(t2) | |
1873 | -not used hint: | |
1874 | -duplication hint: | |
1875 | -error hint: | |
1876 | - | |
1877 | - QUERY PLAN | |
1878 | ------------------------------------------- | |
1879 | - Nested Loop | |
1880 | - -> Tid Scan on t2 | |
1881 | - TID Cond: (ctid = '(1,1)'::tid) | |
1882 | - -> Bitmap Heap Scan on t1 | |
1883 | - Recheck Cond: (id = t2.id) | |
1884 | - Filter: (ctid = '(1,1)'::tid) | |
1885 | - -> Bitmap Index Scan on t1_pkey | |
1886 | - Index Cond: (id = t2.id) | |
1887 | -(8 rows) | |
1888 | - | |
1889 | -/*+BitmapScan(t1) NoBitmapScan(t2)*/ | |
1890 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1891 | -LOG: pg_hint_plan: | |
1892 | -used hint: | |
1893 | -BitmapScan(t1) | |
1894 | -NoBitmapScan(t2) | |
1895 | -not used hint: | |
1896 | -duplication hint: | |
1897 | -error hint: | |
1898 | - | |
1899 | - QUERY PLAN | |
1900 | ------------------------------------------- | |
1901 | - Nested Loop | |
1902 | - -> Tid Scan on t2 | |
1903 | - TID Cond: (ctid = '(1,1)'::tid) | |
1904 | - -> Bitmap Heap Scan on t1 | |
1905 | - Recheck Cond: (id = t2.id) | |
1906 | - Filter: (ctid = '(1,1)'::tid) | |
1907 | - -> Bitmap Index Scan on t1_pkey | |
1908 | - Index Cond: (id = t2.id) | |
1909 | -(8 rows) | |
1910 | - | |
1911 | -/*+BitmapScan(t1) NoTidScan(t2)*/ | |
1912 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1913 | -LOG: pg_hint_plan: | |
1914 | -used hint: | |
1915 | -BitmapScan(t1) | |
1916 | -NoTidScan(t2) | |
1917 | -not used hint: | |
1918 | -duplication hint: | |
1919 | -error hint: | |
1920 | - | |
1921 | - QUERY PLAN | |
1922 | ------------------------------------------- | |
1923 | - Nested Loop | |
1924 | - -> Seq Scan on t2 | |
1925 | - Filter: (ctid = '(1,1)'::tid) | |
1926 | - -> Bitmap Heap Scan on t1 | |
1927 | - Recheck Cond: (id = t2.id) | |
1928 | - Filter: (ctid = '(1,1)'::tid) | |
1929 | - -> Bitmap Index Scan on t1_pkey | |
1930 | - Index Cond: (id = t2.id) | |
1931 | -(8 rows) | |
1932 | - | |
1933 | -/*+TidScan(t1)*/ | |
1934 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1935 | -LOG: pg_hint_plan: | |
1936 | -used hint: | |
1937 | -TidScan(t1) | |
1938 | -not used hint: | |
1939 | -duplication hint: | |
1940 | -error hint: | |
1941 | - | |
1942 | - QUERY PLAN | |
1943 | ------------------------------------------ | |
1944 | - Nested Loop | |
1945 | - Join Filter: (t1.id = t2.id) | |
1946 | - -> Tid Scan on t1 | |
1947 | - TID Cond: (ctid = '(1,1)'::tid) | |
1948 | - -> Tid Scan on t2 | |
1949 | - TID Cond: (ctid = '(1,1)'::tid) | |
1950 | -(6 rows) | |
1951 | - | |
1952 | -/*+TidScan(t2)*/ | |
1953 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1954 | -LOG: pg_hint_plan: | |
1955 | -used hint: | |
1956 | -TidScan(t2) | |
1957 | -not used hint: | |
1958 | -duplication hint: | |
1959 | -error hint: | |
1960 | - | |
1961 | - QUERY PLAN | |
1962 | ------------------------------------------ | |
1963 | - Nested Loop | |
1964 | - Join Filter: (t1.id = t2.id) | |
1965 | - -> Tid Scan on t1 | |
1966 | - TID Cond: (ctid = '(1,1)'::tid) | |
1967 | - -> Tid Scan on t2 | |
1968 | - TID Cond: (ctid = '(1,1)'::tid) | |
1969 | -(6 rows) | |
1970 | - | |
1971 | -/*+TidScan(t1) SeqScan(t2)*/ | |
1972 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1973 | -LOG: pg_hint_plan: | |
1974 | -used hint: | |
1975 | -TidScan(t1) | |
1976 | -SeqScan(t2) | |
1977 | -not used hint: | |
1978 | -duplication hint: | |
1979 | -error hint: | |
1980 | - | |
1981 | - QUERY PLAN | |
1982 | ------------------------------------------ | |
1983 | - Nested Loop | |
1984 | - Join Filter: (t1.id = t2.id) | |
1985 | - -> Tid Scan on t1 | |
1986 | - TID Cond: (ctid = '(1,1)'::tid) | |
1987 | - -> Seq Scan on t2 | |
1988 | - Filter: (ctid = '(1,1)'::tid) | |
1989 | -(6 rows) | |
1990 | - | |
1991 | -/*+TidScan(t1) IndexScan(t2)*/ | |
1992 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
1993 | -LOG: pg_hint_plan: | |
1994 | -used hint: | |
1995 | -TidScan(t1) | |
1996 | -IndexScan(t2) | |
1997 | -not used hint: | |
1998 | -duplication hint: | |
1999 | -error hint: | |
2000 | - | |
2001 | - QUERY PLAN | |
2002 | ------------------------------------------ | |
2003 | - Nested Loop | |
2004 | - -> Tid Scan on t1 | |
2005 | - TID Cond: (ctid = '(1,1)'::tid) | |
2006 | - -> Index Scan using t2_pkey on t2 | |
2007 | - Index Cond: (id = t1.id) | |
2008 | - Filter: (ctid = '(1,1)'::tid) | |
2009 | -(6 rows) | |
2010 | - | |
2011 | -/*+TidScan(t1) BitmapScan(t2)*/ | |
2012 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2013 | -LOG: pg_hint_plan: | |
2014 | -used hint: | |
2015 | -TidScan(t1) | |
2016 | -BitmapScan(t2) | |
2017 | -not used hint: | |
2018 | -duplication hint: | |
2019 | -error hint: | |
2020 | - | |
2021 | - QUERY PLAN | |
2022 | ------------------------------------------- | |
2023 | - Nested Loop | |
2024 | - -> Tid Scan on t1 | |
2025 | - TID Cond: (ctid = '(1,1)'::tid) | |
2026 | - -> Bitmap Heap Scan on t2 | |
2027 | - Recheck Cond: (id = t1.id) | |
2028 | - Filter: (ctid = '(1,1)'::tid) | |
2029 | - -> Bitmap Index Scan on t2_pkey | |
2030 | - Index Cond: (id = t1.id) | |
2031 | -(8 rows) | |
2032 | - | |
2033 | -/*+TidScan(t1) TidScan(t2)*/ | |
2034 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2035 | -LOG: pg_hint_plan: | |
2036 | -used hint: | |
2037 | -TidScan(t1) | |
2038 | -TidScan(t2) | |
2039 | -not used hint: | |
2040 | -duplication hint: | |
2041 | -error hint: | |
2042 | - | |
2043 | - QUERY PLAN | |
2044 | ------------------------------------------ | |
2045 | - Nested Loop | |
2046 | - Join Filter: (t1.id = t2.id) | |
2047 | - -> Tid Scan on t1 | |
2048 | - TID Cond: (ctid = '(1,1)'::tid) | |
2049 | - -> Tid Scan on t2 | |
2050 | - TID Cond: (ctid = '(1,1)'::tid) | |
2051 | -(6 rows) | |
2052 | - | |
2053 | -/*+TidScan(t1) NoSeqScan(t2)*/ | |
2054 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2055 | -LOG: pg_hint_plan: | |
2056 | -used hint: | |
2057 | -TidScan(t1) | |
2058 | -NoSeqScan(t2) | |
2059 | -not used hint: | |
2060 | -duplication hint: | |
2061 | -error hint: | |
2062 | - | |
2063 | - QUERY PLAN | |
2064 | ------------------------------------------ | |
2065 | - Nested Loop | |
2066 | - Join Filter: (t1.id = t2.id) | |
2067 | - -> Tid Scan on t1 | |
2068 | - TID Cond: (ctid = '(1,1)'::tid) | |
2069 | - -> Tid Scan on t2 | |
2070 | - TID Cond: (ctid = '(1,1)'::tid) | |
2071 | -(6 rows) | |
2072 | - | |
2073 | -/*+TidScan(t1) NoIndexScan(t2)*/ | |
2074 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2075 | -LOG: pg_hint_plan: | |
2076 | -used hint: | |
2077 | -TidScan(t1) | |
2078 | -NoIndexScan(t2) | |
2079 | -not used hint: | |
2080 | -duplication hint: | |
2081 | -error hint: | |
2082 | - | |
2083 | - QUERY PLAN | |
2084 | ------------------------------------------ | |
2085 | - Nested Loop | |
2086 | - Join Filter: (t1.id = t2.id) | |
2087 | - -> Tid Scan on t1 | |
2088 | - TID Cond: (ctid = '(1,1)'::tid) | |
2089 | - -> Tid Scan on t2 | |
2090 | - TID Cond: (ctid = '(1,1)'::tid) | |
2091 | -(6 rows) | |
2092 | - | |
2093 | -/*+TidScan(t1) NoBitmapScan(t2)*/ | |
2094 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2095 | -LOG: pg_hint_plan: | |
2096 | -used hint: | |
2097 | -TidScan(t1) | |
2098 | -NoBitmapScan(t2) | |
2099 | -not used hint: | |
2100 | -duplication hint: | |
2101 | -error hint: | |
2102 | - | |
2103 | - QUERY PLAN | |
2104 | ------------------------------------------ | |
2105 | - Nested Loop | |
2106 | - Join Filter: (t1.id = t2.id) | |
2107 | - -> Tid Scan on t1 | |
2108 | - TID Cond: (ctid = '(1,1)'::tid) | |
2109 | - -> Tid Scan on t2 | |
2110 | - TID Cond: (ctid = '(1,1)'::tid) | |
2111 | -(6 rows) | |
2112 | - | |
2113 | -/*+TidScan(t1) NoTidScan(t2)*/ | |
2114 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2115 | -LOG: pg_hint_plan: | |
2116 | -used hint: | |
2117 | -TidScan(t1) | |
2118 | -NoTidScan(t2) | |
2119 | -not used hint: | |
2120 | -duplication hint: | |
2121 | -error hint: | |
2122 | - | |
2123 | - QUERY PLAN | |
2124 | ------------------------------------------ | |
2125 | - Nested Loop | |
2126 | - -> Tid Scan on t1 | |
2127 | - TID Cond: (ctid = '(1,1)'::tid) | |
2128 | - -> Index Scan using t2_pkey on t2 | |
2129 | - Index Cond: (id = t1.id) | |
2130 | - Filter: (ctid = '(1,1)'::tid) | |
2131 | -(6 rows) | |
2132 | - | |
2133 | -/*+NoSeqScan(t1)*/ | |
2134 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2135 | -LOG: pg_hint_plan: | |
2136 | -used hint: | |
2137 | -NoSeqScan(t1) | |
2138 | -not used hint: | |
2139 | -duplication hint: | |
2140 | -error hint: | |
2141 | - | |
2142 | - QUERY PLAN | |
2143 | ------------------------------------------ | |
2144 | - Nested Loop | |
2145 | - Join Filter: (t1.id = t2.id) | |
2146 | - -> Tid Scan on t1 | |
2147 | - TID Cond: (ctid = '(1,1)'::tid) | |
2148 | - -> Tid Scan on t2 | |
2149 | - TID Cond: (ctid = '(1,1)'::tid) | |
2150 | -(6 rows) | |
2151 | - | |
2152 | -/*+NoSeqScan(t2)*/ | |
2153 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2154 | -LOG: pg_hint_plan: | |
2155 | -used hint: | |
2156 | -NoSeqScan(t2) | |
2157 | -not used hint: | |
2158 | -duplication hint: | |
2159 | -error hint: | |
2160 | - | |
2161 | - QUERY PLAN | |
2162 | ------------------------------------------ | |
2163 | - Nested Loop | |
2164 | - Join Filter: (t1.id = t2.id) | |
2165 | - -> Tid Scan on t1 | |
2166 | - TID Cond: (ctid = '(1,1)'::tid) | |
2167 | - -> Tid Scan on t2 | |
2168 | - TID Cond: (ctid = '(1,1)'::tid) | |
2169 | -(6 rows) | |
2170 | - | |
2171 | -/*+NoSeqScan(t1) SeqScan(t2)*/ | |
2172 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2173 | -LOG: pg_hint_plan: | |
2174 | -used hint: | |
2175 | -NoSeqScan(t1) | |
2176 | -SeqScan(t2) | |
2177 | -not used hint: | |
2178 | -duplication hint: | |
2179 | -error hint: | |
2180 | - | |
2181 | - QUERY PLAN | |
2182 | ------------------------------------------ | |
2183 | - Nested Loop | |
2184 | - Join Filter: (t1.id = t2.id) | |
2185 | - -> Tid Scan on t1 | |
2186 | - TID Cond: (ctid = '(1,1)'::tid) | |
2187 | - -> Seq Scan on t2 | |
2188 | - Filter: (ctid = '(1,1)'::tid) | |
2189 | -(6 rows) | |
2190 | - | |
2191 | -/*+NoSeqScan(t1) IndexScan(t2)*/ | |
2192 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2193 | -LOG: pg_hint_plan: | |
2194 | -used hint: | |
2195 | -NoSeqScan(t1) | |
2196 | -IndexScan(t2) | |
2197 | -not used hint: | |
2198 | -duplication hint: | |
2199 | -error hint: | |
2200 | - | |
2201 | - QUERY PLAN | |
2202 | ------------------------------------------ | |
2203 | - Nested Loop | |
2204 | - -> Tid Scan on t1 | |
2205 | - TID Cond: (ctid = '(1,1)'::tid) | |
2206 | - -> Index Scan using t2_pkey on t2 | |
2207 | - Index Cond: (id = t1.id) | |
2208 | - Filter: (ctid = '(1,1)'::tid) | |
2209 | -(6 rows) | |
2210 | - | |
2211 | -/*+NoSeqScan(t1) BitmapScan(t2)*/ | |
2212 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2213 | -LOG: pg_hint_plan: | |
2214 | -used hint: | |
2215 | -NoSeqScan(t1) | |
2216 | -BitmapScan(t2) | |
2217 | -not used hint: | |
2218 | -duplication hint: | |
2219 | -error hint: | |
2220 | - | |
2221 | - QUERY PLAN | |
2222 | ------------------------------------------- | |
2223 | - Nested Loop | |
2224 | - -> Tid Scan on t1 | |
2225 | - TID Cond: (ctid = '(1,1)'::tid) | |
2226 | - -> Bitmap Heap Scan on t2 | |
2227 | - Recheck Cond: (id = t1.id) | |
2228 | - Filter: (ctid = '(1,1)'::tid) | |
2229 | - -> Bitmap Index Scan on t2_pkey | |
2230 | - Index Cond: (id = t1.id) | |
2231 | -(8 rows) | |
2232 | - | |
2233 | -/*+NoSeqScan(t1) TidScan(t2)*/ | |
2234 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2235 | -LOG: pg_hint_plan: | |
2236 | -used hint: | |
2237 | -NoSeqScan(t1) | |
2238 | -TidScan(t2) | |
2239 | -not used hint: | |
2240 | -duplication hint: | |
2241 | -error hint: | |
2242 | - | |
2243 | - QUERY PLAN | |
2244 | ------------------------------------------ | |
2245 | - Nested Loop | |
2246 | - Join Filter: (t1.id = t2.id) | |
2247 | - -> Tid Scan on t1 | |
2248 | - TID Cond: (ctid = '(1,1)'::tid) | |
2249 | - -> Tid Scan on t2 | |
2250 | - TID Cond: (ctid = '(1,1)'::tid) | |
2251 | -(6 rows) | |
2252 | - | |
2253 | -/*+NoSeqScan(t1) NoSeqScan(t2)*/ | |
2254 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2255 | -LOG: pg_hint_plan: | |
2256 | -used hint: | |
2257 | -NoSeqScan(t1) | |
2258 | -NoSeqScan(t2) | |
2259 | -not used hint: | |
2260 | -duplication hint: | |
2261 | -error hint: | |
2262 | - | |
2263 | - QUERY PLAN | |
2264 | ------------------------------------------ | |
2265 | - Nested Loop | |
2266 | - Join Filter: (t1.id = t2.id) | |
2267 | - -> Tid Scan on t1 | |
2268 | - TID Cond: (ctid = '(1,1)'::tid) | |
2269 | - -> Tid Scan on t2 | |
2270 | - TID Cond: (ctid = '(1,1)'::tid) | |
2271 | -(6 rows) | |
2272 | - | |
2273 | -/*+NoSeqScan(t1) NoIndexScan(t2)*/ | |
2274 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2275 | -LOG: pg_hint_plan: | |
2276 | -used hint: | |
2277 | -NoSeqScan(t1) | |
2278 | -NoIndexScan(t2) | |
2279 | -not used hint: | |
2280 | -duplication hint: | |
2281 | -error hint: | |
2282 | - | |
2283 | - QUERY PLAN | |
2284 | ------------------------------------------ | |
2285 | - Nested Loop | |
2286 | - Join Filter: (t1.id = t2.id) | |
2287 | - -> Tid Scan on t1 | |
2288 | - TID Cond: (ctid = '(1,1)'::tid) | |
2289 | - -> Tid Scan on t2 | |
2290 | - TID Cond: (ctid = '(1,1)'::tid) | |
2291 | -(6 rows) | |
2292 | - | |
2293 | -/*+NoSeqScan(t1) NoBitmapScan(t2)*/ | |
2294 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2295 | -LOG: pg_hint_plan: | |
2296 | -used hint: | |
2297 | -NoSeqScan(t1) | |
2298 | -NoBitmapScan(t2) | |
2299 | -not used hint: | |
2300 | -duplication hint: | |
2301 | -error hint: | |
2302 | - | |
2303 | - QUERY PLAN | |
2304 | ------------------------------------------ | |
2305 | - Nested Loop | |
2306 | - Join Filter: (t1.id = t2.id) | |
2307 | - -> Tid Scan on t1 | |
2308 | - TID Cond: (ctid = '(1,1)'::tid) | |
2309 | - -> Tid Scan on t2 | |
2310 | - TID Cond: (ctid = '(1,1)'::tid) | |
2311 | -(6 rows) | |
2312 | - | |
2313 | -/*+NoSeqScan(t1) NoTidScan(t2)*/ | |
2314 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2315 | -LOG: pg_hint_plan: | |
2316 | -used hint: | |
2317 | -NoSeqScan(t1) | |
2318 | -NoTidScan(t2) | |
2319 | -not used hint: | |
2320 | -duplication hint: | |
2321 | -error hint: | |
2322 | - | |
2323 | - QUERY PLAN | |
2324 | ------------------------------------------ | |
2325 | - Nested Loop | |
2326 | - -> Tid Scan on t1 | |
2327 | - TID Cond: (ctid = '(1,1)'::tid) | |
2328 | - -> Index Scan using t2_pkey on t2 | |
2329 | - Index Cond: (id = t1.id) | |
2330 | - Filter: (ctid = '(1,1)'::tid) | |
2331 | -(6 rows) | |
2332 | - | |
2333 | -/*+NoIndexScan(t1)*/ | |
2334 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2335 | -LOG: pg_hint_plan: | |
2336 | -used hint: | |
2337 | -NoIndexScan(t1) | |
2338 | -not used hint: | |
2339 | -duplication hint: | |
2340 | -error hint: | |
2341 | - | |
2342 | - QUERY PLAN | |
2343 | ------------------------------------------ | |
2344 | - Nested Loop | |
2345 | - Join Filter: (t1.id = t2.id) | |
2346 | - -> Tid Scan on t1 | |
2347 | - TID Cond: (ctid = '(1,1)'::tid) | |
2348 | - -> Tid Scan on t2 | |
2349 | - TID Cond: (ctid = '(1,1)'::tid) | |
2350 | -(6 rows) | |
2351 | - | |
2352 | -/*+NoIndexScan(t2)*/ | |
2353 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2354 | -LOG: pg_hint_plan: | |
2355 | -used hint: | |
2356 | -NoIndexScan(t2) | |
2357 | -not used hint: | |
2358 | -duplication hint: | |
2359 | -error hint: | |
2360 | - | |
2361 | - QUERY PLAN | |
2362 | ------------------------------------------ | |
2363 | - Nested Loop | |
2364 | - Join Filter: (t1.id = t2.id) | |
2365 | - -> Tid Scan on t1 | |
2366 | - TID Cond: (ctid = '(1,1)'::tid) | |
2367 | - -> Tid Scan on t2 | |
2368 | - TID Cond: (ctid = '(1,1)'::tid) | |
2369 | -(6 rows) | |
2370 | - | |
2371 | -/*+NoIndexScan(t1) SeqScan(t2)*/ | |
2372 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2373 | -LOG: pg_hint_plan: | |
2374 | -used hint: | |
2375 | -NoIndexScan(t1) | |
2376 | -SeqScan(t2) | |
2377 | -not used hint: | |
2378 | -duplication hint: | |
2379 | -error hint: | |
2380 | - | |
2381 | - QUERY PLAN | |
2382 | ------------------------------------------ | |
2383 | - Nested Loop | |
2384 | - Join Filter: (t1.id = t2.id) | |
2385 | - -> Tid Scan on t1 | |
2386 | - TID Cond: (ctid = '(1,1)'::tid) | |
2387 | - -> Seq Scan on t2 | |
2388 | - Filter: (ctid = '(1,1)'::tid) | |
2389 | -(6 rows) | |
2390 | - | |
2391 | -/*+NoIndexScan(t1) IndexScan(t2)*/ | |
2392 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2393 | -LOG: pg_hint_plan: | |
2394 | -used hint: | |
2395 | -NoIndexScan(t1) | |
2396 | -IndexScan(t2) | |
2397 | -not used hint: | |
2398 | -duplication hint: | |
2399 | -error hint: | |
2400 | - | |
2401 | - QUERY PLAN | |
2402 | ------------------------------------------ | |
2403 | - Nested Loop | |
2404 | - -> Tid Scan on t1 | |
2405 | - TID Cond: (ctid = '(1,1)'::tid) | |
2406 | - -> Index Scan using t2_pkey on t2 | |
2407 | - Index Cond: (id = t1.id) | |
2408 | - Filter: (ctid = '(1,1)'::tid) | |
2409 | -(6 rows) | |
2410 | - | |
2411 | -/*+NoIndexScan(t1) BitmapScan(t2)*/ | |
2412 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2413 | -LOG: pg_hint_plan: | |
2414 | -used hint: | |
2415 | -NoIndexScan(t1) | |
2416 | -BitmapScan(t2) | |
2417 | -not used hint: | |
2418 | -duplication hint: | |
2419 | -error hint: | |
2420 | - | |
2421 | - QUERY PLAN | |
2422 | ------------------------------------------- | |
2423 | - Nested Loop | |
2424 | - -> Tid Scan on t1 | |
2425 | - TID Cond: (ctid = '(1,1)'::tid) | |
2426 | - -> Bitmap Heap Scan on t2 | |
2427 | - Recheck Cond: (id = t1.id) | |
2428 | - Filter: (ctid = '(1,1)'::tid) | |
2429 | - -> Bitmap Index Scan on t2_pkey | |
2430 | - Index Cond: (id = t1.id) | |
2431 | -(8 rows) | |
2432 | - | |
2433 | -/*+NoIndexScan(t1) TidScan(t2)*/ | |
2434 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2435 | -LOG: pg_hint_plan: | |
2436 | -used hint: | |
2437 | -NoIndexScan(t1) | |
2438 | -TidScan(t2) | |
2439 | -not used hint: | |
2440 | -duplication hint: | |
2441 | -error hint: | |
2442 | - | |
2443 | - QUERY PLAN | |
2444 | ------------------------------------------ | |
2445 | - Nested Loop | |
2446 | - Join Filter: (t1.id = t2.id) | |
2447 | - -> Tid Scan on t1 | |
2448 | - TID Cond: (ctid = '(1,1)'::tid) | |
2449 | - -> Tid Scan on t2 | |
2450 | - TID Cond: (ctid = '(1,1)'::tid) | |
2451 | -(6 rows) | |
2452 | - | |
2453 | -/*+NoIndexScan(t1) NoSeqScan(t2)*/ | |
2454 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2455 | -LOG: pg_hint_plan: | |
2456 | -used hint: | |
2457 | -NoIndexScan(t1) | |
2458 | -NoSeqScan(t2) | |
2459 | -not used hint: | |
2460 | -duplication hint: | |
2461 | -error hint: | |
2462 | - | |
2463 | - QUERY PLAN | |
2464 | ------------------------------------------ | |
2465 | - Nested Loop | |
2466 | - Join Filter: (t1.id = t2.id) | |
2467 | - -> Tid Scan on t1 | |
2468 | - TID Cond: (ctid = '(1,1)'::tid) | |
2469 | - -> Tid Scan on t2 | |
2470 | - TID Cond: (ctid = '(1,1)'::tid) | |
2471 | -(6 rows) | |
2472 | - | |
2473 | -/*+NoIndexScan(t1) NoIndexScan(t2)*/ | |
2474 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2475 | -LOG: pg_hint_plan: | |
2476 | -used hint: | |
2477 | -NoIndexScan(t1) | |
2478 | -NoIndexScan(t2) | |
2479 | -not used hint: | |
2480 | -duplication hint: | |
2481 | -error hint: | |
2482 | - | |
2483 | - QUERY PLAN | |
2484 | ------------------------------------------ | |
2485 | - Nested Loop | |
2486 | - Join Filter: (t1.id = t2.id) | |
2487 | - -> Tid Scan on t1 | |
2488 | - TID Cond: (ctid = '(1,1)'::tid) | |
2489 | - -> Tid Scan on t2 | |
2490 | - TID Cond: (ctid = '(1,1)'::tid) | |
2491 | -(6 rows) | |
2492 | - | |
2493 | -/*+NoIndexScan(t1) NoBitmapScan(t2)*/ | |
2494 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2495 | -LOG: pg_hint_plan: | |
2496 | -used hint: | |
2497 | -NoIndexScan(t1) | |
2498 | -NoBitmapScan(t2) | |
2499 | -not used hint: | |
2500 | -duplication hint: | |
2501 | -error hint: | |
2502 | - | |
2503 | - QUERY PLAN | |
2504 | ------------------------------------------ | |
2505 | - Nested Loop | |
2506 | - Join Filter: (t1.id = t2.id) | |
2507 | - -> Tid Scan on t1 | |
2508 | - TID Cond: (ctid = '(1,1)'::tid) | |
2509 | - -> Tid Scan on t2 | |
2510 | - TID Cond: (ctid = '(1,1)'::tid) | |
2511 | -(6 rows) | |
2512 | - | |
2513 | -/*+NoIndexScan(t1) NoTidScan(t2)*/ | |
2514 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2515 | -LOG: pg_hint_plan: | |
2516 | -used hint: | |
2517 | -NoIndexScan(t1) | |
2518 | -NoTidScan(t2) | |
2519 | -not used hint: | |
2520 | -duplication hint: | |
2521 | -error hint: | |
2522 | - | |
2523 | - QUERY PLAN | |
2524 | ------------------------------------------ | |
2525 | - Nested Loop | |
2526 | - -> Tid Scan on t1 | |
2527 | - TID Cond: (ctid = '(1,1)'::tid) | |
2528 | - -> Index Scan using t2_pkey on t2 | |
2529 | - Index Cond: (id = t1.id) | |
2530 | - Filter: (ctid = '(1,1)'::tid) | |
2531 | -(6 rows) | |
2532 | - | |
2533 | -/*+NoBitmapScan(t1)*/ | |
2534 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2535 | -LOG: pg_hint_plan: | |
2536 | -used hint: | |
2537 | -NoBitmapScan(t1) | |
2538 | -not used hint: | |
2539 | -duplication hint: | |
2540 | -error hint: | |
2541 | - | |
2542 | - QUERY PLAN | |
2543 | ------------------------------------------ | |
2544 | - Nested Loop | |
2545 | - Join Filter: (t1.id = t2.id) | |
2546 | - -> Tid Scan on t1 | |
2547 | - TID Cond: (ctid = '(1,1)'::tid) | |
2548 | - -> Tid Scan on t2 | |
2549 | - TID Cond: (ctid = '(1,1)'::tid) | |
2550 | -(6 rows) | |
2551 | - | |
2552 | -/*+NoBitmapScan(t2)*/ | |
2553 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2554 | -LOG: pg_hint_plan: | |
2555 | -used hint: | |
2556 | -NoBitmapScan(t2) | |
2557 | -not used hint: | |
2558 | -duplication hint: | |
2559 | -error hint: | |
2560 | - | |
2561 | - QUERY PLAN | |
2562 | ------------------------------------------ | |
2563 | - Nested Loop | |
2564 | - Join Filter: (t1.id = t2.id) | |
2565 | - -> Tid Scan on t1 | |
2566 | - TID Cond: (ctid = '(1,1)'::tid) | |
2567 | - -> Tid Scan on t2 | |
2568 | - TID Cond: (ctid = '(1,1)'::tid) | |
2569 | -(6 rows) | |
2570 | - | |
2571 | -/*+NoBitmapScan(t1) SeqScan(t2)*/ | |
2572 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2573 | -LOG: pg_hint_plan: | |
2574 | -used hint: | |
2575 | -NoBitmapScan(t1) | |
2576 | -SeqScan(t2) | |
2577 | -not used hint: | |
2578 | -duplication hint: | |
2579 | -error hint: | |
2580 | - | |
2581 | - QUERY PLAN | |
2582 | ------------------------------------------ | |
2583 | - Nested Loop | |
2584 | - Join Filter: (t1.id = t2.id) | |
2585 | - -> Tid Scan on t1 | |
2586 | - TID Cond: (ctid = '(1,1)'::tid) | |
2587 | - -> Seq Scan on t2 | |
2588 | - Filter: (ctid = '(1,1)'::tid) | |
2589 | -(6 rows) | |
2590 | - | |
2591 | -/*+NoBitmapScan(t1) IndexScan(t2)*/ | |
2592 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2593 | -LOG: pg_hint_plan: | |
2594 | -used hint: | |
2595 | -NoBitmapScan(t1) | |
2596 | -IndexScan(t2) | |
2597 | -not used hint: | |
2598 | -duplication hint: | |
2599 | -error hint: | |
2600 | - | |
2601 | - QUERY PLAN | |
2602 | ------------------------------------------ | |
2603 | - Nested Loop | |
2604 | - -> Tid Scan on t1 | |
2605 | - TID Cond: (ctid = '(1,1)'::tid) | |
2606 | - -> Index Scan using t2_pkey on t2 | |
2607 | - Index Cond: (id = t1.id) | |
2608 | - Filter: (ctid = '(1,1)'::tid) | |
2609 | -(6 rows) | |
2610 | - | |
2611 | -/*+NoBitmapScan(t1) BitmapScan(t2)*/ | |
2612 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2613 | -LOG: pg_hint_plan: | |
2614 | -used hint: | |
2615 | -NoBitmapScan(t1) | |
2616 | -BitmapScan(t2) | |
2617 | -not used hint: | |
2618 | -duplication hint: | |
2619 | -error hint: | |
2620 | - | |
2621 | - QUERY PLAN | |
2622 | ------------------------------------------- | |
2623 | - Nested Loop | |
2624 | - -> Tid Scan on t1 | |
2625 | - TID Cond: (ctid = '(1,1)'::tid) | |
2626 | - -> Bitmap Heap Scan on t2 | |
2627 | - Recheck Cond: (id = t1.id) | |
2628 | - Filter: (ctid = '(1,1)'::tid) | |
2629 | - -> Bitmap Index Scan on t2_pkey | |
2630 | - Index Cond: (id = t1.id) | |
2631 | -(8 rows) | |
2632 | - | |
2633 | -/*+NoBitmapScan(t1) TidScan(t2)*/ | |
2634 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2635 | -LOG: pg_hint_plan: | |
2636 | -used hint: | |
2637 | -NoBitmapScan(t1) | |
2638 | -TidScan(t2) | |
2639 | -not used hint: | |
2640 | -duplication hint: | |
2641 | -error hint: | |
2642 | - | |
2643 | - QUERY PLAN | |
2644 | ------------------------------------------ | |
2645 | - Nested Loop | |
2646 | - Join Filter: (t1.id = t2.id) | |
2647 | - -> Tid Scan on t1 | |
2648 | - TID Cond: (ctid = '(1,1)'::tid) | |
2649 | - -> Tid Scan on t2 | |
2650 | - TID Cond: (ctid = '(1,1)'::tid) | |
2651 | -(6 rows) | |
2652 | - | |
2653 | -/*+NoBitmapScan(t1) NoSeqScan(t2)*/ | |
2654 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2655 | -LOG: pg_hint_plan: | |
2656 | -used hint: | |
2657 | -NoBitmapScan(t1) | |
2658 | -NoSeqScan(t2) | |
2659 | -not used hint: | |
2660 | -duplication hint: | |
2661 | -error hint: | |
2662 | - | |
2663 | - QUERY PLAN | |
2664 | ------------------------------------------ | |
2665 | - Nested Loop | |
2666 | - Join Filter: (t1.id = t2.id) | |
2667 | - -> Tid Scan on t1 | |
2668 | - TID Cond: (ctid = '(1,1)'::tid) | |
2669 | - -> Tid Scan on t2 | |
2670 | - TID Cond: (ctid = '(1,1)'::tid) | |
2671 | -(6 rows) | |
2672 | - | |
2673 | -/*+NoBitmapScan(t1) NoIndexScan(t2)*/ | |
2674 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2675 | -LOG: pg_hint_plan: | |
2676 | -used hint: | |
2677 | -NoBitmapScan(t1) | |
2678 | -NoIndexScan(t2) | |
2679 | -not used hint: | |
2680 | -duplication hint: | |
2681 | -error hint: | |
2682 | - | |
2683 | - QUERY PLAN | |
2684 | ------------------------------------------ | |
2685 | - Nested Loop | |
2686 | - Join Filter: (t1.id = t2.id) | |
2687 | - -> Tid Scan on t1 | |
2688 | - TID Cond: (ctid = '(1,1)'::tid) | |
2689 | - -> Tid Scan on t2 | |
2690 | - TID Cond: (ctid = '(1,1)'::tid) | |
2691 | -(6 rows) | |
2692 | - | |
2693 | -/*+NoBitmapScan(t1) NoBitmapScan(t2)*/ | |
2694 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2695 | -LOG: pg_hint_plan: | |
2696 | -used hint: | |
2697 | -NoBitmapScan(t1) | |
2698 | -NoBitmapScan(t2) | |
2699 | -not used hint: | |
2700 | -duplication hint: | |
2701 | -error hint: | |
2702 | - | |
2703 | - QUERY PLAN | |
2704 | ------------------------------------------ | |
2705 | - Nested Loop | |
2706 | - Join Filter: (t1.id = t2.id) | |
2707 | - -> Tid Scan on t1 | |
2708 | - TID Cond: (ctid = '(1,1)'::tid) | |
2709 | - -> Tid Scan on t2 | |
2710 | - TID Cond: (ctid = '(1,1)'::tid) | |
2711 | -(6 rows) | |
2712 | - | |
2713 | -/*+NoBitmapScan(t1) NoTidScan(t2)*/ | |
2714 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2715 | -LOG: pg_hint_plan: | |
2716 | -used hint: | |
2717 | -NoBitmapScan(t1) | |
2718 | -NoTidScan(t2) | |
2719 | -not used hint: | |
2720 | -duplication hint: | |
2721 | -error hint: | |
2722 | - | |
2723 | - QUERY PLAN | |
2724 | ------------------------------------------ | |
2725 | - Nested Loop | |
2726 | - -> Tid Scan on t1 | |
2727 | - TID Cond: (ctid = '(1,1)'::tid) | |
2728 | - -> Index Scan using t2_pkey on t2 | |
2729 | - Index Cond: (id = t1.id) | |
2730 | - Filter: (ctid = '(1,1)'::tid) | |
2731 | -(6 rows) | |
2732 | - | |
2733 | -/*+NoTidScan(t1)*/ | |
2734 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2735 | -LOG: pg_hint_plan: | |
2736 | -used hint: | |
2737 | -NoTidScan(t1) | |
2738 | -not used hint: | |
2739 | -duplication hint: | |
2740 | -error hint: | |
2741 | - | |
2742 | - QUERY PLAN | |
2743 | ------------------------------------------ | |
2744 | - Nested Loop | |
2745 | - -> Tid Scan on t2 | |
2746 | - TID Cond: (ctid = '(1,1)'::tid) | |
2747 | - -> Index Scan using t1_pkey on t1 | |
2748 | - Index Cond: (id = t2.id) | |
2749 | - Filter: (ctid = '(1,1)'::tid) | |
2750 | -(6 rows) | |
2751 | - | |
2752 | -/*+NoTidScan(t2)*/ | |
2753 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2754 | -LOG: pg_hint_plan: | |
2755 | -used hint: | |
2756 | -NoTidScan(t2) | |
2757 | -not used hint: | |
2758 | -duplication hint: | |
2759 | -error hint: | |
2760 | - | |
2761 | - QUERY PLAN | |
2762 | ------------------------------------------ | |
2763 | - Nested Loop | |
2764 | - -> Tid Scan on t1 | |
2765 | - TID Cond: (ctid = '(1,1)'::tid) | |
2766 | - -> Index Scan using t2_pkey on t2 | |
2767 | - Index Cond: (id = t1.id) | |
2768 | - Filter: (ctid = '(1,1)'::tid) | |
2769 | -(6 rows) | |
2770 | - | |
2771 | -/*+NoTidScan(t1) SeqScan(t2)*/ | |
2772 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2773 | -LOG: pg_hint_plan: | |
2774 | -used hint: | |
2775 | -NoTidScan(t1) | |
2776 | -SeqScan(t2) | |
2777 | -not used hint: | |
2778 | -duplication hint: | |
2779 | -error hint: | |
2780 | - | |
2781 | - QUERY PLAN | |
2782 | ---------------------------------------- | |
2783 | - Nested Loop | |
2784 | - -> Seq Scan on t2 | |
2785 | - Filter: (ctid = '(1,1)'::tid) | |
2786 | - -> Index Scan using t1_pkey on t1 | |
2787 | - Index Cond: (id = t2.id) | |
2788 | - Filter: (ctid = '(1,1)'::tid) | |
2789 | -(6 rows) | |
2790 | - | |
2791 | -/*+NoTidScan(t1) IndexScan(t2)*/ | |
2792 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2793 | -LOG: pg_hint_plan: | |
2794 | -used hint: | |
2795 | -NoTidScan(t1) | |
2796 | -IndexScan(t2) | |
2797 | -not used hint: | |
2798 | -duplication hint: | |
2799 | -error hint: | |
2800 | - | |
2801 | - QUERY PLAN | |
2802 | ---------------------------------------- | |
2803 | - Nested Loop | |
2804 | - -> Index Scan using t2_pkey on t2 | |
2805 | - Filter: (ctid = '(1,1)'::tid) | |
2806 | - -> Index Scan using t1_pkey on t1 | |
2807 | - Index Cond: (id = t2.id) | |
2808 | - Filter: (ctid = '(1,1)'::tid) | |
2809 | -(6 rows) | |
2810 | - | |
2811 | -/*+NoTidScan(t1) BitmapScan(t2)*/ | |
2812 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2813 | -LOG: pg_hint_plan: | |
2814 | -used hint: | |
2815 | -NoTidScan(t1) | |
2816 | -BitmapScan(t2) | |
2817 | -not used hint: | |
2818 | -duplication hint: | |
2819 | -error hint: | |
2820 | - | |
2821 | - QUERY PLAN | |
2822 | ------------------------------------------- | |
2823 | - Nested Loop | |
2824 | - -> Seq Scan on t1 | |
2825 | - Filter: (ctid = '(1,1)'::tid) | |
2826 | - -> Bitmap Heap Scan on t2 | |
2827 | - Recheck Cond: (id = t1.id) | |
2828 | - Filter: (ctid = '(1,1)'::tid) | |
2829 | - -> Bitmap Index Scan on t2_pkey | |
2830 | - Index Cond: (id = t1.id) | |
2831 | -(8 rows) | |
2832 | - | |
2833 | -/*+NoTidScan(t1) TidScan(t2)*/ | |
2834 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2835 | -LOG: pg_hint_plan: | |
2836 | -used hint: | |
2837 | -NoTidScan(t1) | |
2838 | -TidScan(t2) | |
2839 | -not used hint: | |
2840 | -duplication hint: | |
2841 | -error hint: | |
2842 | - | |
2843 | - QUERY PLAN | |
2844 | ------------------------------------------ | |
2845 | - Nested Loop | |
2846 | - -> Tid Scan on t2 | |
2847 | - TID Cond: (ctid = '(1,1)'::tid) | |
2848 | - -> Index Scan using t1_pkey on t1 | |
2849 | - Index Cond: (id = t2.id) | |
2850 | - Filter: (ctid = '(1,1)'::tid) | |
2851 | -(6 rows) | |
2852 | - | |
2853 | -/*+NoTidScan(t1) NoSeqScan(t2)*/ | |
2854 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2855 | -LOG: pg_hint_plan: | |
2856 | -used hint: | |
2857 | -NoTidScan(t1) | |
2858 | -NoSeqScan(t2) | |
2859 | -not used hint: | |
2860 | -duplication hint: | |
2861 | -error hint: | |
2862 | - | |
2863 | - QUERY PLAN | |
2864 | ------------------------------------------ | |
2865 | - Nested Loop | |
2866 | - -> Tid Scan on t2 | |
2867 | - TID Cond: (ctid = '(1,1)'::tid) | |
2868 | - -> Index Scan using t1_pkey on t1 | |
2869 | - Index Cond: (id = t2.id) | |
2870 | - Filter: (ctid = '(1,1)'::tid) | |
2871 | -(6 rows) | |
2872 | - | |
2873 | -/*+NoTidScan(t1) NoIndexScan(t2)*/ | |
2874 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2875 | -LOG: pg_hint_plan: | |
2876 | -used hint: | |
2877 | -NoTidScan(t1) | |
2878 | -NoIndexScan(t2) | |
2879 | -not used hint: | |
2880 | -duplication hint: | |
2881 | -error hint: | |
2882 | - | |
2883 | - QUERY PLAN | |
2884 | ------------------------------------------ | |
2885 | - Nested Loop | |
2886 | - -> Tid Scan on t2 | |
2887 | - TID Cond: (ctid = '(1,1)'::tid) | |
2888 | - -> Index Scan using t1_pkey on t1 | |
2889 | - Index Cond: (id = t2.id) | |
2890 | - Filter: (ctid = '(1,1)'::tid) | |
2891 | -(6 rows) | |
2892 | - | |
2893 | -/*+NoTidScan(t1) NoBitmapScan(t2)*/ | |
2894 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2895 | -LOG: pg_hint_plan: | |
2896 | -used hint: | |
2897 | -NoTidScan(t1) | |
2898 | -NoBitmapScan(t2) | |
2899 | -not used hint: | |
2900 | -duplication hint: | |
2901 | -error hint: | |
2902 | - | |
2903 | - QUERY PLAN | |
2904 | ------------------------------------------ | |
2905 | - Nested Loop | |
2906 | - -> Tid Scan on t2 | |
2907 | - TID Cond: (ctid = '(1,1)'::tid) | |
2908 | - -> Index Scan using t1_pkey on t1 | |
2909 | - Index Cond: (id = t2.id) | |
2910 | - Filter: (ctid = '(1,1)'::tid) | |
2911 | -(6 rows) | |
2912 | - | |
2913 | -/*+NoTidScan(t1) NoTidScan(t2)*/ | |
2914 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
2915 | -LOG: pg_hint_plan: | |
2916 | -used hint: | |
2917 | -NoTidScan(t1) | |
2918 | -NoTidScan(t2) | |
2919 | -not used hint: | |
2920 | -duplication hint: | |
2921 | -error hint: | |
2922 | - | |
2923 | - QUERY PLAN | |
2924 | ---------------------------------------- | |
2925 | - Nested Loop | |
2926 | - -> Seq Scan on t2 | |
2927 | - Filter: (ctid = '(1,1)'::tid) | |
2928 | - -> Index Scan using t1_pkey on t1 | |
2929 | - Index Cond: (id = t2.id) | |
2930 | - Filter: (ctid = '(1,1)'::tid) | |
2931 | -(6 rows) | |
2932 | - | |
2933 | --- additional test | |
2934 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)' AND t1.id < 10 AND t2.id < 10; | |
2935 | - QUERY PLAN | |
2936 | ------------------------------------------ | |
2937 | - Nested Loop | |
2938 | - Join Filter: (t1.id = t2.id) | |
2939 | - -> Tid Scan on t1 | |
2940 | - TID Cond: (ctid = '(1,1)'::tid) | |
2941 | - Filter: (id < 10) | |
2942 | - -> Tid Scan on t2 | |
2943 | - TID Cond: (ctid = '(1,1)'::tid) | |
2944 | - Filter: (id < 10) | |
2945 | -(8 rows) | |
2946 | - | |
2947 | -/*+BitmapScan(t1) BitmapScan(t2)*/ | |
2948 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)' AND t1.id < 10 AND t2.id < 10; | |
2949 | -LOG: pg_hint_plan: | |
2950 | -used hint: | |
2951 | -BitmapScan(t1) | |
2952 | -BitmapScan(t2) | |
2953 | -not used hint: | |
2954 | -duplication hint: | |
2955 | -error hint: | |
2956 | - | |
2957 | - QUERY PLAN | |
2958 | --------------------------------------------------------- | |
2959 | - Nested Loop | |
2960 | - -> Bitmap Heap Scan on t2 | |
2961 | - Recheck Cond: (id < 10) | |
2962 | - Filter: (ctid = '(1,1)'::tid) | |
2963 | - -> Bitmap Index Scan on t2_pkey | |
2964 | - Index Cond: (id < 10) | |
2965 | - -> Bitmap Heap Scan on t1 | |
2966 | - Recheck Cond: ((id = t2.id) AND (id < 10)) | |
2967 | - Filter: (ctid = '(1,1)'::tid) | |
2968 | - -> Bitmap Index Scan on t1_pkey | |
2969 | - Index Cond: ((id = t2.id) AND (id < 10)) | |
2970 | -(11 rows) | |
2971 | - | |
2972 | --- outer join test | |
2973 | -EXPLAIN (COSTS false) SELECT * FROM t1 FULL OUTER JOIN t2 ON (t1.id = t2.id); | |
2974 | - QUERY PLAN | |
2975 | ------------------------------- | |
2976 | - Hash Full Join | |
2977 | - Hash Cond: (t1.id = t2.id) | |
2978 | - -> Seq Scan on t1 | |
2979 | - -> Hash | |
2980 | - -> Seq Scan on t2 | |
2981 | -(5 rows) | |
2982 | - | |
2983 | -/*+MergeJoin(t1 t2)*/ | |
2984 | -EXPLAIN (COSTS false) SELECT * FROM t1 FULL OUTER JOIN t2 ON (t1.id = t2.id); | |
2985 | -LOG: pg_hint_plan: | |
2986 | -used hint: | |
2987 | -MergeJoin(t1 t2) | |
2988 | -not used hint: | |
2989 | -duplication hint: | |
2990 | -error hint: | |
2991 | - | |
2992 | - QUERY PLAN | |
2993 | --------------------------------------- | |
2994 | - Merge Full Join | |
2995 | - Merge Cond: (t1.id = t2.id) | |
2996 | - -> Index Scan using t1_pkey on t1 | |
2997 | - -> Index Scan using t2_pkey on t2 | |
2998 | -(4 rows) | |
2999 | - | |
3000 | -/*+NestLoop(t1 t2)*/ | |
3001 | -EXPLAIN (COSTS false) SELECT * FROM t1 FULL OUTER JOIN t2 ON (t1.id = t2.id); | |
3002 | -LOG: pg_hint_plan: | |
3003 | -used hint: | |
3004 | -NestLoop(t1 t2) | |
3005 | -not used hint: | |
3006 | -duplication hint: | |
3007 | -error hint: | |
3008 | - | |
3009 | - QUERY PLAN | |
3010 | --------------------------------------- | |
3011 | - Merge Full Join | |
3012 | - Merge Cond: (t1.id = t2.id) | |
3013 | - -> Index Scan using t1_pkey on t1 | |
3014 | - -> Index Scan using t2_pkey on t2 | |
3015 | -(4 rows) | |
3016 | - | |
3017 | --- inherite table test | |
3018 | -SET constraint_exclusion TO off; | |
3019 | -EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
3020 | - QUERY PLAN | |
3021 | ------------------------------------------------------------------------------ | |
3022 | - Result | |
3023 | - -> Append | |
3024 | - -> Seq Scan on p1 | |
3025 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3026 | - -> Seq Scan on p1_c1 p1 | |
3027 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3028 | - -> Seq Scan on p1_c2 p1 | |
3029 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3030 | - -> Seq Scan on p1_c3 p1 | |
3031 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3032 | - -> Seq Scan on p1_c4 p1 | |
3033 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3034 | - -> Seq Scan on p1_c1_c1 p1 | |
3035 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3036 | - -> Seq Scan on p1_c1_c2 p1 | |
3037 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3038 | - -> Seq Scan on p1_c3_c1 p1 | |
3039 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3040 | - -> Seq Scan on p1_c3_c2 p1 | |
3041 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3042 | -(20 rows) | |
3043 | - | |
3044 | -SET constraint_exclusion TO on; | |
3045 | -EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
3046 | - QUERY PLAN | |
3047 | ------------------------------------------------------------------------------ | |
3048 | - Result | |
3049 | - -> Append | |
3050 | - -> Seq Scan on p1 | |
3051 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3052 | - -> Seq Scan on p1_c1 p1 | |
3053 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3054 | - -> Seq Scan on p1_c1_c1 p1 | |
3055 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3056 | - -> Seq Scan on p1_c1_c2 p1 | |
3057 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3058 | -(10 rows) | |
3059 | - | |
3060 | -SET constraint_exclusion TO off; | |
3061 | -/*+SeqScan(p1)*/ | |
3062 | -EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
3063 | -LOG: pg_hint_plan: | |
3064 | -used hint: | |
3065 | -SeqScan(p1) | |
3066 | -not used hint: | |
3067 | -duplication hint: | |
3068 | -error hint: | |
3069 | - | |
3070 | - QUERY PLAN | |
3071 | ------------------------------------------------------------------------------ | |
3072 | - Result | |
3073 | - -> Append | |
3074 | - -> Seq Scan on p1 | |
3075 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3076 | - -> Seq Scan on p1_c1 p1 | |
3077 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3078 | - -> Seq Scan on p1_c2 p1 | |
3079 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3080 | - -> Seq Scan on p1_c3 p1 | |
3081 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3082 | - -> Seq Scan on p1_c4 p1 | |
3083 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3084 | - -> Seq Scan on p1_c1_c1 p1 | |
3085 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3086 | - -> Seq Scan on p1_c1_c2 p1 | |
3087 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3088 | - -> Seq Scan on p1_c3_c1 p1 | |
3089 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3090 | - -> Seq Scan on p1_c3_c2 p1 | |
3091 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3092 | -(20 rows) | |
3093 | - | |
3094 | -/*+IndexScan(p1)*/ | |
3095 | -EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
3096 | -LOG: pg_hint_plan: | |
3097 | -used hint: | |
3098 | -IndexScan(p1) | |
3099 | -not used hint: | |
3100 | -duplication hint: | |
3101 | -error hint: | |
3102 | - | |
3103 | - QUERY PLAN | |
3104 | ------------------------------------------------------------ | |
3105 | - Result | |
3106 | - -> Append | |
3107 | - -> Index Scan using p1_pkey on p1 | |
3108 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3109 | - Filter: (ctid = '(1,1)'::tid) | |
3110 | - -> Index Scan using p1_c1_pkey on p1_c1 p1 | |
3111 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3112 | - Filter: (ctid = '(1,1)'::tid) | |
3113 | - -> Index Scan using p1_c2_pkey on p1_c2 p1 | |
3114 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3115 | - Filter: (ctid = '(1,1)'::tid) | |
3116 | - -> Index Scan using p1_c3_pkey on p1_c3 p1 | |
3117 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3118 | - Filter: (ctid = '(1,1)'::tid) | |
3119 | - -> Index Scan using p1_c4_pkey on p1_c4 p1 | |
3120 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3121 | - Filter: (ctid = '(1,1)'::tid) | |
3122 | - -> Index Scan using p1_c1_c1_pkey on p1_c1_c1 p1 | |
3123 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3124 | - Filter: (ctid = '(1,1)'::tid) | |
3125 | - -> Index Scan using p1_c1_c2_pkey on p1_c1_c2 p1 | |
3126 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3127 | - Filter: (ctid = '(1,1)'::tid) | |
3128 | - -> Index Scan using p1_c3_c1_pkey on p1_c3_c1 p1 | |
3129 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3130 | - Filter: (ctid = '(1,1)'::tid) | |
3131 | - -> Index Scan using p1_c3_c2_pkey on p1_c3_c2 p1 | |
3132 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3133 | - Filter: (ctid = '(1,1)'::tid) | |
3134 | -(29 rows) | |
3135 | - | |
3136 | -/*+BitmapScan(p1)*/ | |
3137 | -EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
3138 | -LOG: pg_hint_plan: | |
3139 | -used hint: | |
3140 | -BitmapScan(p1) | |
3141 | -not used hint: | |
3142 | -duplication hint: | |
3143 | -error hint: | |
3144 | - | |
3145 | - QUERY PLAN | |
3146 | -------------------------------------------------------------- | |
3147 | - Result | |
3148 | - -> Append | |
3149 | - -> Bitmap Heap Scan on p1 | |
3150 | - Recheck Cond: ((id >= 50) AND (id <= 51)) | |
3151 | - Filter: (ctid = '(1,1)'::tid) | |
3152 | - -> Bitmap Index Scan on p1_pkey | |
3153 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3154 | - -> Bitmap Heap Scan on p1_c1 p1 | |
3155 | - Recheck Cond: ((id >= 50) AND (id <= 51)) | |
3156 | - Filter: (ctid = '(1,1)'::tid) | |
3157 | - -> Bitmap Index Scan on p1_c1_pkey | |
3158 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3159 | - -> Bitmap Heap Scan on p1_c2 p1 | |
3160 | - Recheck Cond: ((id >= 50) AND (id <= 51)) | |
3161 | - Filter: (ctid = '(1,1)'::tid) | |
3162 | - -> Bitmap Index Scan on p1_c2_pkey | |
3163 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3164 | - -> Bitmap Heap Scan on p1_c3 p1 | |
3165 | - Recheck Cond: ((id >= 50) AND (id <= 51)) | |
3166 | - Filter: (ctid = '(1,1)'::tid) | |
3167 | - -> Bitmap Index Scan on p1_c3_pkey | |
3168 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3169 | - -> Bitmap Heap Scan on p1_c4 p1 | |
3170 | - Recheck Cond: ((id >= 50) AND (id <= 51)) | |
3171 | - Filter: (ctid = '(1,1)'::tid) | |
3172 | - -> Bitmap Index Scan on p1_c4_pkey | |
3173 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3174 | - -> Bitmap Heap Scan on p1_c1_c1 p1 | |
3175 | - Recheck Cond: ((id >= 50) AND (id <= 51)) | |
3176 | - Filter: (ctid = '(1,1)'::tid) | |
3177 | - -> Bitmap Index Scan on p1_c1_c1_pkey | |
3178 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3179 | - -> Bitmap Heap Scan on p1_c1_c2 p1 | |
3180 | - Recheck Cond: ((id >= 50) AND (id <= 51)) | |
3181 | - Filter: (ctid = '(1,1)'::tid) | |
3182 | - -> Bitmap Index Scan on p1_c1_c2_pkey | |
3183 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3184 | - -> Bitmap Heap Scan on p1_c3_c1 p1 | |
3185 | - Recheck Cond: ((id >= 50) AND (id <= 51)) | |
3186 | - Filter: (ctid = '(1,1)'::tid) | |
3187 | - -> Bitmap Index Scan on p1_c3_c1_pkey | |
3188 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3189 | - -> Bitmap Heap Scan on p1_c3_c2 p1 | |
3190 | - Recheck Cond: ((id >= 50) AND (id <= 51)) | |
3191 | - Filter: (ctid = '(1,1)'::tid) | |
3192 | - -> Bitmap Index Scan on p1_c3_c2_pkey | |
3193 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3194 | -(47 rows) | |
3195 | - | |
3196 | -/*+TidScan(p1)*/ | |
3197 | -EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
3198 | -LOG: pg_hint_plan: | |
3199 | -used hint: | |
3200 | -TidScan(p1) | |
3201 | -not used hint: | |
3202 | -duplication hint: | |
3203 | -error hint: | |
3204 | - | |
3205 | - QUERY PLAN | |
3206 | ---------------------------------------------------- | |
3207 | - Result | |
3208 | - -> Append | |
3209 | - -> Tid Scan on p1 | |
3210 | - TID Cond: (ctid = '(1,1)'::tid) | |
3211 | - Filter: ((id >= 50) AND (id <= 51)) | |
3212 | - -> Tid Scan on p1_c1 p1 | |
3213 | - TID Cond: (ctid = '(1,1)'::tid) | |
3214 | - Filter: ((id >= 50) AND (id <= 51)) | |
3215 | - -> Tid Scan on p1_c2 p1 | |
3216 | - TID Cond: (ctid = '(1,1)'::tid) | |
3217 | - Filter: ((id >= 50) AND (id <= 51)) | |
3218 | - -> Tid Scan on p1_c3 p1 | |
3219 | - TID Cond: (ctid = '(1,1)'::tid) | |
3220 | - Filter: ((id >= 50) AND (id <= 51)) | |
3221 | - -> Tid Scan on p1_c4 p1 | |
3222 | - TID Cond: (ctid = '(1,1)'::tid) | |
3223 | - Filter: ((id >= 50) AND (id <= 51)) | |
3224 | - -> Tid Scan on p1_c1_c1 p1 | |
3225 | - TID Cond: (ctid = '(1,1)'::tid) | |
3226 | - Filter: ((id >= 50) AND (id <= 51)) | |
3227 | - -> Tid Scan on p1_c1_c2 p1 | |
3228 | - TID Cond: (ctid = '(1,1)'::tid) | |
3229 | - Filter: ((id >= 50) AND (id <= 51)) | |
3230 | - -> Tid Scan on p1_c3_c1 p1 | |
3231 | - TID Cond: (ctid = '(1,1)'::tid) | |
3232 | - Filter: ((id >= 50) AND (id <= 51)) | |
3233 | - -> Tid Scan on p1_c3_c2 p1 | |
3234 | - TID Cond: (ctid = '(1,1)'::tid) | |
3235 | - Filter: ((id >= 50) AND (id <= 51)) | |
3236 | -(29 rows) | |
3237 | - | |
3238 | -SET constraint_exclusion TO on; | |
3239 | -/*+SeqScan(p1)*/ | |
3240 | -EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
3241 | -LOG: pg_hint_plan: | |
3242 | -used hint: | |
3243 | -SeqScan(p1) | |
3244 | -not used hint: | |
3245 | -duplication hint: | |
3246 | -error hint: | |
3247 | - | |
3248 | - QUERY PLAN | |
3249 | ------------------------------------------------------------------------------ | |
3250 | - Result | |
3251 | - -> Append | |
3252 | - -> Seq Scan on p1 | |
3253 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3254 | - -> Seq Scan on p1_c1 p1 | |
3255 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3256 | - -> Seq Scan on p1_c1_c1 p1 | |
3257 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3258 | - -> Seq Scan on p1_c1_c2 p1 | |
3259 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3260 | -(10 rows) | |
3261 | - | |
3262 | -/*+IndexScan(p1)*/ | |
3263 | -EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
3264 | -LOG: pg_hint_plan: | |
3265 | -used hint: | |
3266 | -IndexScan(p1) | |
3267 | -not used hint: | |
3268 | -duplication hint: | |
3269 | -error hint: | |
3270 | - | |
3271 | - QUERY PLAN | |
3272 | ------------------------------------------------------------ | |
3273 | - Result | |
3274 | - -> Append | |
3275 | - -> Index Scan using p1_pkey on p1 | |
3276 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3277 | - Filter: (ctid = '(1,1)'::tid) | |
3278 | - -> Index Scan using p1_c1_pkey on p1_c1 p1 | |
3279 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3280 | - Filter: (ctid = '(1,1)'::tid) | |
3281 | - -> Index Scan using p1_c1_c1_pkey on p1_c1_c1 p1 | |
3282 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3283 | - Filter: (ctid = '(1,1)'::tid) | |
3284 | - -> Index Scan using p1_c1_c2_pkey on p1_c1_c2 p1 | |
3285 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3286 | - Filter: (ctid = '(1,1)'::tid) | |
3287 | -(14 rows) | |
3288 | - | |
3289 | -/*+BitmapScan(p1)*/ | |
3290 | -EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
3291 | -LOG: pg_hint_plan: | |
3292 | -used hint: | |
3293 | -BitmapScan(p1) | |
3294 | -not used hint: | |
3295 | -duplication hint: | |
3296 | -error hint: | |
3297 | - | |
3298 | - QUERY PLAN | |
3299 | -------------------------------------------------------------- | |
3300 | - Result | |
3301 | - -> Append | |
3302 | - -> Bitmap Heap Scan on p1 | |
3303 | - Recheck Cond: ((id >= 50) AND (id <= 51)) | |
3304 | - Filter: (ctid = '(1,1)'::tid) | |
3305 | - -> Bitmap Index Scan on p1_pkey | |
3306 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3307 | - -> Bitmap Heap Scan on p1_c1 p1 | |
3308 | - Recheck Cond: ((id >= 50) AND (id <= 51)) | |
3309 | - Filter: (ctid = '(1,1)'::tid) | |
3310 | - -> Bitmap Index Scan on p1_c1_pkey | |
3311 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3312 | - -> Bitmap Heap Scan on p1_c1_c1 p1 | |
3313 | - Recheck Cond: ((id >= 50) AND (id <= 51)) | |
3314 | - Filter: (ctid = '(1,1)'::tid) | |
3315 | - -> Bitmap Index Scan on p1_c1_c1_pkey | |
3316 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3317 | - -> Bitmap Heap Scan on p1_c1_c2 p1 | |
3318 | - Recheck Cond: ((id >= 50) AND (id <= 51)) | |
3319 | - Filter: (ctid = '(1,1)'::tid) | |
3320 | - -> Bitmap Index Scan on p1_c1_c2_pkey | |
3321 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3322 | -(22 rows) | |
3323 | - | |
3324 | -/*+TidScan(p1)*/ | |
3325 | -EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
3326 | -LOG: pg_hint_plan: | |
3327 | -used hint: | |
3328 | -TidScan(p1) | |
3329 | -not used hint: | |
3330 | -duplication hint: | |
3331 | -error hint: | |
3332 | - | |
3333 | - QUERY PLAN | |
3334 | ---------------------------------------------------- | |
3335 | - Result | |
3336 | - -> Append | |
3337 | - -> Tid Scan on p1 | |
3338 | - TID Cond: (ctid = '(1,1)'::tid) | |
3339 | - Filter: ((id >= 50) AND (id <= 51)) | |
3340 | - -> Tid Scan on p1_c1 p1 | |
3341 | - TID Cond: (ctid = '(1,1)'::tid) | |
3342 | - Filter: ((id >= 50) AND (id <= 51)) | |
3343 | - -> Tid Scan on p1_c1_c1 p1 | |
3344 | - TID Cond: (ctid = '(1,1)'::tid) | |
3345 | - Filter: ((id >= 50) AND (id <= 51)) | |
3346 | - -> Tid Scan on p1_c1_c2 p1 | |
3347 | - TID Cond: (ctid = '(1,1)'::tid) | |
3348 | - Filter: ((id >= 50) AND (id <= 51)) | |
3349 | -(14 rows) | |
3350 | - | |
3351 | -SET constraint_exclusion TO off; | |
3352 | -EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3353 | - QUERY PLAN | |
3354 | ------------------------------------------------------------------------------------ | |
3355 | - Merge Join | |
3356 | - Merge Cond: (public.p1.id = t1.id) | |
3357 | - -> Sort | |
3358 | - Sort Key: public.p1.id | |
3359 | - -> Append | |
3360 | - -> Seq Scan on p1 | |
3361 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3362 | - -> Seq Scan on p1_c1 p1 | |
3363 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3364 | - -> Seq Scan on p1_c2 p1 | |
3365 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3366 | - -> Seq Scan on p1_c3 p1 | |
3367 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3368 | - -> Seq Scan on p1_c4 p1 | |
3369 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3370 | - -> Seq Scan on p1_c1_c1 p1 | |
3371 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3372 | - -> Seq Scan on p1_c1_c2 p1 | |
3373 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3374 | - -> Seq Scan on p1_c3_c1 p1 | |
3375 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3376 | - -> Seq Scan on p1_c3_c2 p1 | |
3377 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3378 | - -> Index Scan using t1_pkey on t1 | |
3379 | - Index Cond: (id < 10) | |
3380 | -(25 rows) | |
3381 | - | |
3382 | -SET constraint_exclusion TO on; | |
3383 | -EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3384 | - QUERY PLAN | |
3385 | ------------------------------------------------------------------------------------ | |
3386 | - Merge Join | |
3387 | - Merge Cond: (public.p1.id = t1.id) | |
3388 | - -> Sort | |
3389 | - Sort Key: public.p1.id | |
3390 | - -> Append | |
3391 | - -> Seq Scan on p1 | |
3392 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3393 | - -> Seq Scan on p1_c1 p1 | |
3394 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3395 | - -> Seq Scan on p1_c1_c1 p1 | |
3396 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3397 | - -> Seq Scan on p1_c1_c2 p1 | |
3398 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3399 | - -> Index Scan using t1_pkey on t1 | |
3400 | - Index Cond: (id < 10) | |
3401 | -(15 rows) | |
3402 | - | |
3403 | -SET constraint_exclusion TO off; | |
3404 | -/*+SeqScan(p1)*/ | |
3405 | -EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3406 | -LOG: pg_hint_plan: | |
3407 | -used hint: | |
3408 | -SeqScan(p1) | |
3409 | -not used hint: | |
3410 | -duplication hint: | |
3411 | -error hint: | |
3412 | - | |
3413 | - QUERY PLAN | |
3414 | ------------------------------------------------------------------------------------ | |
3415 | - Merge Join | |
3416 | - Merge Cond: (public.p1.id = t1.id) | |
3417 | - -> Sort | |
3418 | - Sort Key: public.p1.id | |
3419 | - -> Append | |
3420 | - -> Seq Scan on p1 | |
3421 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3422 | - -> Seq Scan on p1_c1 p1 | |
3423 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3424 | - -> Seq Scan on p1_c2 p1 | |
3425 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3426 | - -> Seq Scan on p1_c3 p1 | |
3427 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3428 | - -> Seq Scan on p1_c4 p1 | |
3429 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3430 | - -> Seq Scan on p1_c1_c1 p1 | |
3431 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3432 | - -> Seq Scan on p1_c1_c2 p1 | |
3433 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3434 | - -> Seq Scan on p1_c3_c1 p1 | |
3435 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3436 | - -> Seq Scan on p1_c3_c2 p1 | |
3437 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3438 | - -> Index Scan using t1_pkey on t1 | |
3439 | - Index Cond: (id < 10) | |
3440 | -(25 rows) | |
3441 | - | |
3442 | -/*+IndexScan(p1)*/ | |
3443 | -EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3444 | -LOG: pg_hint_plan: | |
3445 | -used hint: | |
3446 | -IndexScan(p1) | |
3447 | -not used hint: | |
3448 | -duplication hint: | |
3449 | -error hint: | |
3450 | - | |
3451 | - QUERY PLAN | |
3452 | ------------------------------------------------------------------------------------ | |
3453 | - Merge Join | |
3454 | - Merge Cond: (public.p1.id = t1.id) | |
3455 | - -> Sort | |
3456 | - Sort Key: public.p1.id | |
3457 | - -> Append | |
3458 | - -> Seq Scan on p1 | |
3459 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3460 | - -> Seq Scan on p1_c1 p1 | |
3461 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3462 | - -> Seq Scan on p1_c2 p1 | |
3463 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3464 | - -> Seq Scan on p1_c3 p1 | |
3465 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3466 | - -> Seq Scan on p1_c4 p1 | |
3467 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3468 | - -> Seq Scan on p1_c1_c1 p1 | |
3469 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3470 | - -> Seq Scan on p1_c1_c2 p1 | |
3471 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3472 | - -> Seq Scan on p1_c3_c1 p1 | |
3473 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3474 | - -> Seq Scan on p1_c3_c2 p1 | |
3475 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3476 | - -> Index Scan using t1_pkey on t1 | |
3477 | - Index Cond: (id < 10) | |
3478 | -(25 rows) | |
3479 | - | |
3480 | -/*+BitmapScan(p1)*/ | |
3481 | -EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3482 | -LOG: pg_hint_plan: | |
3483 | -used hint: | |
3484 | -BitmapScan(p1) | |
3485 | -not used hint: | |
3486 | -duplication hint: | |
3487 | -error hint: | |
3488 | - | |
3489 | - QUERY PLAN | |
3490 | ------------------------------------------------------------------------------------ | |
3491 | - Merge Join | |
3492 | - Merge Cond: (public.p1.id = t1.id) | |
3493 | - -> Sort | |
3494 | - Sort Key: public.p1.id | |
3495 | - -> Append | |
3496 | - -> Seq Scan on p1 | |
3497 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3498 | - -> Seq Scan on p1_c1 p1 | |
3499 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3500 | - -> Seq Scan on p1_c2 p1 | |
3501 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3502 | - -> Seq Scan on p1_c3 p1 | |
3503 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3504 | - -> Seq Scan on p1_c4 p1 | |
3505 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3506 | - -> Seq Scan on p1_c1_c1 p1 | |
3507 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3508 | - -> Seq Scan on p1_c1_c2 p1 | |
3509 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3510 | - -> Seq Scan on p1_c3_c1 p1 | |
3511 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3512 | - -> Seq Scan on p1_c3_c2 p1 | |
3513 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3514 | - -> Index Scan using t1_pkey on t1 | |
3515 | - Index Cond: (id < 10) | |
3516 | -(25 rows) | |
3517 | - | |
3518 | -/*+TidScan(p1)*/ | |
3519 | -EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3520 | -LOG: pg_hint_plan: | |
3521 | -used hint: | |
3522 | -TidScan(p1) | |
3523 | -not used hint: | |
3524 | -duplication hint: | |
3525 | -error hint: | |
3526 | - | |
3527 | - QUERY PLAN | |
3528 | ------------------------------------------------------------------------------------ | |
3529 | - Merge Join | |
3530 | - Merge Cond: (public.p1.id = t1.id) | |
3531 | - -> Sort | |
3532 | - Sort Key: public.p1.id | |
3533 | - -> Append | |
3534 | - -> Seq Scan on p1 | |
3535 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3536 | - -> Seq Scan on p1_c1 p1 | |
3537 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3538 | - -> Seq Scan on p1_c2 p1 | |
3539 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3540 | - -> Seq Scan on p1_c3 p1 | |
3541 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3542 | - -> Seq Scan on p1_c4 p1 | |
3543 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3544 | - -> Seq Scan on p1_c1_c1 p1 | |
3545 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3546 | - -> Seq Scan on p1_c1_c2 p1 | |
3547 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3548 | - -> Seq Scan on p1_c3_c1 p1 | |
3549 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3550 | - -> Seq Scan on p1_c3_c2 p1 | |
3551 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3552 | - -> Index Scan using t1_pkey on t1 | |
3553 | - Index Cond: (id < 10) | |
3554 | -(25 rows) | |
3555 | - | |
3556 | -/*+NestLoop(p1 t1)*/ | |
3557 | -EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3558 | -LOG: pg_hint_plan: | |
3559 | -used hint: | |
3560 | -NestLoop(p1 t1) | |
3561 | -not used hint: | |
3562 | -duplication hint: | |
3563 | -error hint: | |
3564 | - | |
3565 | - QUERY PLAN | |
3566 | ------------------------------------------------------------------------------ | |
3567 | - Nested Loop | |
3568 | - Join Filter: (public.p1.id = t1.id) | |
3569 | - -> Append | |
3570 | - -> Seq Scan on p1 | |
3571 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3572 | - -> Seq Scan on p1_c1 p1 | |
3573 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3574 | - -> Seq Scan on p1_c2 p1 | |
3575 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3576 | - -> Seq Scan on p1_c3 p1 | |
3577 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3578 | - -> Seq Scan on p1_c4 p1 | |
3579 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3580 | - -> Seq Scan on p1_c1_c1 p1 | |
3581 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3582 | - -> Seq Scan on p1_c1_c2 p1 | |
3583 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3584 | - -> Seq Scan on p1_c3_c1 p1 | |
3585 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3586 | - -> Seq Scan on p1_c3_c2 p1 | |
3587 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3588 | - -> Materialize | |
3589 | - -> Index Scan using t1_pkey on t1 | |
3590 | - Index Cond: (id < 10) | |
3591 | -(24 rows) | |
3592 | - | |
3593 | -/*+MergeJoin(p1 t1)*/ | |
3594 | -EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3595 | -LOG: pg_hint_plan: | |
3596 | -used hint: | |
3597 | -MergeJoin(p1 t1) | |
3598 | -not used hint: | |
3599 | -duplication hint: | |
3600 | -error hint: | |
3601 | - | |
3602 | - QUERY PLAN | |
3603 | ------------------------------------------------------------------------------------ | |
3604 | - Merge Join | |
3605 | - Merge Cond: (public.p1.id = t1.id) | |
3606 | - -> Sort | |
3607 | - Sort Key: public.p1.id | |
3608 | - -> Append | |
3609 | - -> Seq Scan on p1 | |
3610 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3611 | - -> Seq Scan on p1_c1 p1 | |
3612 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3613 | - -> Seq Scan on p1_c2 p1 | |
3614 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3615 | - -> Seq Scan on p1_c3 p1 | |
3616 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3617 | - -> Seq Scan on p1_c4 p1 | |
3618 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3619 | - -> Seq Scan on p1_c1_c1 p1 | |
3620 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3621 | - -> Seq Scan on p1_c1_c2 p1 | |
3622 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3623 | - -> Seq Scan on p1_c3_c1 p1 | |
3624 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3625 | - -> Seq Scan on p1_c3_c2 p1 | |
3626 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3627 | - -> Index Scan using t1_pkey on t1 | |
3628 | - Index Cond: (id < 10) | |
3629 | -(25 rows) | |
3630 | - | |
3631 | -/*+HashJoin(p1 t1)*/ | |
3632 | -EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3633 | -LOG: pg_hint_plan: | |
3634 | -used hint: | |
3635 | -HashJoin(p1 t1) | |
3636 | -not used hint: | |
3637 | -duplication hint: | |
3638 | -error hint: | |
3639 | - | |
3640 | - QUERY PLAN | |
3641 | ------------------------------------------------------------------------------ | |
3642 | - Hash Join | |
3643 | - Hash Cond: (public.p1.id = t1.id) | |
3644 | - -> Append | |
3645 | - -> Seq Scan on p1 | |
3646 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3647 | - -> Seq Scan on p1_c1 p1 | |
3648 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3649 | - -> Seq Scan on p1_c2 p1 | |
3650 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3651 | - -> Seq Scan on p1_c3 p1 | |
3652 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3653 | - -> Seq Scan on p1_c4 p1 | |
3654 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3655 | - -> Seq Scan on p1_c1_c1 p1 | |
3656 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3657 | - -> Seq Scan on p1_c1_c2 p1 | |
3658 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3659 | - -> Seq Scan on p1_c3_c1 p1 | |
3660 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3661 | - -> Seq Scan on p1_c3_c2 p1 | |
3662 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3663 | - -> Hash | |
3664 | - -> Index Scan using t1_pkey on t1 | |
3665 | - Index Cond: (id < 10) | |
3666 | -(24 rows) | |
3667 | - | |
3668 | -SET constraint_exclusion TO on; | |
3669 | -/*+SeqScan(p1)*/ | |
3670 | -EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3671 | -LOG: pg_hint_plan: | |
3672 | -used hint: | |
3673 | -SeqScan(p1) | |
3674 | -not used hint: | |
3675 | -duplication hint: | |
3676 | -error hint: | |
3677 | - | |
3678 | - QUERY PLAN | |
3679 | ------------------------------------------------------------------------------------ | |
3680 | - Merge Join | |
3681 | - Merge Cond: (public.p1.id = t1.id) | |
3682 | - -> Sort | |
3683 | - Sort Key: public.p1.id | |
3684 | - -> Append | |
3685 | - -> Seq Scan on p1 | |
3686 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3687 | - -> Seq Scan on p1_c1 p1 | |
3688 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3689 | - -> Seq Scan on p1_c1_c1 p1 | |
3690 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3691 | - -> Seq Scan on p1_c1_c2 p1 | |
3692 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3693 | - -> Index Scan using t1_pkey on t1 | |
3694 | - Index Cond: (id < 10) | |
3695 | -(15 rows) | |
3696 | - | |
3697 | -/*+IndexScan(p1)*/ | |
3698 | -EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3699 | -LOG: pg_hint_plan: | |
3700 | -used hint: | |
3701 | -IndexScan(p1) | |
3702 | -not used hint: | |
3703 | -duplication hint: | |
3704 | -error hint: | |
3705 | - | |
3706 | - QUERY PLAN | |
3707 | ------------------------------------------------------------------------------------ | |
3708 | - Merge Join | |
3709 | - Merge Cond: (public.p1.id = t1.id) | |
3710 | - -> Sort | |
3711 | - Sort Key: public.p1.id | |
3712 | - -> Append | |
3713 | - -> Seq Scan on p1 | |
3714 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3715 | - -> Seq Scan on p1_c1 p1 | |
3716 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3717 | - -> Seq Scan on p1_c1_c1 p1 | |
3718 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3719 | - -> Seq Scan on p1_c1_c2 p1 | |
3720 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3721 | - -> Index Scan using t1_pkey on t1 | |
3722 | - Index Cond: (id < 10) | |
3723 | -(15 rows) | |
3724 | - | |
3725 | -/*+BitmapScan(p1)*/ | |
3726 | -EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3727 | -LOG: pg_hint_plan: | |
3728 | -used hint: | |
3729 | -BitmapScan(p1) | |
3730 | -not used hint: | |
3731 | -duplication hint: | |
3732 | -error hint: | |
3733 | - | |
3734 | - QUERY PLAN | |
3735 | ------------------------------------------------------------------------------------ | |
3736 | - Merge Join | |
3737 | - Merge Cond: (public.p1.id = t1.id) | |
3738 | - -> Sort | |
3739 | - Sort Key: public.p1.id | |
3740 | - -> Append | |
3741 | - -> Seq Scan on p1 | |
3742 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3743 | - -> Seq Scan on p1_c1 p1 | |
3744 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3745 | - -> Seq Scan on p1_c1_c1 p1 | |
3746 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3747 | - -> Seq Scan on p1_c1_c2 p1 | |
3748 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3749 | - -> Index Scan using t1_pkey on t1 | |
3750 | - Index Cond: (id < 10) | |
3751 | -(15 rows) | |
3752 | - | |
3753 | -/*+TidScan(p1)*/ | |
3754 | -EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3755 | -LOG: pg_hint_plan: | |
3756 | -used hint: | |
3757 | -TidScan(p1) | |
3758 | -not used hint: | |
3759 | -duplication hint: | |
3760 | -error hint: | |
3761 | - | |
3762 | - QUERY PLAN | |
3763 | ------------------------------------------------------------------------------------ | |
3764 | - Merge Join | |
3765 | - Merge Cond: (public.p1.id = t1.id) | |
3766 | - -> Sort | |
3767 | - Sort Key: public.p1.id | |
3768 | - -> Append | |
3769 | - -> Seq Scan on p1 | |
3770 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3771 | - -> Seq Scan on p1_c1 p1 | |
3772 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3773 | - -> Seq Scan on p1_c1_c1 p1 | |
3774 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3775 | - -> Seq Scan on p1_c1_c2 p1 | |
3776 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3777 | - -> Index Scan using t1_pkey on t1 | |
3778 | - Index Cond: (id < 10) | |
3779 | -(15 rows) | |
3780 | - | |
3781 | -/*+NestLoop(p1 t1)*/ | |
3782 | -EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3783 | -LOG: pg_hint_plan: | |
3784 | -used hint: | |
3785 | -NestLoop(p1 t1) | |
3786 | -not used hint: | |
3787 | -duplication hint: | |
3788 | -error hint: | |
3789 | - | |
3790 | - QUERY PLAN | |
3791 | ------------------------------------------------------------------------------------ | |
3792 | - Nested Loop | |
3793 | - Join Filter: (public.p1.id = t1.id) | |
3794 | - -> Index Scan using t1_pkey on t1 | |
3795 | - Index Cond: (id < 10) | |
3796 | - -> Materialize | |
3797 | - -> Append | |
3798 | - -> Seq Scan on p1 | |
3799 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3800 | - -> Seq Scan on p1_c1 p1 | |
3801 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3802 | - -> Seq Scan on p1_c1_c1 p1 | |
3803 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3804 | - -> Seq Scan on p1_c1_c2 p1 | |
3805 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3806 | -(14 rows) | |
3807 | - | |
3808 | -/*+MergeJoin(p1 t1)*/ | |
3809 | -EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3810 | -LOG: pg_hint_plan: | |
3811 | -used hint: | |
3812 | -MergeJoin(p1 t1) | |
3813 | -not used hint: | |
3814 | -duplication hint: | |
3815 | -error hint: | |
3816 | - | |
3817 | - QUERY PLAN | |
3818 | ------------------------------------------------------------------------------------ | |
3819 | - Merge Join | |
3820 | - Merge Cond: (public.p1.id = t1.id) | |
3821 | - -> Sort | |
3822 | - Sort Key: public.p1.id | |
3823 | - -> Append | |
3824 | - -> Seq Scan on p1 | |
3825 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3826 | - -> Seq Scan on p1_c1 p1 | |
3827 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3828 | - -> Seq Scan on p1_c1_c1 p1 | |
3829 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3830 | - -> Seq Scan on p1_c1_c2 p1 | |
3831 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3832 | - -> Index Scan using t1_pkey on t1 | |
3833 | - Index Cond: (id < 10) | |
3834 | -(15 rows) | |
3835 | - | |
3836 | -/*+HashJoin(p1 t1)*/ | |
3837 | -EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3838 | -LOG: pg_hint_plan: | |
3839 | -used hint: | |
3840 | -HashJoin(p1 t1) | |
3841 | -not used hint: | |
3842 | -duplication hint: | |
3843 | -error hint: | |
3844 | - | |
3845 | - QUERY PLAN | |
3846 | ------------------------------------------------------------------------------------ | |
3847 | - Hash Join | |
3848 | - Hash Cond: (t1.id = public.p1.id) | |
3849 | - -> Index Scan using t1_pkey on t1 | |
3850 | - Index Cond: (id < 10) | |
3851 | - -> Hash | |
3852 | - -> Append | |
3853 | - -> Seq Scan on p1 | |
3854 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3855 | - -> Seq Scan on p1_c1 p1 | |
3856 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3857 | - -> Seq Scan on p1_c1_c1 p1 | |
3858 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3859 | - -> Seq Scan on p1_c1_c2 p1 | |
3860 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3861 | -(14 rows) | |
3862 | - | |
3863 | -SET constraint_exclusion TO off; | |
3864 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
3865 | - QUERY PLAN | |
3866 | ------------------------------------------------------------------ | |
3867 | - Seq Scan on p1 | |
3868 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3869 | -(2 rows) | |
3870 | - | |
3871 | -SET constraint_exclusion TO on; | |
3872 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
3873 | - QUERY PLAN | |
3874 | ------------------------------------------------------------------ | |
3875 | - Seq Scan on p1 | |
3876 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3877 | -(2 rows) | |
3878 | - | |
3879 | -SET constraint_exclusion TO off; | |
3880 | -/*+SeqScan(p1)*/ | |
3881 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
3882 | -LOG: pg_hint_plan: | |
3883 | -used hint: | |
3884 | -SeqScan(p1) | |
3885 | -not used hint: | |
3886 | -duplication hint: | |
3887 | -error hint: | |
3888 | - | |
3889 | - QUERY PLAN | |
3890 | ------------------------------------------------------------------ | |
3891 | - Seq Scan on p1 | |
3892 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3893 | -(2 rows) | |
3894 | - | |
3895 | -/*+IndexScan(p1)*/ | |
3896 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
3897 | -LOG: pg_hint_plan: | |
3898 | -used hint: | |
3899 | -IndexScan(p1) | |
3900 | -not used hint: | |
3901 | -duplication hint: | |
3902 | -error hint: | |
3903 | - | |
3904 | - QUERY PLAN | |
3905 | -------------------------------------------- | |
3906 | - Index Scan using p1_pkey on p1 | |
3907 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3908 | - Filter: (ctid = '(1,1)'::tid) | |
3909 | -(3 rows) | |
3910 | - | |
3911 | -/*+BitmapScan(p1)*/ | |
3912 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
3913 | -LOG: pg_hint_plan: | |
3914 | -used hint: | |
3915 | -BitmapScan(p1) | |
3916 | -not used hint: | |
3917 | -duplication hint: | |
3918 | -error hint: | |
3919 | - | |
3920 | - QUERY PLAN | |
3921 | -------------------------------------------------- | |
3922 | - Bitmap Heap Scan on p1 | |
3923 | - Recheck Cond: ((id >= 50) AND (id <= 51)) | |
3924 | - Filter: (ctid = '(1,1)'::tid) | |
3925 | - -> Bitmap Index Scan on p1_pkey | |
3926 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
3927 | -(5 rows) | |
3928 | - | |
3929 | -/*+TidScan(p1)*/ | |
3930 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
3931 | -LOG: pg_hint_plan: | |
3932 | -used hint: | |
3933 | -TidScan(p1) | |
3934 | -not used hint: | |
3935 | -duplication hint: | |
3936 | -error hint: | |
3937 | - | |
3938 | - QUERY PLAN | |
3939 | ---------------------------------------- | |
3940 | - Tid Scan on p1 | |
3941 | - TID Cond: (ctid = '(1,1)'::tid) | |
3942 | - Filter: ((id >= 50) AND (id <= 51)) | |
3943 | -(3 rows) | |
3944 | - | |
3945 | -/*+NestLoop(p1 t1)*/ | |
3946 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3947 | -LOG: pg_hint_plan: | |
3948 | -used hint: | |
3949 | -NestLoop(p1 t1) | |
3950 | -not used hint: | |
3951 | -duplication hint: | |
3952 | -error hint: | |
3953 | - | |
3954 | - QUERY PLAN | |
3955 | ------------------------------------------------------------------------ | |
3956 | - Nested Loop | |
3957 | - -> Seq Scan on p1 | |
3958 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3959 | - -> Index Scan using t1_pkey on t1 | |
3960 | - Index Cond: ((id = p1.id) AND (id < 10)) | |
3961 | -(5 rows) | |
3962 | - | |
3963 | -/*+MergeJoin(p1 t1)*/ | |
3964 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3965 | -LOG: pg_hint_plan: | |
3966 | -used hint: | |
3967 | -MergeJoin(p1 t1) | |
3968 | -not used hint: | |
3969 | -duplication hint: | |
3970 | -error hint: | |
3971 | - | |
3972 | - QUERY PLAN | |
3973 | ------------------------------------------------------------------------------ | |
3974 | - Merge Join | |
3975 | - Merge Cond: (p1.id = t1.id) | |
3976 | - -> Sort | |
3977 | - Sort Key: p1.id | |
3978 | - -> Seq Scan on p1 | |
3979 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
3980 | - -> Index Scan using t1_pkey on t1 | |
3981 | - Index Cond: (id < 10) | |
3982 | -(8 rows) | |
3983 | - | |
3984 | -/*+HashJoin(p1 t1)*/ | |
3985 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
3986 | -LOG: pg_hint_plan: | |
3987 | -used hint: | |
3988 | -HashJoin(p1 t1) | |
3989 | -not used hint: | |
3990 | -duplication hint: | |
3991 | -error hint: | |
3992 | - | |
3993 | - QUERY PLAN | |
3994 | ------------------------------------------------------------------------------ | |
3995 | - Hash Join | |
3996 | - Hash Cond: (t1.id = p1.id) | |
3997 | - -> Index Scan using t1_pkey on t1 | |
3998 | - Index Cond: (id < 10) | |
3999 | - -> Hash | |
4000 | - -> Seq Scan on p1 | |
4001 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
4002 | -(7 rows) | |
4003 | - | |
4004 | -SET constraint_exclusion TO on; | |
4005 | -/*+SeqScan(p1)*/ | |
4006 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
4007 | -LOG: pg_hint_plan: | |
4008 | -used hint: | |
4009 | -SeqScan(p1) | |
4010 | -not used hint: | |
4011 | -duplication hint: | |
4012 | -error hint: | |
4013 | - | |
4014 | - QUERY PLAN | |
4015 | ------------------------------------------------------------------ | |
4016 | - Seq Scan on p1 | |
4017 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
4018 | -(2 rows) | |
4019 | - | |
4020 | -/*+IndexScan(p1)*/ | |
4021 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
4022 | -LOG: pg_hint_plan: | |
4023 | -used hint: | |
4024 | -IndexScan(p1) | |
4025 | -not used hint: | |
4026 | -duplication hint: | |
4027 | -error hint: | |
4028 | - | |
4029 | - QUERY PLAN | |
4030 | -------------------------------------------- | |
4031 | - Index Scan using p1_pkey on p1 | |
4032 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
4033 | - Filter: (ctid = '(1,1)'::tid) | |
4034 | -(3 rows) | |
4035 | - | |
4036 | -/*+BitmapScan(p1)*/ | |
4037 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
4038 | -LOG: pg_hint_plan: | |
4039 | -used hint: | |
4040 | -BitmapScan(p1) | |
4041 | -not used hint: | |
4042 | -duplication hint: | |
4043 | -error hint: | |
4044 | - | |
4045 | - QUERY PLAN | |
4046 | -------------------------------------------------- | |
4047 | - Bitmap Heap Scan on p1 | |
4048 | - Recheck Cond: ((id >= 50) AND (id <= 51)) | |
4049 | - Filter: (ctid = '(1,1)'::tid) | |
4050 | - -> Bitmap Index Scan on p1_pkey | |
4051 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
4052 | -(5 rows) | |
4053 | - | |
4054 | -/*+TidScan(p1)*/ | |
4055 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)'; | |
4056 | -LOG: pg_hint_plan: | |
4057 | -used hint: | |
4058 | -TidScan(p1) | |
4059 | -not used hint: | |
4060 | -duplication hint: | |
4061 | -error hint: | |
4062 | - | |
4063 | - QUERY PLAN | |
4064 | ---------------------------------------- | |
4065 | - Tid Scan on p1 | |
4066 | - TID Cond: (ctid = '(1,1)'::tid) | |
4067 | - Filter: ((id >= 50) AND (id <= 51)) | |
4068 | -(3 rows) | |
4069 | - | |
4070 | -/*+NestLoop(p1 t1)*/ | |
4071 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
4072 | -LOG: pg_hint_plan: | |
4073 | -used hint: | |
4074 | -NestLoop(p1 t1) | |
4075 | -not used hint: | |
4076 | -duplication hint: | |
4077 | -error hint: | |
4078 | - | |
4079 | - QUERY PLAN | |
4080 | ------------------------------------------------------------------------ | |
4081 | - Nested Loop | |
4082 | - -> Seq Scan on p1 | |
4083 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
4084 | - -> Index Scan using t1_pkey on t1 | |
4085 | - Index Cond: ((id = p1.id) AND (id < 10)) | |
4086 | -(5 rows) | |
4087 | - | |
4088 | -/*+MergeJoin(p1 t1)*/ | |
4089 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
4090 | -LOG: pg_hint_plan: | |
4091 | -used hint: | |
4092 | -MergeJoin(p1 t1) | |
4093 | -not used hint: | |
4094 | -duplication hint: | |
4095 | -error hint: | |
4096 | - | |
4097 | - QUERY PLAN | |
4098 | ------------------------------------------------------------------------------ | |
4099 | - Merge Join | |
4100 | - Merge Cond: (p1.id = t1.id) | |
4101 | - -> Sort | |
4102 | - Sort Key: p1.id | |
4103 | - -> Seq Scan on p1 | |
4104 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
4105 | - -> Index Scan using t1_pkey on t1 | |
4106 | - Index Cond: (id < 10) | |
4107 | -(8 rows) | |
4108 | - | |
4109 | -/*+HashJoin(p1 t1)*/ | |
4110 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
4111 | -LOG: pg_hint_plan: | |
4112 | -used hint: | |
4113 | -HashJoin(p1 t1) | |
4114 | -not used hint: | |
4115 | -duplication hint: | |
4116 | -error hint: | |
4117 | - | |
4118 | - QUERY PLAN | |
4119 | ------------------------------------------------------------------------------ | |
4120 | - Hash Join | |
4121 | - Hash Cond: (t1.id = p1.id) | |
4122 | - -> Index Scan using t1_pkey on t1 | |
4123 | - Index Cond: (id < 10) | |
4124 | - -> Hash | |
4125 | - -> Seq Scan on p1 | |
4126 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
4127 | -(7 rows) | |
4128 | - | |
4129 | -SET constraint_exclusion TO off; | |
4130 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
4131 | - QUERY PLAN | |
4132 | ------------------------------------------------------------------------ | |
4133 | - Nested Loop | |
4134 | - -> Seq Scan on p1 | |
4135 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
4136 | - -> Index Scan using t1_pkey on t1 | |
4137 | - Index Cond: ((id = p1.id) AND (id < 10)) | |
4138 | -(5 rows) | |
4139 | - | |
4140 | -SET constraint_exclusion TO on; | |
4141 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
4142 | - QUERY PLAN | |
4143 | ------------------------------------------------------------------------ | |
4144 | - Nested Loop | |
4145 | - -> Seq Scan on p1 | |
4146 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
4147 | - -> Index Scan using t1_pkey on t1 | |
4148 | - Index Cond: ((id = p1.id) AND (id < 10)) | |
4149 | -(5 rows) | |
4150 | - | |
4151 | -SET constraint_exclusion TO off; | |
4152 | -/*+SeqScan(p1)*/ | |
4153 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
4154 | -LOG: pg_hint_plan: | |
4155 | -used hint: | |
4156 | -SeqScan(p1) | |
4157 | -not used hint: | |
4158 | -duplication hint: | |
4159 | -error hint: | |
4160 | - | |
4161 | - QUERY PLAN | |
4162 | ------------------------------------------------------------------------ | |
4163 | - Nested Loop | |
4164 | - -> Seq Scan on p1 | |
4165 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
4166 | - -> Index Scan using t1_pkey on t1 | |
4167 | - Index Cond: ((id = p1.id) AND (id < 10)) | |
4168 | -(5 rows) | |
4169 | - | |
4170 | -/*+IndexScan(p1)*/ | |
4171 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
4172 | -LOG: pg_hint_plan: | |
4173 | -used hint: | |
4174 | -IndexScan(p1) | |
4175 | -not used hint: | |
4176 | -duplication hint: | |
4177 | -error hint: | |
4178 | - | |
4179 | - QUERY PLAN | |
4180 | --------------------------------------------------- | |
4181 | - Nested Loop | |
4182 | - -> Index Scan using p1_pkey on p1 | |
4183 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
4184 | - Filter: (ctid = '(1,1)'::tid) | |
4185 | - -> Index Scan using t1_pkey on t1 | |
4186 | - Index Cond: ((id = p1.id) AND (id < 10)) | |
4187 | -(6 rows) | |
4188 | - | |
4189 | -/*+BitmapScan(p1)*/ | |
4190 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
4191 | -LOG: pg_hint_plan: | |
4192 | -used hint: | |
4193 | -BitmapScan(p1) | |
4194 | -not used hint: | |
4195 | -duplication hint: | |
4196 | -error hint: | |
4197 | - | |
4198 | - QUERY PLAN | |
4199 | -------------------------------------------------------- | |
4200 | - Nested Loop | |
4201 | - -> Bitmap Heap Scan on p1 | |
4202 | - Recheck Cond: ((id >= 50) AND (id <= 51)) | |
4203 | - Filter: (ctid = '(1,1)'::tid) | |
4204 | - -> Bitmap Index Scan on p1_pkey | |
4205 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
4206 | - -> Index Scan using t1_pkey on t1 | |
4207 | - Index Cond: ((id = p1.id) AND (id < 10)) | |
4208 | -(8 rows) | |
4209 | - | |
4210 | -/*+TidScan(p1)*/ | |
4211 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
4212 | -LOG: pg_hint_plan: | |
4213 | -used hint: | |
4214 | -TidScan(p1) | |
4215 | -not used hint: | |
4216 | -duplication hint: | |
4217 | -error hint: | |
4218 | - | |
4219 | - QUERY PLAN | |
4220 | --------------------------------------------------- | |
4221 | - Nested Loop | |
4222 | - -> Tid Scan on p1 | |
4223 | - TID Cond: (ctid = '(1,1)'::tid) | |
4224 | - Filter: ((id >= 50) AND (id <= 51)) | |
4225 | - -> Index Scan using t1_pkey on t1 | |
4226 | - Index Cond: ((id = p1.id) AND (id < 10)) | |
4227 | -(6 rows) | |
4228 | - | |
4229 | -SET constraint_exclusion TO on; | |
4230 | -/*+SeqScan(p1)*/ | |
4231 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
4232 | -LOG: pg_hint_plan: | |
4233 | -used hint: | |
4234 | -SeqScan(p1) | |
4235 | -not used hint: | |
4236 | -duplication hint: | |
4237 | -error hint: | |
4238 | - | |
4239 | - QUERY PLAN | |
4240 | ------------------------------------------------------------------------ | |
4241 | - Nested Loop | |
4242 | - -> Seq Scan on p1 | |
4243 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
4244 | - -> Index Scan using t1_pkey on t1 | |
4245 | - Index Cond: ((id = p1.id) AND (id < 10)) | |
4246 | -(5 rows) | |
4247 | - | |
4248 | -/*+IndexScan(p1)*/ | |
4249 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
4250 | -LOG: pg_hint_plan: | |
4251 | -used hint: | |
4252 | -IndexScan(p1) | |
4253 | -not used hint: | |
4254 | -duplication hint: | |
4255 | -error hint: | |
4256 | - | |
4257 | - QUERY PLAN | |
4258 | --------------------------------------------------- | |
4259 | - Nested Loop | |
4260 | - -> Index Scan using p1_pkey on p1 | |
4261 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
4262 | - Filter: (ctid = '(1,1)'::tid) | |
4263 | - -> Index Scan using t1_pkey on t1 | |
4264 | - Index Cond: ((id = p1.id) AND (id < 10)) | |
4265 | -(6 rows) | |
4266 | - | |
4267 | -/*+BitmapScan(p1)*/ | |
4268 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
4269 | -LOG: pg_hint_plan: | |
4270 | -used hint: | |
4271 | -BitmapScan(p1) | |
4272 | -not used hint: | |
4273 | -duplication hint: | |
4274 | -error hint: | |
4275 | - | |
4276 | - QUERY PLAN | |
4277 | -------------------------------------------------------- | |
4278 | - Nested Loop | |
4279 | - -> Bitmap Heap Scan on p1 | |
4280 | - Recheck Cond: ((id >= 50) AND (id <= 51)) | |
4281 | - Filter: (ctid = '(1,1)'::tid) | |
4282 | - -> Bitmap Index Scan on p1_pkey | |
4283 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
4284 | - -> Index Scan using t1_pkey on t1 | |
4285 | - Index Cond: ((id = p1.id) AND (id < 10)) | |
4286 | -(8 rows) | |
4287 | - | |
4288 | -/*+TidScan(p1)*/ | |
4289 | -EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10; | |
4290 | -LOG: pg_hint_plan: | |
4291 | -used hint: | |
4292 | -TidScan(p1) | |
4293 | -not used hint: | |
4294 | -duplication hint: | |
4295 | -error hint: | |
4296 | - | |
4297 | - QUERY PLAN | |
4298 | --------------------------------------------------- | |
4299 | - Nested Loop | |
4300 | - -> Tid Scan on p1 | |
4301 | - TID Cond: (ctid = '(1,1)'::tid) | |
4302 | - Filter: ((id >= 50) AND (id <= 51)) | |
4303 | - -> Index Scan using t1_pkey on t1 | |
4304 | - Index Cond: ((id = p1.id) AND (id < 10)) | |
4305 | -(6 rows) | |
4306 | - | |
4307 | --- quote test | |
4308 | -/*+SeqScan("""t1 ) ")IndexScan("t 2 """)HashJoin("""t1 ) "T3"t 2 """)Leading("""t1 ) "T3"t 2 """)Set(application_name"a a a"" a A")*/ | |
4309 | -EXPLAIN (COSTS false) SELECT * FROM t1 """t1 ) ", t2 "t 2 """, t3 "T3" WHERE """t1 ) ".id = "t 2 """.id AND """t1 ) ".id = "T3".id; | |
4310 | -LOG: pg_hint_plan: | |
4311 | -used hint: | |
4312 | -SeqScan("""t1 ) ") | |
4313 | -IndexScan("t 2 """) | |
4314 | -HashJoin("""t1 ) " T3 "t 2 """) | |
4315 | -Leading("""t1 ) " T3 "t 2 """) | |
4316 | -Set(application_name "a a a"" a A") | |
4317 | -not used hint: | |
4318 | -duplication hint: | |
4319 | -error hint: | |
4320 | - | |
4321 | - QUERY PLAN | |
4322 | ---------------------------------------------------------- | |
4323 | - Hash Join | |
4324 | - Hash Cond: ("t 2 """.id = """t1 ) ".id) | |
4325 | - -> Index Scan using t2_pkey on t2 "t 2 """ | |
4326 | - -> Hash | |
4327 | - -> Hash Join | |
4328 | - Hash Cond: ("""t1 ) ".id = "T3".id) | |
4329 | - -> Seq Scan on t1 """t1 ) " | |
4330 | - -> Hash | |
4331 | - -> Seq Scan on t3 "T3" | |
4332 | -(9 rows) | |
4333 | - | |
4334 | --- duplicate hint test | |
4335 | -/*+SeqScan(t1)SeqScan(t2)IndexScan(t1)IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)*/ | |
4336 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)'; | |
4337 | -INFO: hint syntax error at or near "SeqScan(t1)SeqScan(t2)IndexScan(t1)IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)" | |
4338 | -DETAIL: Conflict scan method hint. | |
4339 | -INFO: hint syntax error at or near "IndexScan(t1)IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)" | |
4340 | -DETAIL: Conflict scan method hint. | |
4341 | -INFO: hint syntax error at or near "BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)" | |
4342 | -DETAIL: Conflict scan method hint. | |
4343 | -INFO: hint syntax error at or near "SeqScan(t2)IndexScan(t1)IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)" | |
4344 | -DETAIL: Conflict scan method hint. | |
4345 | -INFO: hint syntax error at or near "IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)" | |
4346 | -DETAIL: Conflict scan method hint. | |
4347 | -INFO: hint syntax error at or near "BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)" | |
4348 | -DETAIL: Conflict scan method hint. | |
4349 | -INFO: hint syntax error at or near "HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)" | |
4350 | -DETAIL: Conflict join method hint. | |
4351 | -INFO: hint syntax error at or near "NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)" | |
4352 | -DETAIL: Conflict join method hint. | |
4353 | -INFO: hint syntax error at or near "Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)" | |
4354 | -DETAIL: Conflict set hint. | |
4355 | -INFO: hint syntax error at or near "Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)" | |
4356 | -DETAIL: Conflict leading hint. | |
4357 | -LOG: pg_hint_plan: | |
4358 | -used hint: | |
4359 | -TidScan(t1) | |
4360 | -TidScan(t2) | |
4361 | -MergeJoin(t1 t2) | |
4362 | -Leading(t2 t1) | |
4363 | -Set(enable_mergejoin on) | |
4364 | -Set(enable_seqscan on) | |
4365 | -not used hint: | |
4366 | -duplication hint: | |
4367 | -SeqScan(t1) | |
4368 | -IndexScan(t1) | |
4369 | -BitmapScan(t1) | |
4370 | -SeqScan(t2) | |
4371 | -IndexScan(t2) | |
4372 | -BitmapScan(t2) | |
4373 | -HashJoin(t1 t2) | |
4374 | -NestLoop(t1 t2) | |
4375 | -Leading(t1 t2) | |
4376 | -Set(enable_seqscan off) | |
4377 | -error hint: | |
4378 | - | |
4379 | - QUERY PLAN | |
4380 | ------------------------------------------------ | |
4381 | - Merge Join | |
4382 | - Merge Cond: (t1.id = t2.id) | |
4383 | - -> Sort | |
4384 | - Sort Key: t1.id | |
4385 | - -> Tid Scan on t1 | |
4386 | - TID Cond: (ctid = '(1,1)'::tid) | |
4387 | - -> Sort | |
4388 | - Sort Key: t2.id | |
4389 | - -> Tid Scan on t2 | |
4390 | - TID Cond: (ctid = '(1,1)'::tid) | |
4391 | -(10 rows) | |
4392 | - | |
4393 | --- sub query Leading hint test | |
4394 | -SET from_collapse_limit TO 100; | |
4395 | -SET geqo_threshold TO 100; | |
4396 | -EXPLAIN (COSTS false) | |
4397 | -WITH c1_1(id) AS ( | |
4398 | -SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id | |
4399 | -) | |
4400 | -SELECT t1_1.id, ( | |
4401 | -SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id | |
4402 | -) FROM t1 t1_1, t2 t2_1, t3 t3_1, ( | |
4403 | -SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id | |
4404 | -) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = ( | |
4405 | -SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id | |
4406 | -); | |
4407 | - QUERY PLAN | |
4408 | ------------------------------------------------------------------------------- | |
4409 | - Nested Loop | |
4410 | - CTE c1_1 | |
4411 | - -> Aggregate | |
4412 | - -> Merge Join | |
4413 | - Merge Cond: (t1_5.id = t3_5.id) | |
4414 | - -> Merge Join | |
4415 | - Merge Cond: (t1_5.id = t2_5.id) | |
4416 | - -> Index Only Scan using t1_pkey on t1 t1_5 | |
4417 | - -> Index Only Scan using t2_pkey on t2 t2_5 | |
4418 | - -> Sort | |
4419 | - Sort Key: t3_5.id | |
4420 | - -> Seq Scan on t3 t3_5 | |
4421 | - InitPlan 2 (returns $1) | |
4422 | - -> Aggregate | |
4423 | - -> Merge Join | |
4424 | - Merge Cond: (t1_2.id = t3_2.id) | |
4425 | - -> Merge Join | |
4426 | - Merge Cond: (t1_2.id = t2_2.id) | |
4427 | - -> Index Only Scan using t1_pkey on t1 t1_2 | |
4428 | - -> Index Only Scan using t2_pkey on t2 t2_2 | |
4429 | - -> Sort | |
4430 | - Sort Key: t3_2.id | |
4431 | - -> Seq Scan on t3 t3_2 | |
4432 | - InitPlan 3 (returns $2) | |
4433 | - -> Aggregate | |
4434 | - -> Merge Join | |
4435 | - Merge Cond: (t1_4.id = t3_4.id) | |
4436 | - -> Merge Join | |
4437 | - Merge Cond: (t1_4.id = t2_4.id) | |
4438 | - -> Index Only Scan using t1_pkey on t1 t1_4 | |
4439 | - -> Index Only Scan using t2_pkey on t2 t2_4 | |
4440 | - -> Sort | |
4441 | - Sort Key: t3_4.id | |
4442 | - -> Seq Scan on t3 t3_4 | |
4443 | - -> Nested Loop | |
4444 | - -> Nested Loop | |
4445 | - -> Nested Loop | |
4446 | - -> Nested Loop | |
4447 | - -> Nested Loop | |
4448 | - -> Index Only Scan using t1_pkey on t1 t1_1 | |
4449 | - Index Cond: (id = $2) | |
4450 | - -> Index Only Scan using t2_pkey on t2 t2_1 | |
4451 | - Index Cond: (id = $2) | |
4452 | - -> Seq Scan on t3 t3_1 | |
4453 | - Filter: (id = $2) | |
4454 | - -> Index Only Scan using t1_pkey on t1 t1_3 | |
4455 | - Index Cond: (id = $2) | |
4456 | - -> Index Only Scan using t2_pkey on t2 t2_3 | |
4457 | - Index Cond: (id = $2) | |
4458 | - -> Seq Scan on t3 t3_3 | |
4459 | - Filter: (id = $2) | |
4460 | - -> CTE Scan on c1_1 | |
4461 | - Filter: (id = $2) | |
4462 | -(53 rows) | |
4463 | - | |
4464 | -/*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)*/ | |
4465 | -EXPLAIN (COSTS false) | |
4466 | -WITH c1_1(id) AS ( | |
4467 | -SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id | |
4468 | -) | |
4469 | -SELECT t1_1.id, ( | |
4470 | -SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id | |
4471 | -) FROM t1 t1_1, t2 t2_1, t3 t3_1, ( | |
4472 | -SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id | |
4473 | -) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = ( | |
4474 | -SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id | |
4475 | -); | |
4476 | -LOG: pg_hint_plan: | |
4477 | -used hint: | |
4478 | -HashJoin(t1_1 t3_1) | |
4479 | -NestLoop(t1_2 t2_2) | |
4480 | -MergeJoin(t1_3 t3_3) | |
4481 | -NestLoop(t1_4 t2_4) | |
4482 | -NestLoop(t1_5 t2_5) | |
4483 | -not used hint: | |
4484 | -duplication hint: | |
4485 | -error hint: | |
4486 | - | |
4487 | - QUERY PLAN | |
4488 | ------------------------------------------------------------------------------- | |
4489 | - Nested Loop | |
4490 | - CTE c1_1 | |
4491 | - -> Aggregate | |
4492 | - -> Merge Join | |
4493 | - Merge Cond: (t1_5.id = t3_5.id) | |
4494 | - -> Nested Loop | |
4495 | - -> Index Only Scan using t2_pkey on t2 t2_5 | |
4496 | - -> Index Only Scan using t1_pkey on t1 t1_5 | |
4497 | - Index Cond: (id = t2_5.id) | |
4498 | - -> Sort | |
4499 | - Sort Key: t3_5.id | |
4500 | - -> Seq Scan on t3 t3_5 | |
4501 | - InitPlan 2 (returns $3) | |
4502 | - -> Aggregate | |
4503 | - -> Merge Join | |
4504 | - Merge Cond: (t1_2.id = t3_2.id) | |
4505 | - -> Nested Loop | |
4506 | - -> Index Only Scan using t2_pkey on t2 t2_2 | |
4507 | - -> Index Only Scan using t1_pkey on t1 t1_2 | |
4508 | - Index Cond: (id = t2_2.id) | |
4509 | - -> Sort | |
4510 | - Sort Key: t3_2.id | |
4511 | - -> Seq Scan on t3 t3_2 | |
4512 | - InitPlan 3 (returns $5) | |
4513 | - -> Aggregate | |
4514 | - -> Merge Join | |
4515 | - Merge Cond: (t1_4.id = t3_4.id) | |
4516 | - -> Nested Loop | |
4517 | - -> Index Only Scan using t2_pkey on t2 t2_4 | |
4518 | - -> Index Only Scan using t1_pkey on t1 t1_4 | |
4519 | - Index Cond: (id = t2_4.id) | |
4520 | - -> Sort | |
4521 | - Sort Key: t3_4.id | |
4522 | - -> Seq Scan on t3 t3_4 | |
4523 | - -> Nested Loop | |
4524 | - -> Nested Loop | |
4525 | - -> Nested Loop | |
4526 | - -> Nested Loop | |
4527 | - -> Nested Loop | |
4528 | - -> Index Only Scan using t1_pkey on t1 t1_1 | |
4529 | - Index Cond: (id = $5) | |
4530 | - -> Index Only Scan using t2_pkey on t2 t2_1 | |
4531 | - Index Cond: (id = $5) | |
4532 | - -> Seq Scan on t3 t3_1 | |
4533 | - Filter: (id = $5) | |
4534 | - -> Index Only Scan using t1_pkey on t1 t1_3 | |
4535 | - Index Cond: (id = $5) | |
4536 | - -> Index Only Scan using t2_pkey on t2 t2_3 | |
4537 | - Index Cond: (id = $5) | |
4538 | - -> Seq Scan on t3 t3_3 | |
4539 | - Filter: (id = $5) | |
4540 | - -> CTE Scan on c1_1 | |
4541 | - Filter: (id = $5) | |
4542 | -(53 rows) | |
4543 | - | |
4544 | -/*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(a t1_1 t1_2 t1_4 t1_5)*/ | |
4545 | -EXPLAIN (COSTS false) | |
4546 | -WITH c1_1(id) AS ( | |
4547 | -SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id | |
4548 | -) | |
4549 | -SELECT t1_1.id, ( | |
4550 | -SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id | |
4551 | -) FROM t1 t1_1, t2 t2_1, t3 t3_1, ( | |
4552 | -SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id | |
4553 | -) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = ( | |
4554 | -SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id | |
4555 | -); | |
4556 | -LOG: pg_hint_plan: | |
4557 | -used hint: | |
4558 | -HashJoin(t1_1 t3_1) | |
4559 | -NestLoop(t1_2 t2_2) | |
4560 | -MergeJoin(t1_3 t3_3) | |
4561 | -NestLoop(t1_4 t2_4) | |
4562 | -NestLoop(t1_5 t2_5) | |
4563 | -not used hint: | |
4564 | -Leading(a t1_1 t1_2 t1_4 t1_5) | |
4565 | -duplication hint: | |
4566 | -error hint: | |
4567 | - | |
4568 | - QUERY PLAN | |
4569 | ------------------------------------------------------------------------------- | |
4570 | - Nested Loop | |
4571 | - CTE c1_1 | |
4572 | - -> Aggregate | |
4573 | - -> Merge Join | |
4574 | - Merge Cond: (t1_5.id = t3_5.id) | |
4575 | - -> Nested Loop | |
4576 | - -> Index Only Scan using t2_pkey on t2 t2_5 | |
4577 | - -> Index Only Scan using t1_pkey on t1 t1_5 | |
4578 | - Index Cond: (id = t2_5.id) | |
4579 | - -> Sort | |
4580 | - Sort Key: t3_5.id | |
4581 | - -> Seq Scan on t3 t3_5 | |
4582 | - InitPlan 2 (returns $3) | |
4583 | - -> Aggregate | |
4584 | - -> Merge Join | |
4585 | - Merge Cond: (t1_2.id = t3_2.id) | |
4586 | - -> Nested Loop | |
4587 | - -> Index Only Scan using t2_pkey on t2 t2_2 | |
4588 | - -> Index Only Scan using t1_pkey on t1 t1_2 | |
4589 | - Index Cond: (id = t2_2.id) | |
4590 | - -> Sort | |
4591 | - Sort Key: t3_2.id | |
4592 | - -> Seq Scan on t3 t3_2 | |
4593 | - InitPlan 3 (returns $5) | |
4594 | - -> Aggregate | |
4595 | - -> Merge Join | |
4596 | - Merge Cond: (t1_4.id = t3_4.id) | |
4597 | - -> Nested Loop | |
4598 | - -> Index Only Scan using t2_pkey on t2 t2_4 | |
4599 | - -> Index Only Scan using t1_pkey on t1 t1_4 | |
4600 | - Index Cond: (id = t2_4.id) | |
4601 | - -> Sort | |
4602 | - Sort Key: t3_4.id | |
4603 | - -> Seq Scan on t3 t3_4 | |
4604 | - -> Nested Loop | |
4605 | - -> Nested Loop | |
4606 | - -> Nested Loop | |
4607 | - -> Nested Loop | |
4608 | - -> Nested Loop | |
4609 | - -> Index Only Scan using t1_pkey on t1 t1_1 | |
4610 | - Index Cond: (id = $5) | |
4611 | - -> Index Only Scan using t2_pkey on t2 t2_1 | |
4612 | - Index Cond: (id = $5) | |
4613 | - -> Seq Scan on t3 t3_1 | |
4614 | - Filter: (id = $5) | |
4615 | - -> Index Only Scan using t1_pkey on t1 t1_3 | |
4616 | - Index Cond: (id = $5) | |
4617 | - -> Index Only Scan using t2_pkey on t2 t2_3 | |
4618 | - Index Cond: (id = $5) | |
4619 | - -> Seq Scan on t3 t3_3 | |
4620 | - Filter: (id = $5) | |
4621 | - -> CTE Scan on c1_1 | |
4622 | - Filter: (id = $5) | |
4623 | -(53 rows) | |
4624 | - | |
4625 | -/*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(a t3_2 t3_5 t2_2 c1_1 t3_4 t3_3 t2_3 t2_4 t1_3 t2_5 t1_2 t3_1 t1_4 t2_1 t1_5 t1_1)*/ | |
4626 | -EXPLAIN (COSTS false) | |
4627 | -WITH c1_1(id) AS ( | |
4628 | -SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id | |
4629 | -) | |
4630 | -SELECT t1_1.id, ( | |
4631 | -SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id | |
4632 | -) FROM t1 t1_1, t2 t2_1, t3 t3_1, ( | |
4633 | -SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id | |
4634 | -) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = ( | |
4635 | -SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id | |
4636 | -); | |
4637 | -LOG: pg_hint_plan: | |
4638 | -used hint: | |
4639 | -HashJoin(t1_1 t3_1) | |
4640 | -NestLoop(t1_2 t2_2) | |
4641 | -MergeJoin(t1_3 t3_3) | |
4642 | -NestLoop(t1_4 t2_4) | |
4643 | -NestLoop(t1_5 t2_5) | |
4644 | -not used hint: | |
4645 | -Leading(a t3_2 t3_5 t2_2 c1_1 t3_4 t3_3 t2_3 t2_4 t1_3 t2_5 t1_2 t3_1 t1_4 t2_1 t1_5 t1_1) | |
4646 | -duplication hint: | |
4647 | -error hint: | |
4648 | - | |
4649 | - QUERY PLAN | |
4650 | ------------------------------------------------------------------------------- | |
4651 | - Nested Loop | |
4652 | - CTE c1_1 | |
4653 | - -> Aggregate | |
4654 | - -> Merge Join | |
4655 | - Merge Cond: (t1_5.id = t3_5.id) | |
4656 | - -> Nested Loop | |
4657 | - -> Index Only Scan using t2_pkey on t2 t2_5 | |
4658 | - -> Index Only Scan using t1_pkey on t1 t1_5 | |
4659 | - Index Cond: (id = t2_5.id) | |
4660 | - -> Sort | |
4661 | - Sort Key: t3_5.id | |
4662 | - -> Seq Scan on t3 t3_5 | |
4663 | - InitPlan 2 (returns $3) | |
4664 | - -> Aggregate | |
4665 | - -> Merge Join | |
4666 | - Merge Cond: (t1_2.id = t3_2.id) | |
4667 | - -> Nested Loop | |
4668 | - -> Index Only Scan using t2_pkey on t2 t2_2 | |
4669 | - -> Index Only Scan using t1_pkey on t1 t1_2 | |
4670 | - Index Cond: (id = t2_2.id) | |
4671 | - -> Sort | |
4672 | - Sort Key: t3_2.id | |
4673 | - -> Seq Scan on t3 t3_2 | |
4674 | - InitPlan 3 (returns $5) | |
4675 | - -> Aggregate | |
4676 | - -> Merge Join | |
4677 | - Merge Cond: (t1_4.id = t3_4.id) | |
4678 | - -> Nested Loop | |
4679 | - -> Index Only Scan using t2_pkey on t2 t2_4 | |
4680 | - -> Index Only Scan using t1_pkey on t1 t1_4 | |
4681 | - Index Cond: (id = t2_4.id) | |
4682 | - -> Sort | |
4683 | - Sort Key: t3_4.id | |
4684 | - -> Seq Scan on t3 t3_4 | |
4685 | - -> Nested Loop | |
4686 | - -> Nested Loop | |
4687 | - -> Nested Loop | |
4688 | - -> Nested Loop | |
4689 | - -> Nested Loop | |
4690 | - -> Index Only Scan using t1_pkey on t1 t1_1 | |
4691 | - Index Cond: (id = $5) | |
4692 | - -> Index Only Scan using t2_pkey on t2 t2_1 | |
4693 | - Index Cond: (id = $5) | |
4694 | - -> Seq Scan on t3 t3_1 | |
4695 | - Filter: (id = $5) | |
4696 | - -> Index Only Scan using t1_pkey on t1 t1_3 | |
4697 | - Index Cond: (id = $5) | |
4698 | - -> Index Only Scan using t2_pkey on t2 t2_3 | |
4699 | - Index Cond: (id = $5) | |
4700 | - -> Seq Scan on t3 t3_3 | |
4701 | - Filter: (id = $5) | |
4702 | - -> CTE Scan on c1_1 | |
4703 | - Filter: (id = $5) | |
4704 | -(53 rows) | |
4705 | - | |
4706 | -/*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(t3_5 t2_5 t1_5)Leading(t3_2 t2_2 t1_2)Leading(t3_4 t2_4 t1_4)Leading(c1_1 t3_3 t2_3 t1_3 t3_1 t2_1 t1_1)*/ | |
4707 | -EXPLAIN (COSTS false) | |
4708 | -WITH c1_1(id) AS ( | |
4709 | -SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id | |
4710 | -) | |
4711 | -SELECT t1_1.id, ( | |
4712 | -SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id | |
4713 | -) FROM t1 t1_1, t2 t2_1, t3 t3_1, ( | |
4714 | -SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id | |
4715 | -) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = ( | |
4716 | -SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id | |
4717 | -); | |
4718 | -LOG: pg_hint_plan: | |
4719 | -used hint: | |
4720 | -Leading(t3_5 t2_5 t1_5) | |
4721 | -Leading(t3_2 t2_2 t1_2) | |
4722 | -Leading(t3_4 t2_4 t1_4) | |
4723 | -Leading(c1_1 t3_3 t2_3 t1_3 t3_1 t2_1 t1_1) | |
4724 | -not used hint: | |
4725 | -HashJoin(t1_1 t3_1) | |
4726 | -NestLoop(t1_2 t2_2) | |
4727 | -MergeJoin(t1_3 t3_3) | |
4728 | -NestLoop(t1_4 t2_4) | |
4729 | -NestLoop(t1_5 t2_5) | |
4730 | -duplication hint: | |
4731 | -error hint: | |
4732 | - | |
4733 | - QUERY PLAN | |
4734 | ------------------------------------------------------------------------- | |
4735 | - Nested Loop | |
4736 | - CTE c1_1 | |
4737 | - -> Aggregate | |
4738 | - -> Merge Join | |
4739 | - Merge Cond: (t2_5.id = t1_5.id) | |
4740 | - -> Merge Join | |
4741 | - Merge Cond: (t2_5.id = t3_5.id) | |
4742 | - -> Index Only Scan using t2_pkey on t2 t2_5 | |
4743 | - -> Sort | |
4744 | - Sort Key: t3_5.id | |
4745 | - -> Seq Scan on t3 t3_5 | |
4746 | - -> Index Only Scan using t1_pkey on t1 t1_5 | |
4747 | - InitPlan 2 (returns $1) | |
4748 | - -> Aggregate | |
4749 | - -> Merge Join | |
4750 | - Merge Cond: (t2_2.id = t1_2.id) | |
4751 | - -> Merge Join | |
4752 | - Merge Cond: (t2_2.id = t3_2.id) | |
4753 | - -> Index Only Scan using t2_pkey on t2 t2_2 | |
4754 | - -> Sort | |
4755 | - Sort Key: t3_2.id | |
4756 | - -> Seq Scan on t3 t3_2 | |
4757 | - -> Index Only Scan using t1_pkey on t1 t1_2 | |
4758 | - InitPlan 3 (returns $2) | |
4759 | - -> Aggregate | |
4760 | - -> Merge Join | |
4761 | - Merge Cond: (t2_4.id = t1_4.id) | |
4762 | - -> Merge Join | |
4763 | - Merge Cond: (t2_4.id = t3_4.id) | |
4764 | - -> Index Only Scan using t2_pkey on t2 t2_4 | |
4765 | - -> Sort | |
4766 | - Sort Key: t3_4.id | |
4767 | - -> Seq Scan on t3 t3_4 | |
4768 | - -> Index Only Scan using t1_pkey on t1 t1_4 | |
4769 | - -> Nested Loop | |
4770 | - -> Nested Loop | |
4771 | - -> Nested Loop | |
4772 | - -> Nested Loop | |
4773 | - -> Nested Loop | |
4774 | - -> Seq Scan on t3 t3_3 | |
4775 | - Filter: (id = $2) | |
4776 | - -> CTE Scan on c1_1 | |
4777 | - Filter: (id = $2) | |
4778 | - -> Index Only Scan using t2_pkey on t2 t2_3 | |
4779 | - Index Cond: (id = $2) | |
4780 | - -> Index Only Scan using t1_pkey on t1 t1_3 | |
4781 | - Index Cond: (id = $2) | |
4782 | - -> Seq Scan on t3 t3_1 | |
4783 | - Filter: (id = $2) | |
4784 | - -> Index Only Scan using t2_pkey on t2 t2_1 | |
4785 | - Index Cond: (id = $2) | |
4786 | - -> Index Only Scan using t1_pkey on t1 t1_1 | |
4787 | - Index Cond: (id = $2) | |
4788 | -(53 rows) | |
4789 | - | |
4790 | -SET from_collapse_limit TO 1; | |
4791 | -EXPLAIN (COSTS false) | |
4792 | -WITH c1_1(id) AS ( | |
4793 | -SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id | |
4794 | -) | |
4795 | -SELECT t1_1.id, ( | |
4796 | -SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id | |
4797 | -) FROM t1 t1_1, t2 t2_1, t3 t3_1, ( | |
4798 | -SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id | |
4799 | -) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = ( | |
4800 | -SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id | |
4801 | -); | |
4802 | - QUERY PLAN | |
4803 | --------------------------------------------------------------------- | |
4804 | - Nested Loop | |
4805 | - CTE c1_1 | |
4806 | - -> Aggregate | |
4807 | - -> Merge Join | |
4808 | - Merge Cond: (t1_5.id = t3_5.id) | |
4809 | - -> Merge Join | |
4810 | - Merge Cond: (t1_5.id = t2_5.id) | |
4811 | - -> Index Only Scan using t1_pkey on t1 t1_5 | |
4812 | - -> Index Only Scan using t2_pkey on t2 t2_5 | |
4813 | - -> Sort | |
4814 | - Sort Key: t3_5.id | |
4815 | - -> Seq Scan on t3 t3_5 | |
4816 | - InitPlan 2 (returns $1) | |
4817 | - -> Aggregate | |
4818 | - -> Merge Join | |
4819 | - Merge Cond: (t1_2.id = t3_2.id) | |
4820 | - -> Merge Join | |
4821 | - Merge Cond: (t1_2.id = t2_2.id) | |
4822 | - -> Index Only Scan using t1_pkey on t1 t1_2 | |
4823 | - -> Index Only Scan using t2_pkey on t2 t2_2 | |
4824 | - -> Sort | |
4825 | - Sort Key: t3_2.id | |
4826 | - -> Seq Scan on t3 t3_2 | |
4827 | - InitPlan 3 (returns $2) | |
4828 | - -> Aggregate | |
4829 | - -> Merge Join | |
4830 | - Merge Cond: (t1_4.id = t3_4.id) | |
4831 | - -> Merge Join | |
4832 | - Merge Cond: (t1_4.id = t2_4.id) | |
4833 | - -> Index Only Scan using t1_pkey on t1 t1_4 | |
4834 | - -> Index Only Scan using t2_pkey on t2 t2_4 | |
4835 | - -> Sort | |
4836 | - Sort Key: t3_4.id | |
4837 | - -> Seq Scan on t3 t3_4 | |
4838 | - -> Nested Loop | |
4839 | - -> Nested Loop | |
4840 | - -> Nested Loop | |
4841 | - -> Index Only Scan using t1_pkey on t1 t1_1 | |
4842 | - Index Cond: (id = $2) | |
4843 | - -> Index Only Scan using t2_pkey on t2 t2_1 | |
4844 | - Index Cond: (id = $2) | |
4845 | - -> Seq Scan on t3 t3_1 | |
4846 | - Filter: (id = $2) | |
4847 | - -> Nested Loop | |
4848 | - -> Nested Loop | |
4849 | - -> Index Only Scan using t1_pkey on t1 t1_3 | |
4850 | - Index Cond: (id = $2) | |
4851 | - -> Index Only Scan using t2_pkey on t2 t2_3 | |
4852 | - Index Cond: (id = $2) | |
4853 | - -> Seq Scan on t3 t3_3 | |
4854 | - Filter: (id = $2) | |
4855 | - -> CTE Scan on c1_1 | |
4856 | - Filter: (id = $2) | |
4857 | -(53 rows) | |
4858 | - | |
4859 | -/*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)*/ | |
4860 | -EXPLAIN (COSTS false) | |
4861 | -WITH c1_1(id) AS ( | |
4862 | -SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id | |
4863 | -) | |
4864 | -SELECT t1_1.id, ( | |
4865 | -SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id | |
4866 | -) FROM t1 t1_1, t2 t2_1, t3 t3_1, ( | |
4867 | -SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id | |
4868 | -) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = ( | |
4869 | -SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id | |
4870 | -); | |
4871 | -LOG: pg_hint_plan: | |
4872 | -used hint: | |
4873 | -HashJoin(t1_1 t3_1) | |
4874 | -NestLoop(t1_2 t2_2) | |
4875 | -MergeJoin(t1_3 t3_3) | |
4876 | -NestLoop(t1_4 t2_4) | |
4877 | -NestLoop(t1_5 t2_5) | |
4878 | -not used hint: | |
4879 | -duplication hint: | |
4880 | -error hint: | |
4881 | - | |
4882 | - QUERY PLAN | |
4883 | --------------------------------------------------------------------- | |
4884 | - Nested Loop | |
4885 | - CTE c1_1 | |
4886 | - -> Aggregate | |
4887 | - -> Merge Join | |
4888 | - Merge Cond: (t1_5.id = t3_5.id) | |
4889 | - -> Nested Loop | |
4890 | - -> Index Only Scan using t2_pkey on t2 t2_5 | |
4891 | - -> Index Only Scan using t1_pkey on t1 t1_5 | |
4892 | - Index Cond: (id = t2_5.id) | |
4893 | - -> Sort | |
4894 | - Sort Key: t3_5.id | |
4895 | - -> Seq Scan on t3 t3_5 | |
4896 | - InitPlan 2 (returns $3) | |
4897 | - -> Aggregate | |
4898 | - -> Merge Join | |
4899 | - Merge Cond: (t1_2.id = t3_2.id) | |
4900 | - -> Nested Loop | |
4901 | - -> Index Only Scan using t2_pkey on t2 t2_2 | |
4902 | - -> Index Only Scan using t1_pkey on t1 t1_2 | |
4903 | - Index Cond: (id = t2_2.id) | |
4904 | - -> Sort | |
4905 | - Sort Key: t3_2.id | |
4906 | - -> Seq Scan on t3 t3_2 | |
4907 | - InitPlan 3 (returns $5) | |
4908 | - -> Aggregate | |
4909 | - -> Merge Join | |
4910 | - Merge Cond: (t1_4.id = t3_4.id) | |
4911 | - -> Nested Loop | |
4912 | - -> Index Only Scan using t2_pkey on t2 t2_4 | |
4913 | - -> Index Only Scan using t1_pkey on t1 t1_4 | |
4914 | - Index Cond: (id = t2_4.id) | |
4915 | - -> Sort | |
4916 | - Sort Key: t3_4.id | |
4917 | - -> Seq Scan on t3 t3_4 | |
4918 | - -> Nested Loop | |
4919 | - -> Nested Loop | |
4920 | - -> Nested Loop | |
4921 | - -> Index Only Scan using t1_pkey on t1 t1_1 | |
4922 | - Index Cond: (id = $5) | |
4923 | - -> Index Only Scan using t2_pkey on t2 t2_1 | |
4924 | - Index Cond: (id = $5) | |
4925 | - -> Seq Scan on t3 t3_1 | |
4926 | - Filter: (id = $5) | |
4927 | - -> Nested Loop | |
4928 | - -> Nested Loop | |
4929 | - -> Index Only Scan using t1_pkey on t1 t1_3 | |
4930 | - Index Cond: (id = $5) | |
4931 | - -> Index Only Scan using t2_pkey on t2 t2_3 | |
4932 | - Index Cond: (id = $5) | |
4933 | - -> Seq Scan on t3 t3_3 | |
4934 | - Filter: (id = $5) | |
4935 | - -> CTE Scan on c1_1 | |
4936 | - Filter: (id = $5) | |
4937 | -(53 rows) | |
4938 | - | |
4939 | -/*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(a t1_1 t1_2 t1_4 t1_5)*/ | |
4940 | -EXPLAIN (COSTS false) | |
4941 | -WITH c1_1(id) AS ( | |
4942 | -SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id | |
4943 | -) | |
4944 | -SELECT t1_1.id, ( | |
4945 | -SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id | |
4946 | -) FROM t1 t1_1, t2 t2_1, t3 t3_1, ( | |
4947 | -SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id | |
4948 | -) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = ( | |
4949 | -SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id | |
4950 | -); | |
4951 | -LOG: pg_hint_plan: | |
4952 | -used hint: | |
4953 | -HashJoin(t1_1 t3_1) | |
4954 | -NestLoop(t1_2 t2_2) | |
4955 | -MergeJoin(t1_3 t3_3) | |
4956 | -NestLoop(t1_4 t2_4) | |
4957 | -NestLoop(t1_5 t2_5) | |
4958 | -not used hint: | |
4959 | -Leading(a t1_1 t1_2 t1_4 t1_5) | |
4960 | -duplication hint: | |
4961 | -error hint: | |
4962 | - | |
4963 | - QUERY PLAN | |
4964 | --------------------------------------------------------------------- | |
4965 | - Nested Loop | |
4966 | - CTE c1_1 | |
4967 | - -> Aggregate | |
4968 | - -> Merge Join | |
4969 | - Merge Cond: (t1_5.id = t3_5.id) | |
4970 | - -> Nested Loop | |
4971 | - -> Index Only Scan using t2_pkey on t2 t2_5 | |
4972 | - -> Index Only Scan using t1_pkey on t1 t1_5 | |
4973 | - Index Cond: (id = t2_5.id) | |
4974 | - -> Sort | |
4975 | - Sort Key: t3_5.id | |
4976 | - -> Seq Scan on t3 t3_5 | |
4977 | - InitPlan 2 (returns $3) | |
4978 | - -> Aggregate | |
4979 | - -> Merge Join | |
4980 | - Merge Cond: (t1_2.id = t3_2.id) | |
4981 | - -> Nested Loop | |
4982 | - -> Index Only Scan using t2_pkey on t2 t2_2 | |
4983 | - -> Index Only Scan using t1_pkey on t1 t1_2 | |
4984 | - Index Cond: (id = t2_2.id) | |
4985 | - -> Sort | |
4986 | - Sort Key: t3_2.id | |
4987 | - -> Seq Scan on t3 t3_2 | |
4988 | - InitPlan 3 (returns $5) | |
4989 | - -> Aggregate | |
4990 | - -> Merge Join | |
4991 | - Merge Cond: (t1_4.id = t3_4.id) | |
4992 | - -> Nested Loop | |
4993 | - -> Index Only Scan using t2_pkey on t2 t2_4 | |
4994 | - -> Index Only Scan using t1_pkey on t1 t1_4 | |
4995 | - Index Cond: (id = t2_4.id) | |
4996 | - -> Sort | |
4997 | - Sort Key: t3_4.id | |
4998 | - -> Seq Scan on t3 t3_4 | |
4999 | - -> Nested Loop | |
5000 | - -> Nested Loop | |
5001 | - -> Nested Loop | |
5002 | - -> Index Only Scan using t1_pkey on t1 t1_1 | |
5003 | - Index Cond: (id = $5) | |
5004 | - -> Index Only Scan using t2_pkey on t2 t2_1 | |
5005 | - Index Cond: (id = $5) | |
5006 | - -> Seq Scan on t3 t3_1 | |
5007 | - Filter: (id = $5) | |
5008 | - -> Nested Loop | |
5009 | - -> Nested Loop | |
5010 | - -> Index Only Scan using t1_pkey on t1 t1_3 | |
5011 | - Index Cond: (id = $5) | |
5012 | - -> Index Only Scan using t2_pkey on t2 t2_3 | |
5013 | - Index Cond: (id = $5) | |
5014 | - -> Seq Scan on t3 t3_3 | |
5015 | - Filter: (id = $5) | |
5016 | - -> CTE Scan on c1_1 | |
5017 | - Filter: (id = $5) | |
5018 | -(53 rows) | |
5019 | - | |
5020 | -/*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(a t3_2 t3_5 t2_2 c1_1 t3_4 t3_3 t2_3 t2_4 t1_3 t2_5 t1_2 t3_1 t1_4 t2_1 t1_5 t1_1)*/ | |
5021 | -EXPLAIN (COSTS false) | |
5022 | -WITH c1_1(id) AS ( | |
5023 | -SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id | |
5024 | -) | |
5025 | -SELECT t1_1.id, ( | |
5026 | -SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id | |
5027 | -) FROM t1 t1_1, t2 t2_1, t3 t3_1, ( | |
5028 | -SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id | |
5029 | -) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = ( | |
5030 | -SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id | |
5031 | -); | |
5032 | -LOG: pg_hint_plan: | |
5033 | -used hint: | |
5034 | -HashJoin(t1_1 t3_1) | |
5035 | -NestLoop(t1_2 t2_2) | |
5036 | -MergeJoin(t1_3 t3_3) | |
5037 | -NestLoop(t1_4 t2_4) | |
5038 | -NestLoop(t1_5 t2_5) | |
5039 | -not used hint: | |
5040 | -Leading(a t3_2 t3_5 t2_2 c1_1 t3_4 t3_3 t2_3 t2_4 t1_3 t2_5 t1_2 t3_1 t1_4 t2_1 t1_5 t1_1) | |
5041 | -duplication hint: | |
5042 | -error hint: | |
5043 | - | |
5044 | - QUERY PLAN | |
5045 | --------------------------------------------------------------------- | |
5046 | - Nested Loop | |
5047 | - CTE c1_1 | |
5048 | - -> Aggregate | |
5049 | - -> Merge Join | |
5050 | - Merge Cond: (t1_5.id = t3_5.id) | |
5051 | - -> Nested Loop | |
5052 | - -> Index Only Scan using t2_pkey on t2 t2_5 | |
5053 | - -> Index Only Scan using t1_pkey on t1 t1_5 | |
5054 | - Index Cond: (id = t2_5.id) | |
5055 | - -> Sort | |
5056 | - Sort Key: t3_5.id | |
5057 | - -> Seq Scan on t3 t3_5 | |
5058 | - InitPlan 2 (returns $3) | |
5059 | - -> Aggregate | |
5060 | - -> Merge Join | |
5061 | - Merge Cond: (t1_2.id = t3_2.id) | |
5062 | - -> Nested Loop | |
5063 | - -> Index Only Scan using t2_pkey on t2 t2_2 | |
5064 | - -> Index Only Scan using t1_pkey on t1 t1_2 | |
5065 | - Index Cond: (id = t2_2.id) | |
5066 | - -> Sort | |
5067 | - Sort Key: t3_2.id | |
5068 | - -> Seq Scan on t3 t3_2 | |
5069 | - InitPlan 3 (returns $5) | |
5070 | - -> Aggregate | |
5071 | - -> Merge Join | |
5072 | - Merge Cond: (t1_4.id = t3_4.id) | |
5073 | - -> Nested Loop | |
5074 | - -> Index Only Scan using t2_pkey on t2 t2_4 | |
5075 | - -> Index Only Scan using t1_pkey on t1 t1_4 | |
5076 | - Index Cond: (id = t2_4.id) | |
5077 | - -> Sort | |
5078 | - Sort Key: t3_4.id | |
5079 | - -> Seq Scan on t3 t3_4 | |
5080 | - -> Nested Loop | |
5081 | - -> Nested Loop | |
5082 | - -> Nested Loop | |
5083 | - -> Index Only Scan using t1_pkey on t1 t1_1 | |
5084 | - Index Cond: (id = $5) | |
5085 | - -> Index Only Scan using t2_pkey on t2 t2_1 | |
5086 | - Index Cond: (id = $5) | |
5087 | - -> Seq Scan on t3 t3_1 | |
5088 | - Filter: (id = $5) | |
5089 | - -> Nested Loop | |
5090 | - -> Nested Loop | |
5091 | - -> Index Only Scan using t1_pkey on t1 t1_3 | |
5092 | - Index Cond: (id = $5) | |
5093 | - -> Index Only Scan using t2_pkey on t2 t2_3 | |
5094 | - Index Cond: (id = $5) | |
5095 | - -> Seq Scan on t3 t3_3 | |
5096 | - Filter: (id = $5) | |
5097 | - -> CTE Scan on c1_1 | |
5098 | - Filter: (id = $5) | |
5099 | -(53 rows) | |
5100 | - | |
5101 | -/*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(t3_5 t2_5 t1_5)Leading(t3_2 t2_2 t1_2)Leading(t3_4 t2_4 t1_4)Leading(c1_1 t3_3 t2_3 t1_3 t3_1 t2_1 t1_1)*/ | |
5102 | -EXPLAIN (COSTS false) | |
5103 | -WITH c1_1(id) AS ( | |
5104 | -SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id | |
5105 | -) | |
5106 | -SELECT t1_1.id, ( | |
5107 | -SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id | |
5108 | -) FROM t1 t1_1, t2 t2_1, t3 t3_1, ( | |
5109 | -SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id | |
5110 | -) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = ( | |
5111 | -SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id | |
5112 | -); | |
5113 | -LOG: pg_hint_plan: | |
5114 | -used hint: | |
5115 | -MergeJoin(t1_3 t3_3) | |
5116 | -Leading(t3_5 t2_5 t1_5) | |
5117 | -Leading(t3_2 t2_2 t1_2) | |
5118 | -Leading(t3_4 t2_4 t1_4) | |
5119 | -Leading(c1_1 t3_3 t2_3 t1_3 t3_1 t2_1 t1_1) | |
5120 | -not used hint: | |
5121 | -HashJoin(t1_1 t3_1) | |
5122 | -NestLoop(t1_2 t2_2) | |
5123 | -NestLoop(t1_4 t2_4) | |
5124 | -NestLoop(t1_5 t2_5) | |
5125 | -duplication hint: | |
5126 | -error hint: | |
5127 | - | |
5128 | - QUERY PLAN | |
5129 | ------------------------------------------------------------------------------- | |
5130 | - Nested Loop | |
5131 | - CTE c1_1 | |
5132 | - -> Aggregate | |
5133 | - -> Merge Join | |
5134 | - Merge Cond: (t2_5.id = t1_5.id) | |
5135 | - -> Merge Join | |
5136 | - Merge Cond: (t2_5.id = t3_5.id) | |
5137 | - -> Index Only Scan using t2_pkey on t2 t2_5 | |
5138 | - -> Sort | |
5139 | - Sort Key: t3_5.id | |
5140 | - -> Seq Scan on t3 t3_5 | |
5141 | - -> Index Only Scan using t1_pkey on t1 t1_5 | |
5142 | - InitPlan 2 (returns $1) | |
5143 | - -> Aggregate | |
5144 | - -> Merge Join | |
5145 | - Merge Cond: (t2_2.id = t1_2.id) | |
5146 | - -> Merge Join | |
5147 | - Merge Cond: (t2_2.id = t3_2.id) | |
5148 | - -> Index Only Scan using t2_pkey on t2 t2_2 | |
5149 | - -> Sort | |
5150 | - Sort Key: t3_2.id | |
5151 | - -> Seq Scan on t3 t3_2 | |
5152 | - -> Index Only Scan using t1_pkey on t1 t1_2 | |
5153 | - InitPlan 3 (returns $2) | |
5154 | - -> Aggregate | |
5155 | - -> Merge Join | |
5156 | - Merge Cond: (t2_4.id = t1_4.id) | |
5157 | - -> Merge Join | |
5158 | - Merge Cond: (t2_4.id = t3_4.id) | |
5159 | - -> Index Only Scan using t2_pkey on t2 t2_4 | |
5160 | - -> Sort | |
5161 | - Sort Key: t3_4.id | |
5162 | - -> Seq Scan on t3 t3_4 | |
5163 | - -> Index Only Scan using t1_pkey on t1 t1_4 | |
5164 | - -> Nested Loop | |
5165 | - -> Nested Loop | |
5166 | - -> Nested Loop | |
5167 | - -> Nested Loop | |
5168 | - -> Nested Loop | |
5169 | - -> Index Only Scan using t1_pkey on t1 t1_3 | |
5170 | - Index Cond: (id = $2) | |
5171 | - -> Index Only Scan using t2_pkey on t2 t2_3 | |
5172 | - Index Cond: (id = $2) | |
5173 | - -> Seq Scan on t3 t3_3 | |
5174 | - Filter: (id = $2) | |
5175 | - -> CTE Scan on c1_1 | |
5176 | - Filter: (id = $2) | |
5177 | - -> Seq Scan on t3 t3_1 | |
5178 | - Filter: (id = $2) | |
5179 | - -> Index Only Scan using t2_pkey on t2 t2_1 | |
5180 | - Index Cond: (id = $2) | |
5181 | - -> Index Only Scan using t1_pkey on t1 t1_1 | |
5182 | - Index Cond: (id = $2) | |
5183 | -(53 rows) | |
5184 | - | |
5185 | --- ambigous error | |
5186 | -EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id AND public.t1.id = t2.id; | |
5187 | - QUERY PLAN | |
5188 | ------------------------------------------------ | |
5189 | - Merge Join | |
5190 | - Merge Cond: (public.t1.id = t2.id) | |
5191 | - -> Merge Join | |
5192 | - Merge Cond: (public.t1.id = s0.t1.id) | |
5193 | - -> Index Scan using t1_pkey on t1 | |
5194 | - -> Index Scan using t1_pkey on t1 | |
5195 | - -> Index Scan using t2_pkey on t2 | |
5196 | -(7 rows) | |
5197 | - | |
5198 | -/*+NestLoop(t1 t2)*/ | |
5199 | -EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id AND public.t1.id = t2.id; | |
5200 | -INFO: hint syntax error at or near "NestLoop(t1 t2)" | |
5201 | -DETAIL: Relation name "t1" is ambiguous. | |
5202 | -LOG: pg_hint_plan: | |
5203 | -used hint: | |
5204 | -not used hint: | |
5205 | -duplication hint: | |
5206 | -error hint: | |
5207 | -NestLoop(t1 t2) | |
5208 | - | |
5209 | - QUERY PLAN | |
5210 | ------------------------------------------------ | |
5211 | - Merge Join | |
5212 | - Merge Cond: (public.t1.id = t2.id) | |
5213 | - -> Merge Join | |
5214 | - Merge Cond: (public.t1.id = s0.t1.id) | |
5215 | - -> Index Scan using t1_pkey on t1 | |
5216 | - -> Index Scan using t1_pkey on t1 | |
5217 | - -> Index Scan using t2_pkey on t2 | |
5218 | -(7 rows) | |
5219 | - | |
5220 | -/*+Leading(t1 t2 t1)*/ | |
5221 | -EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id AND public.t1.id = t2.id; | |
5222 | -INFO: hint syntax error at or near "Leading(t1 t2 t1)" | |
5223 | -DETAIL: Relation name "t1" is ambiguous. | |
5224 | -LOG: pg_hint_plan: | |
5225 | -used hint: | |
5226 | -not used hint: | |
5227 | -duplication hint: | |
5228 | -error hint: | |
5229 | -Leading(t1 t2 t1) | |
5230 | - | |
5231 | - QUERY PLAN | |
5232 | ------------------------------------------------ | |
5233 | - Merge Join | |
5234 | - Merge Cond: (public.t1.id = t2.id) | |
5235 | - -> Merge Join | |
5236 | - Merge Cond: (public.t1.id = s0.t1.id) | |
5237 | - -> Index Scan using t1_pkey on t1 | |
5238 | - -> Index Scan using t1_pkey on t1 | |
5239 | - -> Index Scan using t2_pkey on t2 | |
5240 | -(7 rows) | |
5241 | - | |
5242 | --- identifier length test | |
5243 | -EXPLAIN (COSTS false) SELECT * FROM t1 "123456789012345678901234567890123456789012345678901234567890123" JOIN t2 ON ("123456789012345678901234567890123456789012345678901234567890123".id = t2.id) JOIN t3 ON (t2.id = t3.id); | |
5244 | - QUERY PLAN | |
5245 | --------------------------------------------------------------------------------------------------------------- | |
5246 | - Merge Join | |
5247 | - Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t3.id) | |
5248 | - -> Merge Join | |
5249 | - Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t2.id) | |
5250 | - -> Index Scan using t1_pkey on t1 "123456789012345678901234567890123456789012345678901234567890123" | |
5251 | - -> Index Scan using t2_pkey on t2 | |
5252 | - -> Sort | |
5253 | - Sort Key: t3.id | |
5254 | - -> Seq Scan on t3 | |
5255 | -(9 rows) | |
5256 | - | |
5257 | -/*+ | |
5258 | -Leading(123456789012345678901234567890123456789012345678901234567890123 t2 t3) | |
5259 | -SeqScan(123456789012345678901234567890123456789012345678901234567890123) | |
5260 | -MergeJoin(123456789012345678901234567890123456789012345678901234567890123 t2) | |
5261 | -Set(123456789012345678901234567890123456789012345678901234567890123 1) | |
5262 | -*/ | |
5263 | -EXPLAIN (COSTS false) SELECT * FROM t1 "123456789012345678901234567890123456789012345678901234567890123" JOIN t2 ON ("123456789012345678901234567890123456789012345678901234567890123".id = t2.id) JOIN t3 ON (t2.id = t3.id); | |
5264 | -INFO: unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123" | |
5265 | -LOG: pg_hint_plan: | |
5266 | -used hint: | |
5267 | -SeqScan(123456789012345678901234567890123456789012345678901234567890123) | |
5268 | -MergeJoin(123456789012345678901234567890123456789012345678901234567890123 t2) | |
5269 | -Leading(123456789012345678901234567890123456789012345678901234567890123 t2 t3) | |
5270 | -not used hint: | |
5271 | -duplication hint: | |
5272 | -error hint: | |
5273 | -Set(123456789012345678901234567890123456789012345678901234567890123 1) | |
5274 | - | |
5275 | - QUERY PLAN | |
5276 | ----------------------------------------------------------------------------------------------------- | |
5277 | - Merge Join | |
5278 | - Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t3.id) | |
5279 | - -> Merge Join | |
5280 | - Merge Cond: (t2.id = "123456789012345678901234567890123456789012345678901234567890123".id) | |
5281 | - -> Index Scan using t2_pkey on t2 | |
5282 | - -> Sort | |
5283 | - Sort Key: "123456789012345678901234567890123456789012345678901234567890123".id | |
5284 | - -> Seq Scan on t1 "123456789012345678901234567890123456789012345678901234567890123" | |
5285 | - -> Sort | |
5286 | - Sort Key: t3.id | |
5287 | - -> Seq Scan on t3 | |
5288 | -(11 rows) | |
5289 | - | |
5290 | -/*+ | |
5291 | -Leading(1234567890123456789012345678901234567890123456789012345678901234 t2 t3) | |
5292 | -SeqScan(1234567890123456789012345678901234567890123456789012345678901234) | |
5293 | -MergeJoin(1234567890123456789012345678901234567890123456789012345678901234 t2) | |
5294 | -Set(1234567890123456789012345678901234567890123456789012345678901234 1) | |
5295 | -Set(cursor_tuple_fraction 0.1234567890123456789012345678901234567890123456789012345678901234) | |
5296 | -*/ | |
5297 | -EXPLAIN (COSTS false) SELECT * FROM t1 "1234567890123456789012345678901234567890123456789012345678901234" JOIN t2 ON ("1234567890123456789012345678901234567890123456789012345678901234".id = t2.id) JOIN t3 ON (t2.id = t3.id); | |
5298 | -NOTICE: identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123" | |
5299 | -NOTICE: identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123" | |
5300 | -NOTICE: identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123" | |
5301 | -NOTICE: identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123" | |
5302 | -NOTICE: identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123" | |
5303 | -NOTICE: identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123" | |
5304 | -INFO: unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123" | |
5305 | -LOG: pg_hint_plan: | |
5306 | -used hint: | |
5307 | -SeqScan(123456789012345678901234567890123456789012345678901234567890123) | |
5308 | -MergeJoin(123456789012345678901234567890123456789012345678901234567890123 t2) | |
5309 | -Leading(123456789012345678901234567890123456789012345678901234567890123 t2 t3) | |
5310 | -Set(cursor_tuple_fraction 0.1234567890123456789012345678901234567890123456789012345678901234) | |
5311 | -not used hint: | |
5312 | -duplication hint: | |
5313 | -error hint: | |
5314 | -Set(123456789012345678901234567890123456789012345678901234567890123 1) | |
5315 | - | |
5316 | - QUERY PLAN | |
5317 | ----------------------------------------------------------------------------------------------------- | |
5318 | - Merge Join | |
5319 | - Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t3.id) | |
5320 | - -> Merge Join | |
5321 | - Merge Cond: (t2.id = "123456789012345678901234567890123456789012345678901234567890123".id) | |
5322 | - -> Index Scan using t2_pkey on t2 | |
5323 | - -> Sort | |
5324 | - Sort Key: "123456789012345678901234567890123456789012345678901234567890123".id | |
5325 | - -> Seq Scan on t1 "123456789012345678901234567890123456789012345678901234567890123" | |
5326 | - -> Sort | |
5327 | - Sort Key: t3.id | |
5328 | - -> Seq Scan on t3 | |
5329 | -(11 rows) | |
5330 | - | |
5331 | -SET "123456789012345678901234567890123456789012345678901234567890123" TO 1; | |
5332 | -ERROR: unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123" | |
5333 | -SET "1234567890123456789012345678901234567890123456789012345678901234" TO 1; | |
5334 | -NOTICE: identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123" | |
5335 | -ERROR: unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123" | |
5336 | -SET cursor_tuple_fraction TO 1234567890123456789012345678901234567890123456789012345678901234; | |
5337 | -ERROR: 1.23457e+63 is outside the valid range for parameter "cursor_tuple_fraction" (0 .. 1) | |
5338 | --- multi error | |
5339 | -/*+ Set(enable_seqscan 100)Set(seq_page_cost on)*/ | |
5340 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id; | |
5341 | -INFO: parameter "enable_seqscan" requires a Boolean value | |
5342 | -INFO: parameter "seq_page_cost" requires a numeric value | |
5343 | -LOG: pg_hint_plan: | |
5344 | -used hint: | |
5345 | -not used hint: | |
5346 | -duplication hint: | |
5347 | -error hint: | |
5348 | -Set(enable_seqscan 100) | |
5349 | -Set(seq_page_cost on) | |
5350 | - | |
5351 | - QUERY PLAN | |
5352 | --------------------------------------- | |
5353 | - Merge Join | |
5354 | - Merge Cond: (t1.id = t2.id) | |
5355 | - -> Index Scan using t1_pkey on t1 | |
5356 | - -> Index Scan using t2_pkey on t2 | |
5357 | -(4 rows) | |
5358 | - | |
5359 | --- debug log of candidate index to use IndexScan | |
5360 | -EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1; | |
5361 | - QUERY PLAN | |
5362 | ----------------------------------------------------------------------------------------- | |
5363 | - Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5 | |
5364 | - Index Cond: (id = 1) | |
5365 | -(2 rows) | |
5366 | - | |
5367 | -/*+IndexScan(t5 t5_id2)*/ | |
5368 | -EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1; | |
5369 | -LOG: available indexes for IndexScan(t5): t5_id2 | |
5370 | -LOG: pg_hint_plan: | |
5371 | -used hint: | |
5372 | -IndexScan(t5 t5_id2) | |
5373 | -not used hint: | |
5374 | -duplication hint: | |
5375 | -error hint: | |
5376 | - | |
5377 | - QUERY PLAN | |
5378 | -------------------------------- | |
5379 | - Index Scan using t5_id2 on t5 | |
5380 | - Index Cond: (id = 1) | |
5381 | -(2 rows) | |
5382 | - | |
5383 | -/*+IndexScan(t5 no_exist)*/ | |
5384 | -EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1; | |
5385 | -LOG: available indexes for IndexScan(t5): | |
5386 | -LOG: pg_hint_plan: | |
5387 | -used hint: | |
5388 | -IndexScan(t5 no_exist) | |
5389 | -not used hint: | |
5390 | -duplication hint: | |
5391 | -error hint: | |
5392 | - | |
5393 | - QUERY PLAN | |
5394 | --------------------- | |
5395 | - Seq Scan on t5 | |
5396 | - Filter: (id = 1) | |
5397 | -(2 rows) | |
5398 | - | |
5399 | -/*+IndexScan(t5 t5_id1 t5_id2)*/ | |
5400 | -EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1; | |
5401 | -LOG: available indexes for IndexScan(t5): t5_id2 t5_id1 | |
5402 | -LOG: pg_hint_plan: | |
5403 | -used hint: | |
5404 | -IndexScan(t5 t5_id1 t5_id2) | |
5405 | -not used hint: | |
5406 | -duplication hint: | |
5407 | -error hint: | |
5408 | - | |
5409 | - QUERY PLAN | |
5410 | -------------------------------- | |
5411 | - Index Scan using t5_id2 on t5 | |
5412 | - Index Cond: (id = 1) | |
5413 | -(2 rows) | |
5414 | - | |
5415 | -/*+IndexScan(t5 no_exist t5_id2)*/ | |
5416 | -EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1; | |
5417 | -LOG: available indexes for IndexScan(t5): t5_id2 | |
5418 | -LOG: pg_hint_plan: | |
5419 | -used hint: | |
5420 | -IndexScan(t5 no_exist t5_id2) | |
5421 | -not used hint: | |
5422 | -duplication hint: | |
5423 | -error hint: | |
5424 | - | |
5425 | - QUERY PLAN | |
5426 | -------------------------------- | |
5427 | - Index Scan using t5_id2 on t5 | |
5428 | - Index Cond: (id = 1) | |
5429 | -(2 rows) | |
5430 | - | |
5431 | -/*+IndexScan(t5 no_exist5 no_exist2)*/ | |
5432 | -EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1; | |
5433 | -LOG: available indexes for IndexScan(t5): | |
5434 | -LOG: pg_hint_plan: | |
5435 | -used hint: | |
5436 | -IndexScan(t5 no_exist5 no_exist2) | |
5437 | -not used hint: | |
5438 | -duplication hint: | |
5439 | -error hint: | |
5440 | - | |
5441 | - QUERY PLAN | |
5442 | --------------------- | |
5443 | - Seq Scan on t5 | |
5444 | - Filter: (id = 1) | |
5445 | -(2 rows) | |
5446 | - | |
5447 | --- outer inner | |
5448 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
5449 | - QUERY PLAN | |
5450 | --------------------------------------------------------- | |
5451 | - Hash Join | |
5452 | - Hash Cond: (t3.val = t2.val) | |
5453 | - -> Seq Scan on t3 | |
5454 | - -> Hash | |
5455 | - -> Hash Join | |
5456 | - Hash Cond: (t2.id = t1.id) | |
5457 | - -> Seq Scan on t2 | |
5458 | - -> Hash | |
5459 | - -> Index Scan using t1_pkey on t1 | |
5460 | - Index Cond: (id < 10) | |
5461 | -(10 rows) | |
5462 | - | |
5463 | -/*+Leading((t1))*/ | |
5464 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
5465 | -INFO: hint syntax error at or near "Leading((t1))" | |
5466 | -DETAIL: Leading hint requires two sets of relations when parentheses nests. | |
5467 | -LOG: pg_hint_plan: | |
5468 | -used hint: | |
5469 | -not used hint: | |
5470 | -duplication hint: | |
5471 | -error hint: | |
5472 | -Leading((t1)) | |
5473 | - | |
5474 | - QUERY PLAN | |
5475 | --------------------------------------------------------- | |
5476 | - Hash Join | |
5477 | - Hash Cond: (t3.val = t2.val) | |
5478 | - -> Seq Scan on t3 | |
5479 | - -> Hash | |
5480 | - -> Hash Join | |
5481 | - Hash Cond: (t2.id = t1.id) | |
5482 | - -> Seq Scan on t2 | |
5483 | - -> Hash | |
5484 | - -> Index Scan using t1_pkey on t1 | |
5485 | - Index Cond: (id < 10) | |
5486 | -(10 rows) | |
5487 | - | |
5488 | -/*+Leading((t1 t2))*/ | |
5489 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
5490 | -LOG: pg_hint_plan: | |
5491 | -used hint: | |
5492 | -Leading((t1 t2)) | |
5493 | -not used hint: | |
5494 | -duplication hint: | |
5495 | -error hint: | |
5496 | - | |
5497 | - QUERY PLAN | |
5498 | --------------------------------------------- | |
5499 | - Nested Loop | |
5500 | - Join Filter: (t2.val = t3.val) | |
5501 | - -> Hash Join | |
5502 | - Hash Cond: (t1.id = t2.id) | |
5503 | - -> Index Scan using t1_pkey on t1 | |
5504 | - Index Cond: (id < 10) | |
5505 | - -> Hash | |
5506 | - -> Seq Scan on t2 | |
5507 | - -> Seq Scan on t3 | |
5508 | -(9 rows) | |
5509 | - | |
5510 | -/*+Leading((t1 t2 t3))*/ | |
5511 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
5512 | -INFO: hint syntax error at or near "Leading((t1 t2 t3))" | |
5513 | -DETAIL: Leading hint requires two sets of relations when parentheses nests. | |
5514 | -LOG: pg_hint_plan: | |
5515 | -used hint: | |
5516 | -not used hint: | |
5517 | -duplication hint: | |
5518 | -error hint: | |
5519 | -Leading((t1 t2 t3)) | |
5520 | - | |
5521 | - QUERY PLAN | |
5522 | --------------------------------------------------------- | |
5523 | - Hash Join | |
5524 | - Hash Cond: (t3.val = t2.val) | |
5525 | - -> Seq Scan on t3 | |
5526 | - -> Hash | |
5527 | - -> Hash Join | |
5528 | - Hash Cond: (t2.id = t1.id) | |
5529 | - -> Seq Scan on t2 | |
5530 | - -> Hash | |
5531 | - -> Index Scan using t1_pkey on t1 | |
5532 | - Index Cond: (id < 10) | |
5533 | -(10 rows) | |
5534 | - | |
5535 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.id < 10; | |
5536 | - QUERY PLAN | |
5537 | --------------------------------------------- | |
5538 | - Hash Join | |
5539 | - Hash Cond: (t2.id = t1.id) | |
5540 | - -> Seq Scan on t2 | |
5541 | - -> Hash | |
5542 | - -> Index Scan using t1_pkey on t1 | |
5543 | - Index Cond: (id < 10) | |
5544 | -(6 rows) | |
5545 | - | |
5546 | -/*+Leading((t1 t2))*/ | |
5547 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.id < 10; | |
5548 | -LOG: pg_hint_plan: | |
5549 | -used hint: | |
5550 | -Leading((t1 t2)) | |
5551 | -not used hint: | |
5552 | -duplication hint: | |
5553 | -error hint: | |
5554 | - | |
5555 | - QUERY PLAN | |
5556 | --------------------------------------- | |
5557 | - Hash Join | |
5558 | - Hash Cond: (t1.id = t2.id) | |
5559 | - -> Index Scan using t1_pkey on t1 | |
5560 | - Index Cond: (id < 10) | |
5561 | - -> Hash | |
5562 | - -> Seq Scan on t2 | |
5563 | -(6 rows) | |
5564 | - | |
5565 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
5566 | - QUERY PLAN | |
5567 | --------------------------------------------------------- | |
5568 | - Hash Join | |
5569 | - Hash Cond: (t3.val = t2.val) | |
5570 | - -> Seq Scan on t3 | |
5571 | - -> Hash | |
5572 | - -> Hash Join | |
5573 | - Hash Cond: (t2.id = t1.id) | |
5574 | - -> Seq Scan on t2 | |
5575 | - -> Hash | |
5576 | - -> Index Scan using t1_pkey on t1 | |
5577 | - Index Cond: (id < 10) | |
5578 | -(10 rows) | |
5579 | - | |
5580 | -/*+Leading(((t1 t2) t3))*/ | |
5581 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
5582 | -LOG: pg_hint_plan: | |
5583 | -used hint: | |
5584 | -Leading(((t1 t2) t3)) | |
5585 | -not used hint: | |
5586 | -duplication hint: | |
5587 | -error hint: | |
5588 | - | |
5589 | - QUERY PLAN | |
5590 | --------------------------------------------- | |
5591 | - Nested Loop | |
5592 | - Join Filter: (t2.val = t3.val) | |
5593 | - -> Hash Join | |
5594 | - Hash Cond: (t1.id = t2.id) | |
5595 | - -> Index Scan using t1_pkey on t1 | |
5596 | - Index Cond: (id < 10) | |
5597 | - -> Hash | |
5598 | - -> Seq Scan on t2 | |
5599 | - -> Seq Scan on t3 | |
5600 | -(9 rows) | |
5601 | - | |
5602 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t3.id = t4.id AND t1.val = t3.val AND t1.id < 10; | |
5603 | - QUERY PLAN | |
5604 | --------------------------------------------------------- | |
5605 | - Nested Loop | |
5606 | - -> Merge Join | |
5607 | - Merge Cond: (t3.id = t4.id) | |
5608 | - -> Nested Loop | |
5609 | - Join Filter: (t1.val = t3.val) | |
5610 | - -> Index Scan using t3_pkey on t3 | |
5611 | - -> Materialize | |
5612 | - -> Index Scan using t1_pkey on t1 | |
5613 | - Index Cond: (id < 10) | |
5614 | - -> Sort | |
5615 | - Sort Key: t4.id | |
5616 | - -> Seq Scan on t4 | |
5617 | - -> Index Scan using t2_pkey on t2 | |
5618 | - Index Cond: (id = t1.id) | |
5619 | -(14 rows) | |
5620 | - | |
5621 | -/*+Leading((((t1 t2) t3) t4))*/ | |
5622 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t3.id = t4.id AND t1.val = t3.val AND t1.id < 10; | |
5623 | -LOG: pg_hint_plan: | |
5624 | -used hint: | |
5625 | -Leading((((t1 t2) t3) t4)) | |
5626 | -not used hint: | |
5627 | -duplication hint: | |
5628 | -error hint: | |
5629 | - | |
5630 | - QUERY PLAN | |
5631 | --------------------------------------------------- | |
5632 | - Nested Loop | |
5633 | - -> Nested Loop | |
5634 | - Join Filter: (t1.val = t3.val) | |
5635 | - -> Hash Join | |
5636 | - Hash Cond: (t1.id = t2.id) | |
5637 | - -> Index Scan using t1_pkey on t1 | |
5638 | - Index Cond: (id < 10) | |
5639 | - -> Hash | |
5640 | - -> Seq Scan on t2 | |
5641 | - -> Seq Scan on t3 | |
5642 | - -> Index Scan using t4_pkey on t4 | |
5643 | - Index Cond: (id = t3.id) | |
5644 | -(12 rows) | |
5645 | - | |
5646 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
5647 | - QUERY PLAN | |
5648 | --------------------------------------------------------- | |
5649 | - Hash Join | |
5650 | - Hash Cond: (t3.val = t2.val) | |
5651 | - -> Seq Scan on t3 | |
5652 | - -> Hash | |
5653 | - -> Hash Join | |
5654 | - Hash Cond: (t2.id = t1.id) | |
5655 | - -> Seq Scan on t2 | |
5656 | - -> Hash | |
5657 | - -> Index Scan using t1_pkey on t1 | |
5658 | - Index Cond: (id < 10) | |
5659 | -(10 rows) | |
5660 | - | |
5661 | -/*+Leading(((t1 t2) t3))*/ | |
5662 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
5663 | -LOG: pg_hint_plan: | |
5664 | -used hint: | |
5665 | -Leading(((t1 t2) t3)) | |
5666 | -not used hint: | |
5667 | -duplication hint: | |
5668 | -error hint: | |
5669 | - | |
5670 | - QUERY PLAN | |
5671 | --------------------------------------------- | |
5672 | - Nested Loop | |
5673 | - Join Filter: (t2.val = t3.val) | |
5674 | - -> Hash Join | |
5675 | - Hash Cond: (t1.id = t2.id) | |
5676 | - -> Index Scan using t1_pkey on t1 | |
5677 | - Index Cond: (id < 10) | |
5678 | - -> Hash | |
5679 | - -> Seq Scan on t2 | |
5680 | - -> Seq Scan on t3 | |
5681 | -(9 rows) | |
5682 | - | |
5683 | -/*+Leading((t1 (t2 t3)))*/ | |
5684 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
5685 | -LOG: pg_hint_plan: | |
5686 | -used hint: | |
5687 | -Leading((t1 (t2 t3))) | |
5688 | -not used hint: | |
5689 | -duplication hint: | |
5690 | -error hint: | |
5691 | - | |
5692 | - QUERY PLAN | |
5693 | --------------------------------------------- | |
5694 | - Hash Join | |
5695 | - Hash Cond: (t1.id = t2.id) | |
5696 | - -> Index Scan using t1_pkey on t1 | |
5697 | - Index Cond: (id < 10) | |
5698 | - -> Hash | |
5699 | - -> Hash Join | |
5700 | - Hash Cond: (t2.val = t3.val) | |
5701 | - -> Seq Scan on t2 | |
5702 | - -> Hash | |
5703 | - -> Seq Scan on t3 | |
5704 | -(10 rows) | |
5705 | - | |
5706 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t3.id = t4.id AND t1.val = t3.val AND t1.id < 10; | |
5707 | - QUERY PLAN | |
5708 | --------------------------------------------------------- | |
5709 | - Nested Loop | |
5710 | - -> Merge Join | |
5711 | - Merge Cond: (t3.id = t4.id) | |
5712 | - -> Nested Loop | |
5713 | - Join Filter: (t1.val = t3.val) | |
5714 | - -> Index Scan using t3_pkey on t3 | |
5715 | - -> Materialize | |
5716 | - -> Index Scan using t1_pkey on t1 | |
5717 | - Index Cond: (id < 10) | |
5718 | - -> Sort | |
5719 | - Sort Key: t4.id | |
5720 | - -> Seq Scan on t4 | |
5721 | - -> Index Scan using t2_pkey on t2 | |
5722 | - Index Cond: (id = t1.id) | |
5723 | -(14 rows) | |
5724 | - | |
5725 | -/*+Leading(((t1 t2) (t3 t4)))*/ | |
5726 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t3.id = t4.id AND t1.val = t3.val AND t1.id < 10; | |
5727 | -LOG: pg_hint_plan: | |
5728 | -used hint: | |
5729 | -Leading(((t1 t2) (t3 t4))) | |
5730 | -not used hint: | |
5731 | -duplication hint: | |
5732 | -error hint: | |
5733 | - | |
5734 | - QUERY PLAN | |
5735 | --------------------------------------------- | |
5736 | - Nested Loop | |
5737 | - Join Filter: (t1.val = t3.val) | |
5738 | - -> Hash Join | |
5739 | - Hash Cond: (t1.id = t2.id) | |
5740 | - -> Index Scan using t1_pkey on t1 | |
5741 | - Index Cond: (id < 10) | |
5742 | - -> Hash | |
5743 | - -> Seq Scan on t2 | |
5744 | - -> Merge Join | |
5745 | - Merge Cond: (t3.id = t4.id) | |
5746 | - -> Index Scan using t3_pkey on t3 | |
5747 | - -> Sort | |
5748 | - Sort Key: t4.id | |
5749 | - -> Seq Scan on t4 | |
5750 | -(14 rows) | |
5751 | - | |
5752 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < ( SELECT t1_2.id FROM t1 t1_2, t2 t2_2 WHERE t1_2.id = t2_2.id AND t2_2.val > 100 ORDER BY t1_2.id LIMIT 1); | |
5753 | - QUERY PLAN | |
5754 | --------------------------------------------------------------------- | |
5755 | - Hash Join | |
5756 | - Hash Cond: (t2.val = t3.val) | |
5757 | - InitPlan 1 (returns $1) | |
5758 | - -> Limit | |
5759 | - -> Sort | |
5760 | - Sort Key: t1_2.id | |
5761 | - -> Nested Loop | |
5762 | - -> Index Scan using t2_val on t2 t2_2 | |
5763 | - Index Cond: (val > 100) | |
5764 | - -> Index Only Scan using t1_pkey on t1 t1_2 | |
5765 | - Index Cond: (id = t2_2.id) | |
5766 | - -> Merge Join | |
5767 | - Merge Cond: (t1.id = t2.id) | |
5768 | - -> Index Scan using t1_pkey on t1 | |
5769 | - Index Cond: (id < $1) | |
5770 | - -> Index Scan using t2_pkey on t2 | |
5771 | - -> Hash | |
5772 | - -> Seq Scan on t3 | |
5773 | -(18 rows) | |
5774 | - | |
5775 | -/*+Leading(((t1 t2) t3)) Leading(((t3 t1) t2))*/ | |
5776 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t1.val = t3.val AND t1.id < ( SELECT t1_2.id FROM t1 t1_2, t2 t2_2 WHERE t1_2.id = t2_2.id AND t2_2.val > 100 ORDER BY t1_2.id LIMIT 1); | |
5777 | -INFO: hint syntax error at or near "Leading(((t1 t2) t3)) Leading(((t3 t1) t2))" | |
5778 | -DETAIL: Conflict leading hint. | |
5779 | -LOG: pg_hint_plan: | |
5780 | -used hint: | |
5781 | -Leading(((t3 t1) t2)) | |
5782 | -not used hint: | |
5783 | -duplication hint: | |
5784 | -Leading(((t1 t2) t3)) | |
5785 | -error hint: | |
5786 | - | |
5787 | - QUERY PLAN | |
5788 | --------------------------------------------------------------------- | |
5789 | - Hash Join | |
5790 | - Hash Cond: (t1.id = t2.id) | |
5791 | - InitPlan 1 (returns $1) | |
5792 | - -> Limit | |
5793 | - -> Sort | |
5794 | - Sort Key: t1_2.id | |
5795 | - -> Nested Loop | |
5796 | - -> Index Scan using t2_val on t2 t2_2 | |
5797 | - Index Cond: (val > 100) | |
5798 | - -> Index Only Scan using t1_pkey on t1 t1_2 | |
5799 | - Index Cond: (id = t2_2.id) | |
5800 | - -> Hash Join | |
5801 | - Hash Cond: (t3.val = t1.val) | |
5802 | - -> Seq Scan on t3 | |
5803 | - -> Hash | |
5804 | - -> Index Scan using t1_pkey on t1 | |
5805 | - Index Cond: (id < $1) | |
5806 | - -> Hash | |
5807 | - -> Seq Scan on t2 | |
5808 | -(19 rows) | |
5809 | - | |
5810 | -/*+Leading(((t1 t2) t3)) Leading((t1_2 t2_2))*/ | |
5811 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < ( SELECT t1_2.id FROM t1 t1_2, t2 t2_2 WHERE t1_2.id = t2_2.id AND t2_2.val > 100 ORDER BY t1_2.id LIMIT 1); | |
5812 | -LOG: pg_hint_plan: | |
5813 | -used hint: | |
5814 | -Leading(((t1 t2) t3)) | |
5815 | -Leading((t1_2 t2_2)) | |
5816 | -not used hint: | |
5817 | -duplication hint: | |
5818 | -error hint: | |
5819 | - | |
5820 | - QUERY PLAN | |
5821 | --------------------------------------------------------------- | |
5822 | - Hash Join | |
5823 | - Hash Cond: (t2.val = t3.val) | |
5824 | - InitPlan 1 (returns $0) | |
5825 | - -> Limit | |
5826 | - -> Merge Join | |
5827 | - Merge Cond: (t1_2.id = t2_2.id) | |
5828 | - -> Index Only Scan using t1_pkey on t1 t1_2 | |
5829 | - -> Sort | |
5830 | - Sort Key: t2_2.id | |
5831 | - -> Index Scan using t2_val on t2 t2_2 | |
5832 | - Index Cond: (val > 100) | |
5833 | - -> Merge Join | |
5834 | - Merge Cond: (t1.id = t2.id) | |
5835 | - -> Index Scan using t1_pkey on t1 | |
5836 | - Index Cond: (id < $0) | |
5837 | - -> Index Scan using t2_pkey on t2 | |
5838 | - -> Hash | |
5839 | - -> Seq Scan on t3 | |
5840 | -(18 rows) | |
5841 | - | |
5842 | -/*+Leading(((((t1 t2) t3) t1_2) t2_2))*/ | |
5843 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < ( SELECT t1_2.id FROM t1 t1_2, t2 t2_2 WHERE t1_2.id = t2_2.id AND t2_2.val > 100 ORDER BY t1_2.id LIMIT 1); | |
5844 | -LOG: pg_hint_plan: | |
5845 | -used hint: | |
5846 | -not used hint: | |
5847 | -Leading(((((t1 t2) t3) t1_2) t2_2)) | |
5848 | -duplication hint: | |
5849 | -error hint: | |
5850 | - | |
5851 | - QUERY PLAN | |
5852 | --------------------------------------------------------------------- | |
5853 | - Hash Join | |
5854 | - Hash Cond: (t2.val = t3.val) | |
5855 | - InitPlan 1 (returns $1) | |
5856 | - -> Limit | |
5857 | - -> Sort | |
5858 | - Sort Key: t1_2.id | |
5859 | - -> Nested Loop | |
5860 | - -> Index Scan using t2_val on t2 t2_2 | |
5861 | - Index Cond: (val > 100) | |
5862 | - -> Index Only Scan using t1_pkey on t1 t1_2 | |
5863 | - Index Cond: (id = t2_2.id) | |
5864 | - -> Merge Join | |
5865 | - Merge Cond: (t1.id = t2.id) | |
5866 | - -> Index Scan using t1_pkey on t1 | |
5867 | - Index Cond: (id < $1) | |
5868 | - -> Index Scan using t2_pkey on t2 | |
5869 | - -> Hash | |
5870 | - -> Seq Scan on t3 | |
5871 | -(18 rows) | |
5872 | - | |
5873 | --- Specified outer/inner leading hint and join method hint at the same time | |
5874 | -/*+Leading(((t1 t2) t3))*/ | |
5875 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
5876 | -LOG: pg_hint_plan: | |
5877 | -used hint: | |
5878 | -Leading(((t1 t2) t3)) | |
5879 | -not used hint: | |
5880 | -duplication hint: | |
5881 | -error hint: | |
5882 | - | |
5883 | - QUERY PLAN | |
5884 | --------------------------------------------- | |
5885 | - Nested Loop | |
5886 | - Join Filter: (t2.val = t3.val) | |
5887 | - -> Hash Join | |
5888 | - Hash Cond: (t1.id = t2.id) | |
5889 | - -> Index Scan using t1_pkey on t1 | |
5890 | - Index Cond: (id < 10) | |
5891 | - -> Hash | |
5892 | - -> Seq Scan on t2 | |
5893 | - -> Seq Scan on t3 | |
5894 | -(9 rows) | |
5895 | - | |
5896 | -/*+Leading(((t1 t2) t3)) MergeJoin(t1 t2)*/ | |
5897 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
5898 | -LOG: pg_hint_plan: | |
5899 | -used hint: | |
5900 | -MergeJoin(t1 t2) | |
5901 | -Leading(((t1 t2) t3)) | |
5902 | -not used hint: | |
5903 | -duplication hint: | |
5904 | -error hint: | |
5905 | - | |
5906 | - QUERY PLAN | |
5907 | --------------------------------------------- | |
5908 | - Nested Loop | |
5909 | - Join Filter: (t2.val = t3.val) | |
5910 | - -> Merge Join | |
5911 | - Merge Cond: (t1.id = t2.id) | |
5912 | - -> Index Scan using t1_pkey on t1 | |
5913 | - Index Cond: (id < 10) | |
5914 | - -> Index Scan using t2_pkey on t2 | |
5915 | - -> Seq Scan on t3 | |
5916 | -(8 rows) | |
5917 | - | |
5918 | -/*+Leading(((t1 t2) t3)) MergeJoin(t1 t2 t3)*/ | |
5919 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
5920 | -LOG: pg_hint_plan: | |
5921 | -used hint: | |
5922 | -MergeJoin(t1 t2 t3) | |
5923 | -Leading(((t1 t2) t3)) | |
5924 | -not used hint: | |
5925 | -duplication hint: | |
5926 | -error hint: | |
5927 | - | |
5928 | - QUERY PLAN | |
5929 | --------------------------------------------------- | |
5930 | - Merge Join | |
5931 | - Merge Cond: (t2.val = t3.val) | |
5932 | - -> Sort | |
5933 | - Sort Key: t2.val | |
5934 | - -> Hash Join | |
5935 | - Hash Cond: (t1.id = t2.id) | |
5936 | - -> Index Scan using t1_pkey on t1 | |
5937 | - Index Cond: (id < 10) | |
5938 | - -> Hash | |
5939 | - -> Seq Scan on t2 | |
5940 | - -> Sort | |
5941 | - Sort Key: t3.val | |
5942 | - -> Seq Scan on t3 | |
5943 | -(13 rows) | |
5944 | - | |
5945 | -/*+Leading(((t1 t2) t3)) MergeJoin(t1 t3)*/ | |
5946 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
5947 | -LOG: pg_hint_plan: | |
5948 | -used hint: | |
5949 | -Leading(((t1 t2) t3)) | |
5950 | -not used hint: | |
5951 | -MergeJoin(t1 t3) | |
5952 | -duplication hint: | |
5953 | -error hint: | |
5954 | - | |
5955 | - QUERY PLAN | |
5956 | --------------------------------------------- | |
5957 | - Nested Loop | |
5958 | - Join Filter: (t2.val = t3.val) | |
5959 | - -> Hash Join | |
5960 | - Hash Cond: (t1.id = t2.id) | |
5961 | - -> Index Scan using t1_pkey on t1 | |
5962 | - Index Cond: (id < 10) | |
5963 | - -> Hash | |
5964 | - -> Seq Scan on t2 | |
5965 | - -> Seq Scan on t3 | |
5966 | -(9 rows) | |
5967 | - | |
5968 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t3.id = t4.id AND t1.val = t3.val AND t1.id < 10; | |
5969 | - QUERY PLAN | |
5970 | --------------------------------------------------------- | |
5971 | - Nested Loop | |
5972 | - -> Merge Join | |
5973 | - Merge Cond: (t3.id = t4.id) | |
5974 | - -> Nested Loop | |
5975 | - Join Filter: (t1.val = t3.val) | |
5976 | - -> Index Scan using t3_pkey on t3 | |
5977 | - -> Materialize | |
5978 | - -> Index Scan using t1_pkey on t1 | |
5979 | - Index Cond: (id < 10) | |
5980 | - -> Sort | |
5981 | - Sort Key: t4.id | |
5982 | - -> Seq Scan on t4 | |
5983 | - -> Index Scan using t2_pkey on t2 | |
5984 | - Index Cond: (id = t1.id) | |
5985 | -(14 rows) | |
5986 | - | |
5987 | -/*+Leading(((t1 t2) t3)) MergeJoin(t3 t4)*/ | |
5988 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t3.id = t4.id AND t1.val = t3.val AND t1.id < 10; | |
5989 | -LOG: pg_hint_plan: | |
5990 | -used hint: | |
5991 | -Leading(((t1 t2) t3)) | |
5992 | -not used hint: | |
5993 | -MergeJoin(t3 t4) | |
5994 | -duplication hint: | |
5995 | -error hint: | |
5996 | - | |
5997 | - QUERY PLAN | |
5998 | --------------------------------------------------- | |
5999 | - Nested Loop | |
6000 | - -> Nested Loop | |
6001 | - Join Filter: (t1.val = t3.val) | |
6002 | - -> Hash Join | |
6003 | - Hash Cond: (t1.id = t2.id) | |
6004 | - -> Index Scan using t1_pkey on t1 | |
6005 | - Index Cond: (id < 10) | |
6006 | - -> Hash | |
6007 | - -> Seq Scan on t2 | |
6008 | - -> Seq Scan on t3 | |
6009 | - -> Index Scan using t4_pkey on t4 | |
6010 | - Index Cond: (id = t3.id) | |
6011 | -(12 rows) | |
6012 | - | |
6013 | -/*+Leading(((t1 t2) t3)) MergeJoin(t1 t2 t3 t4)*/ | |
6014 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t3.id = t4.id AND t1.val = t3.val AND t1.id < 10; | |
6015 | -LOG: pg_hint_plan: | |
6016 | -used hint: | |
6017 | -MergeJoin(t1 t2 t3 t4) | |
6018 | -Leading(((t1 t2) t3)) | |
6019 | -not used hint: | |
6020 | -duplication hint: | |
6021 | -error hint: | |
6022 | - | |
6023 | - QUERY PLAN | |
6024 | --------------------------------------------------------- | |
6025 | - Merge Join | |
6026 | - Merge Cond: (t3.id = t4.id) | |
6027 | - -> Sort | |
6028 | - Sort Key: t3.id | |
6029 | - -> Nested Loop | |
6030 | - Join Filter: (t1.val = t3.val) | |
6031 | - -> Hash Join | |
6032 | - Hash Cond: (t1.id = t2.id) | |
6033 | - -> Index Scan using t1_pkey on t1 | |
6034 | - Index Cond: (id < 10) | |
6035 | - -> Hash | |
6036 | - -> Seq Scan on t2 | |
6037 | - -> Seq Scan on t3 | |
6038 | - -> Sort | |
6039 | - Sort Key: t4.id | |
6040 | - -> Seq Scan on t4 | |
6041 | -(16 rows) | |
6042 | - | |
6043 | -/*+ Leading ( ( t1 ( t2 t3 ) ) ) */ | |
6044 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
6045 | -LOG: pg_hint_plan: | |
6046 | -used hint: | |
6047 | -Leading((t1 (t2 t3))) | |
6048 | -not used hint: | |
6049 | -duplication hint: | |
6050 | -error hint: | |
6051 | - | |
6052 | - QUERY PLAN | |
6053 | --------------------------------------------- | |
6054 | - Hash Join | |
6055 | - Hash Cond: (t1.id = t2.id) | |
6056 | - -> Index Scan using t1_pkey on t1 | |
6057 | - Index Cond: (id < 10) | |
6058 | - -> Hash | |
6059 | - -> Hash Join | |
6060 | - Hash Cond: (t2.val = t3.val) | |
6061 | - -> Seq Scan on t2 | |
6062 | - -> Hash | |
6063 | - -> Seq Scan on t3 | |
6064 | -(10 rows) | |
6065 | - | |
6066 | -/*+Leading((t1(t2 t3)))*/ | |
6067 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
6068 | -LOG: pg_hint_plan: | |
6069 | -used hint: | |
6070 | -Leading((t1 (t2 t3))) | |
6071 | -not used hint: | |
6072 | -duplication hint: | |
6073 | -error hint: | |
6074 | - | |
6075 | - QUERY PLAN | |
6076 | --------------------------------------------- | |
6077 | - Hash Join | |
6078 | - Hash Cond: (t1.id = t2.id) | |
6079 | - -> Index Scan using t1_pkey on t1 | |
6080 | - Index Cond: (id < 10) | |
6081 | - -> Hash | |
6082 | - -> Hash Join | |
6083 | - Hash Cond: (t2.val = t3.val) | |
6084 | - -> Seq Scan on t2 | |
6085 | - -> Hash | |
6086 | - -> Seq Scan on t3 | |
6087 | -(10 rows) | |
6088 | - | |
6089 | -/*+Leading(("t1(t2" "t3)"))*/ | |
6090 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
6091 | -LOG: pg_hint_plan: | |
6092 | -used hint: | |
6093 | -not used hint: | |
6094 | -Leading(("t1(t2" "t3)")) | |
6095 | -duplication hint: | |
6096 | -error hint: | |
6097 | - | |
6098 | - QUERY PLAN | |
6099 | --------------------------------------------------------- | |
6100 | - Hash Join | |
6101 | - Hash Cond: (t3.val = t2.val) | |
6102 | - -> Seq Scan on t3 | |
6103 | - -> Hash | |
6104 | - -> Hash Join | |
6105 | - Hash Cond: (t2.id = t1.id) | |
6106 | - -> Seq Scan on t2 | |
6107 | - -> Hash | |
6108 | - -> Index Scan using t1_pkey on t1 | |
6109 | - Index Cond: (id < 10) | |
6110 | -(10 rows) | |
6111 | - | |
6112 | -/*+ Leading ( ( ( t1 t2 ) t3 ) ) */ | |
6113 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
6114 | -LOG: pg_hint_plan: | |
6115 | -used hint: | |
6116 | -Leading(((t1 t2) t3)) | |
6117 | -not used hint: | |
6118 | -duplication hint: | |
6119 | -error hint: | |
6120 | - | |
6121 | - QUERY PLAN | |
6122 | --------------------------------------------- | |
6123 | - Nested Loop | |
6124 | - Join Filter: (t2.val = t3.val) | |
6125 | - -> Hash Join | |
6126 | - Hash Cond: (t1.id = t2.id) | |
6127 | - -> Index Scan using t1_pkey on t1 | |
6128 | - Index Cond: (id < 10) | |
6129 | - -> Hash | |
6130 | - -> Seq Scan on t2 | |
6131 | - -> Seq Scan on t3 | |
6132 | -(9 rows) | |
6133 | - | |
6134 | -/*+Leading(((t1 t2)t3))*/ | |
6135 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
6136 | -LOG: pg_hint_plan: | |
6137 | -used hint: | |
6138 | -Leading(((t1 t2) t3)) | |
6139 | -not used hint: | |
6140 | -duplication hint: | |
6141 | -error hint: | |
6142 | - | |
6143 | - QUERY PLAN | |
6144 | --------------------------------------------- | |
6145 | - Nested Loop | |
6146 | - Join Filter: (t2.val = t3.val) | |
6147 | - -> Hash Join | |
6148 | - Hash Cond: (t1.id = t2.id) | |
6149 | - -> Index Scan using t1_pkey on t1 | |
6150 | - Index Cond: (id < 10) | |
6151 | - -> Hash | |
6152 | - -> Seq Scan on t2 | |
6153 | - -> Seq Scan on t3 | |
6154 | -(9 rows) | |
6155 | - | |
6156 | -/*+Leading(("(t1" "t2)t3"))*/ | |
6157 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10; | |
6158 | -LOG: pg_hint_plan: | |
6159 | -used hint: | |
6160 | -not used hint: | |
6161 | -Leading(("(t1" "t2)t3")) | |
6162 | -duplication hint: | |
6163 | -error hint: | |
6164 | - | |
6165 | - QUERY PLAN | |
6166 | --------------------------------------------------------- | |
6167 | - Hash Join | |
6168 | - Hash Cond: (t3.val = t2.val) | |
6169 | - -> Seq Scan on t3 | |
6170 | - -> Hash | |
6171 | - -> Hash Join | |
6172 | - Hash Cond: (t2.id = t1.id) | |
6173 | - -> Seq Scan on t2 | |
6174 | - -> Hash | |
6175 | - -> Index Scan using t1_pkey on t1 | |
6176 | - Index Cond: (id < 10) | |
6177 | -(10 rows) | |
6178 | - | |
6179 | -/*+Leading((t1(t2(t3(t4 t5)))))*/ | |
6180 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4, t5 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id AND t1.id = t5.id; | |
6181 | -LOG: pg_hint_plan: | |
6182 | -used hint: | |
6183 | -Leading((t1 (t2 (t3 (t4 t5))))) | |
6184 | -not used hint: | |
6185 | -duplication hint: | |
6186 | -error hint: | |
6187 | - | |
6188 | - QUERY PLAN | |
6189 | ----------------------------------------------------------------------------------------------------------------------------------- | |
6190 | - Merge Join | |
6191 | - Merge Cond: (t1.id = t2.id) | |
6192 | - -> Index Scan using t1_pkey on t1 | |
6193 | - -> Materialize | |
6194 | - -> Merge Join | |
6195 | - Merge Cond: (t2.id = t3.id) | |
6196 | - -> Index Scan using t2_pkey on t2 | |
6197 | - -> Materialize | |
6198 | - -> Merge Join | |
6199 | - Merge Cond: (t3.id = t4.id) | |
6200 | - -> Index Scan using t3_pkey on t3 | |
6201 | - -> Materialize | |
6202 | - -> Merge Join | |
6203 | - Merge Cond: (t4.id = t5.id) | |
6204 | - -> Index Scan using t4_pkey on t4 | |
6205 | - -> Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5 | |
6206 | -(16 rows) | |
6207 | - | |
6208 | -/*+Leading((t5(t4(t3(t2 t1)))))*/ | |
6209 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4, t5 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id AND t1.id = t5.id; | |
6210 | -LOG: pg_hint_plan: | |
6211 | -used hint: | |
6212 | -Leading((t5 (t4 (t3 (t2 t1))))) | |
6213 | -not used hint: | |
6214 | -duplication hint: | |
6215 | -error hint: | |
6216 | - | |
6217 | - QUERY PLAN | |
6218 | --------------------------------------------------------------------------- | |
6219 | - Hash Join | |
6220 | - Hash Cond: (t5.id = t1.id) | |
6221 | - -> Seq Scan on t5 | |
6222 | - -> Hash | |
6223 | - -> Merge Join | |
6224 | - Merge Cond: (t4.id = t1.id) | |
6225 | - -> Sort | |
6226 | - Sort Key: t4.id | |
6227 | - -> Seq Scan on t4 | |
6228 | - -> Materialize | |
6229 | - -> Merge Join | |
6230 | - Merge Cond: (t3.id = t1.id) | |
6231 | - -> Sort | |
6232 | - Sort Key: t3.id | |
6233 | - -> Seq Scan on t3 | |
6234 | - -> Materialize | |
6235 | - -> Merge Join | |
6236 | - Merge Cond: (t2.id = t1.id) | |
6237 | - -> Index Scan using t2_pkey on t2 | |
6238 | - -> Index Scan using t1_pkey on t1 | |
6239 | -(20 rows) | |
6240 | - | |
6241 | -/*+Leading(((((t1 t2)t3)t4)t5))*/ | |
6242 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4, t5 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id AND t1.id = t5.id; | |
6243 | -LOG: pg_hint_plan: | |
6244 | -used hint: | |
6245 | -Leading(((((t1 t2) t3) t4) t5)) | |
6246 | -not used hint: | |
6247 | -duplication hint: | |
6248 | -error hint: | |
6249 | - | |
6250 | - QUERY PLAN | |
6251 | ----------------------------------------------------------------------------------------------- | |
6252 | - Nested Loop | |
6253 | - -> Merge Join | |
6254 | - Merge Cond: (t1.id = t4.id) | |
6255 | - -> Merge Join | |
6256 | - Merge Cond: (t1.id = t3.id) | |
6257 | - -> Merge Join | |
6258 | - Merge Cond: (t1.id = t2.id) | |
6259 | - -> Index Scan using t1_pkey on t1 | |
6260 | - -> Index Scan using t2_pkey on t2 | |
6261 | - -> Index Scan using t3_pkey on t3 | |
6262 | - -> Sort | |
6263 | - Sort Key: t4.id | |
6264 | - -> Seq Scan on t4 | |
6265 | - -> Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5 | |
6266 | - Index Cond: (id = t1.id) | |
6267 | -(15 rows) | |
6268 | - | |
6269 | -/*+Leading(((((t5 t4)t3)t2)t1))*/ | |
6270 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4, t5 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id AND t1.id = t5.id; | |
6271 | -LOG: pg_hint_plan: | |
6272 | -used hint: | |
6273 | -Leading(((((t5 t4) t3) t2) t1)) | |
6274 | -not used hint: | |
6275 | -duplication hint: | |
6276 | -error hint: | |
6277 | - | |
6278 | - QUERY PLAN | |
6279 | ----------------------------------------------------------------------------------------------------------------- | |
6280 | - Nested Loop | |
6281 | - Join Filter: (t2.id = t1.id) | |
6282 | - -> Nested Loop | |
6283 | - Join Filter: (t3.id = t2.id) | |
6284 | - -> Merge Join | |
6285 | - Merge Cond: (t4.id = t3.id) | |
6286 | - -> Merge Join | |
6287 | - Merge Cond: (t5.id = t4.id) | |
6288 | - -> Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5 | |
6289 | - -> Sort | |
6290 | - Sort Key: t4.id | |
6291 | - -> Seq Scan on t4 | |
6292 | - -> Index Scan using t3_pkey on t3 | |
6293 | - -> Index Scan using t2_pkey on t2 | |
6294 | - Index Cond: (id = t5.id) | |
6295 | - -> Index Scan using t1_pkey on t1 | |
6296 | - Index Cond: (id = t5.id) | |
6297 | -(17 rows) | |
6298 | - | |
6299 | -/*+Leading(((t1 t2)(t3(t4 t5))))*/ | |
6300 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4, t5 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id AND t1.id = t5.id; | |
6301 | -LOG: pg_hint_plan: | |
6302 | -used hint: | |
6303 | -Leading(((t1 t2) (t3 (t4 t5)))) | |
6304 | -not used hint: | |
6305 | -duplication hint: | |
6306 | -error hint: | |
6307 | - | |
6308 | - QUERY PLAN | |
6309 | ----------------------------------------------------------------------------------------------------------------------- | |
6310 | - Merge Join | |
6311 | - Merge Cond: (t1.id = t3.id) | |
6312 | - -> Merge Join | |
6313 | - Merge Cond: (t1.id = t2.id) | |
6314 | - -> Index Scan using t1_pkey on t1 | |
6315 | - -> Index Scan using t2_pkey on t2 | |
6316 | - -> Materialize | |
6317 | - -> Merge Join | |
6318 | - Merge Cond: (t3.id = t4.id) | |
6319 | - -> Index Scan using t3_pkey on t3 | |
6320 | - -> Materialize | |
6321 | - -> Merge Join | |
6322 | - Merge Cond: (t4.id = t5.id) | |
6323 | - -> Index Scan using t4_pkey on t4 | |
6324 | - -> Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5 | |
6325 | -(15 rows) | |
6326 | - | |
6327 | -/*+Leading(((t5 t4)(t3(t2 t1))))*/ | |
6328 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4, t5 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id AND t1.id = t5.id; | |
6329 | -LOG: pg_hint_plan: | |
6330 | -used hint: | |
6331 | -Leading(((t5 t4) (t3 (t2 t1)))) | |
6332 | -not used hint: | |
6333 | -duplication hint: | |
6334 | -error hint: | |
6335 | - | |
6336 | - QUERY PLAN | |
6337 | ----------------------------------------------------------------------------------------------------- | |
6338 | - Merge Join | |
6339 | - Merge Cond: (t4.id = t1.id) | |
6340 | - -> Merge Join | |
6341 | - Merge Cond: (t5.id = t4.id) | |
6342 | - -> Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5 | |
6343 | - -> Sort | |
6344 | - Sort Key: t4.id | |
6345 | - -> Seq Scan on t4 | |
6346 | - -> Materialize | |
6347 | - -> Merge Join | |
6348 | - Merge Cond: (t3.id = t1.id) | |
6349 | - -> Index Scan using t3_pkey on t3 | |
6350 | - -> Materialize | |
6351 | - -> Merge Join | |
6352 | - Merge Cond: (t2.id = t1.id) | |
6353 | - -> Index Scan using t2_pkey on t2 | |
6354 | - -> Index Scan using t1_pkey on t1 | |
6355 | -(17 rows) | |
6356 | - | |
6357 | -/*+Leading((((t1 t2)t3)(t4 t5)))*/ | |
6358 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4, t5 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id AND t1.id = t5.id; | |
6359 | -LOG: pg_hint_plan: | |
6360 | -used hint: | |
6361 | -Leading((((t1 t2) t3) (t4 t5))) | |
6362 | -not used hint: | |
6363 | -duplication hint: | |
6364 | -error hint: | |
6365 | - | |
6366 | - QUERY PLAN | |
6367 | ----------------------------------------------------------------------------------------------------------- | |
6368 | - Merge Join | |
6369 | - Merge Cond: (t1.id = t4.id) | |
6370 | - -> Merge Join | |
6371 | - Merge Cond: (t1.id = t3.id) | |
6372 | - -> Merge Join | |
6373 | - Merge Cond: (t1.id = t2.id) | |
6374 | - -> Index Scan using t1_pkey on t1 | |
6375 | - -> Index Scan using t2_pkey on t2 | |
6376 | - -> Index Scan using t3_pkey on t3 | |
6377 | - -> Materialize | |
6378 | - -> Merge Join | |
6379 | - Merge Cond: (t4.id = t5.id) | |
6380 | - -> Index Scan using t4_pkey on t4 | |
6381 | - -> Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5 | |
6382 | -(14 rows) | |
6383 | - | |
6384 | -/*+Leading((((t5 t4)t3)(t2 t1)))*/ | |
6385 | -EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4, t5 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id AND t1.id = t5.id; | |
6386 | -LOG: pg_hint_plan: | |
6387 | -used hint: | |
6388 | -Leading((((t5 t4) t3) (t2 t1))) | |
6389 | -not used hint: | |
6390 | -duplication hint: | |
6391 | -error hint: | |
6392 | - | |
6393 | - QUERY PLAN | |
6394 | ----------------------------------------------------------------------------------------------------------- | |
6395 | - Merge Join | |
6396 | - Merge Cond: (t3.id = t1.id) | |
6397 | - -> Merge Join | |
6398 | - Merge Cond: (t4.id = t3.id) | |
6399 | - -> Merge Join | |
6400 | - Merge Cond: (t5.id = t4.id) | |
6401 | - -> Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5 | |
6402 | - -> Sort | |
6403 | - Sort Key: t4.id | |
6404 | - -> Seq Scan on t4 | |
6405 | - -> Index Scan using t3_pkey on t3 | |
6406 | - -> Materialize | |
6407 | - -> Merge Join | |
6408 | - Merge Cond: (t2.id = t1.id) | |
6409 | - -> Index Scan using t2_pkey on t2 | |
6410 | - -> Index Scan using t1_pkey on t1 | |
6411 | -(16 rows) | |
6412 | - | |
6413 | --- inherite table test to specify the index's name | |
6414 | -EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)'; | |
6415 | - QUERY PLAN | |
6416 | ------------------------------------------------------------------------------ | |
6417 | - Result | |
6418 | - -> Append | |
6419 | - -> Seq Scan on p2 | |
6420 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
6421 | - -> Seq Scan on p2_c1 p2 | |
6422 | - Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid)) | |
6423 | - -> Tid Scan on p2_c1_c1 p2 | |
6424 | - TID Cond: (ctid = '(1,1)'::tid) | |
6425 | - Filter: ((id >= 50) AND (id <= 51)) | |
6426 | - -> Tid Scan on p2_c1_c2 p2 | |
6427 | - TID Cond: (ctid = '(1,1)'::tid) | |
6428 | - Filter: ((id >= 50) AND (id <= 51)) | |
6429 | -(12 rows) | |
6430 | - | |
6431 | -/*+IndexScan(p2 p2_pkey)*/ | |
6432 | -EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)'; | |
6433 | -LOG: available indexes for IndexScan(p2): p2_pkey | |
6434 | -LOG: available indexes for IndexScan(p2_c1): p2_c1_pkey | |
6435 | -LOG: available indexes for IndexScan(p2_c2): p2_c2_pkey | |
6436 | -LOG: available indexes for IndexScan(p2_c3): p2_c3_pkey | |
6437 | -LOG: available indexes for IndexScan(p2_c4): p2_c4_pkey | |
6438 | -LOG: available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey | |
6439 | -LOG: available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey | |
6440 | -LOG: available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey | |
6441 | -LOG: available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey | |
6442 | -LOG: pg_hint_plan: | |
6443 | -used hint: | |
6444 | -IndexScan(p2 p2_pkey) | |
6445 | -not used hint: | |
6446 | -duplication hint: | |
6447 | -error hint: | |
6448 | - | |
6449 | - QUERY PLAN | |
6450 | ------------------------------------------------------------ | |
6451 | - Result | |
6452 | - -> Append | |
6453 | - -> Index Scan using p2_pkey on p2 | |
6454 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
6455 | - Filter: (ctid = '(1,1)'::tid) | |
6456 | - -> Index Scan using p2_c1_pkey on p2_c1 p2 | |
6457 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
6458 | - Filter: (ctid = '(1,1)'::tid) | |
6459 | - -> Index Scan using p2_c1_c1_pkey on p2_c1_c1 p2 | |
6460 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
6461 | - Filter: (ctid = '(1,1)'::tid) | |
6462 | - -> Index Scan using p2_c1_c2_pkey on p2_c1_c2 p2 | |
6463 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
6464 | - Filter: (ctid = '(1,1)'::tid) | |
6465 | -(14 rows) | |
6466 | - | |
6467 | -/*+IndexScan(p2 p2_id_val_idx)*/ | |
6468 | -EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)'; | |
6469 | -LOG: available indexes for IndexScan(p2): p2_id_val_idx | |
6470 | -LOG: available indexes for IndexScan(p2_c1): p2_c1_id_val_idx | |
6471 | -LOG: available indexes for IndexScan(p2_c2): p2_c2_id_val_idx | |
6472 | -LOG: available indexes for IndexScan(p2_c3): p2_c3_id_val_idx | |
6473 | -LOG: available indexes for IndexScan(p2_c4): p2_c4_id_val_idx | |
6474 | -LOG: available indexes for IndexScan(p2_c1_c1): p2_c1_c1_id_val_idx | |
6475 | -LOG: available indexes for IndexScan(p2_c1_c2): p2_c1_c2_id_val_idx | |
6476 | -LOG: available indexes for IndexScan(p2_c3_c1): p2_c3_c1_id_val_idx | |
6477 | -LOG: available indexes for IndexScan(p2_c3_c2): p2_c3_c2_id_val_idx | |
6478 | -LOG: pg_hint_plan: | |
6479 | -used hint: | |
6480 | -IndexScan(p2 p2_id_val_idx) | |
6481 | -not used hint: | |
6482 | -duplication hint: | |
6483 | -error hint: | |
6484 | - | |
6485 | - QUERY PLAN | |
6486 | ------------------------------------------------------------------ | |
6487 | - Result | |
6488 | - -> Append | |
6489 | - -> Index Scan using p2_id_val_idx on p2 | |
6490 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
6491 | - Filter: (ctid = '(1,1)'::tid) | |
6492 | - -> Index Scan using p2_c1_id_val_idx on p2_c1 p2 | |
6493 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
6494 | - Filter: (ctid = '(1,1)'::tid) | |
6495 | - -> Index Scan using p2_c1_c1_id_val_idx on p2_c1_c1 p2 | |
6496 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
6497 | - Filter: (ctid = '(1,1)'::tid) | |
6498 | - -> Index Scan using p2_c1_c2_id_val_idx on p2_c1_c2 p2 | |
6499 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
6500 | - Filter: (ctid = '(1,1)'::tid) | |
6501 | -(14 rows) | |
6502 | - | |
6503 | -/*+IndexScan(p2 p2_val_id_idx)*/ | |
6504 | -EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)'; | |
6505 | -LOG: available indexes for IndexScan(p2): p2_val_id_idx | |
6506 | -LOG: available indexes for IndexScan(p2_c1): p2_c1_val_id_idx | |
6507 | -LOG: available indexes for IndexScan(p2_c2): p2_c2_val_id_idx | |
6508 | -LOG: available indexes for IndexScan(p2_c3): p2_c3_val_id_idx | |
6509 | -LOG: available indexes for IndexScan(p2_c4): | |
6510 | -LOG: available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_id_idx | |
6511 | -LOG: available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_id_idx | |
6512 | -LOG: available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_id_idx | |
6513 | -LOG: available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_id_idx | |
6514 | -LOG: pg_hint_plan: | |
6515 | -used hint: | |
6516 | -IndexScan(p2 p2_val_id_idx) | |
6517 | -not used hint: | |
6518 | -duplication hint: | |
6519 | -error hint: | |
6520 | - | |
6521 | - QUERY PLAN | |
6522 | ------------------------------------------------------------------ | |
6523 | - Result | |
6524 | - -> Append | |
6525 | - -> Index Scan using p2_val_id_idx on p2 | |
6526 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
6527 | - Filter: (ctid = '(1,1)'::tid) | |
6528 | - -> Index Scan using p2_c1_val_id_idx on p2_c1 p2 | |
6529 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
6530 | - Filter: (ctid = '(1,1)'::tid) | |
6531 | - -> Index Scan using p2_c1_c1_val_id_idx on p2_c1_c1 p2 | |
6532 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
6533 | - Filter: (ctid = '(1,1)'::tid) | |
6534 | - -> Index Scan using p2_c1_c2_val_id_idx on p2_c1_c2 p2 | |
6535 | - Index Cond: ((id >= 50) AND (id <= 51)) | |
6536 | - Filter: (ctid = '(1,1)'::tid) | |
6537 | -(14 rows) | |
6538 | - | |
6539 | -EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)'; | |
6540 | - QUERY PLAN | |
6541 | ------------------------------------------------------------------------------------------------ | |
6542 | - Result | |
6543 | - -> Append | |
6544 | - -> Seq Scan on p2 | |
6545 | - Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid)) | |
6546 | - -> Seq Scan on p2_c1 p2 | |
6547 | - Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid)) | |
6548 | - -> Seq Scan on p2_c2 p2 | |
6549 | - Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid)) | |
6550 | - -> Seq Scan on p2_c3 p2 | |
6551 | - Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid)) | |
6552 | - -> Tid Scan on p2_c4 p2 | |
6553 | - TID Cond: (ctid = '(1,1)'::tid) | |
6554 | - Filter: ((val >= '50'::text) AND (val <= '51'::text)) | |
6555 | - -> Tid Scan on p2_c1_c1 p2 | |
6556 | - TID Cond: (ctid = '(1,1)'::tid) | |
6557 | - Filter: ((val >= '50'::text) AND (val <= '51'::text)) | |
6558 | - -> Tid Scan on p2_c1_c2 p2 | |
6559 | - TID Cond: (ctid = '(1,1)'::tid) | |
6560 | - Filter: ((val >= '50'::text) AND (val <= '51'::text)) | |
6561 | - -> Tid Scan on p2_c3_c1 p2 | |
6562 | - TID Cond: (ctid = '(1,1)'::tid) | |
6563 | - Filter: ((val >= '50'::text) AND (val <= '51'::text)) | |
6564 | - -> Tid Scan on p2_c3_c2 p2 | |
6565 | - TID Cond: (ctid = '(1,1)'::tid) | |
6566 | - Filter: ((val >= '50'::text) AND (val <= '51'::text)) | |
6567 | -(25 rows) | |
6568 | - | |
6569 | -/*+IndexScan(p2 p2_val)*/ | |
6570 | -EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)'; | |
6571 | -LOG: available indexes for IndexScan(p2): | |
6572 | -LOG: available indexes for IndexScan(p2_c1): | |
6573 | -LOG: available indexes for IndexScan(p2_c2): | |
6574 | -LOG: available indexes for IndexScan(p2_c3): | |
6575 | -LOG: available indexes for IndexScan(p2_c4): | |
6576 | -LOG: available indexes for IndexScan(p2_c1_c1): | |
6577 | -LOG: available indexes for IndexScan(p2_c1_c2): | |
6578 | -LOG: available indexes for IndexScan(p2_c3_c1): | |
6579 | -LOG: available indexes for IndexScan(p2_c3_c2): | |
6580 | -LOG: pg_hint_plan: | |
6581 | -used hint: | |
6582 | -IndexScan(p2 p2_val) | |
6583 | -not used hint: | |
6584 | -duplication hint: | |
6585 | -error hint: | |
6586 | - | |
6587 | - QUERY PLAN | |
6588 | ------------------------------------------------------------------------------------------------ | |
6589 | - Result | |
6590 | - -> Append | |
6591 | - -> Seq Scan on p2 | |
6592 | - Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid)) | |
6593 | - -> Seq Scan on p2_c1 p2 | |
6594 | - Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid)) | |
6595 |