#
# pg_hint_plan: Makefile
#
-# Copyright (c) 2012-2013, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
+# Copyright (c) 2012-2014, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
#
MODULES = pg_hint_plan
+HINTPLANVER = 1.0.1
REGRESS = init base_plan pg_hint_plan ut-init ut-A ut-S ut-J ut-L ut-G ut-fdw ut-fini
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
REGRESS_OPTS = --encoding=UTF8
EXTENSION = pg_hint_plan
-DATA = pg_hint_plan--1.0.sql
+DATA = pg_hint_plan--1.0--1.0.1.sql pg_hint_plan--1.0.1.sql
EXTRA_CLEAN = core.c sql/ut-fdw.sql expected/ut-fdw.out $(REGRESSION_EXPECTED)
$(REGRESSION_EXPECTED): %.out: %-$(MAJORVERSION).out
cp $< $@
+STARBALL = pg_dbms_stats-$(DBMSSTATSVER).tar.gz
+STARBALL91 = pg_hint_plan91-$(HINTPLANVER).tar.gz
+STARBALLS = $(STARBALL) $(STARBALL91)
+
+TARSOURCES = Makefile *.c *.h \
+ pg_hint_plan--*.sql \
+ pg_hint_plan.control \
+ doc/* expected/*.out sql/*.sql \
+ input/*.source output/*.source SPECS/*.spec
+
installcheck: $(REGRESSION_EXPECTED)
+rpms: rpm91
+
# pg_hint_plan.c includes core.c and make_join_rel.c
pg_hint_plan.o: core.c make_join_rel.c pg_stat_statements.c
+
+$(STARBALLS): $(TARSOURCES)
+ if [ -h $(subst .tar.gz,,$@) ]; then rm $(subst .tar.gz,,$@); fi
+ if [ -e $(subst .tar.gz,,$@) ]; then \
+ echo "$(subst .tar.gz,,$@) is not a symlink. Stop."; \
+ exit 1; \
+ fi
+ ln -s . $(subst .tar.gz,,$@)
+ tar -chzf $@ $(addprefix $(subst .tar.gz,,$@)/, $^)
+ rm $(subst .tar.gz,,$@)
+
+rpm91: $(STARBALL91)
+ MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_hint_plan91.spec
+
+
%define _bindir %{_pgdir}/bin
%define _libdir %{_pgdir}/lib
%define _datadir %{_pgdir}/share
+%if "%(echo ${MAKE_ROOT})" != ""
+ %define _rpmdir %(echo ${MAKE_ROOT})/RPMS
+ %define _sourcedir %(echo ${MAKE_ROOT})
+%endif
## Set general information for pg_hint_plan.
Summary: Optimizer hint for PostgreSQL 9.1
Name: pg_hint_plan91
-Version: 1.1.0
+Version: 1.0.1
Release: 1%{?dist}
License: BSD
Group: Applications/Databases
## pre work for build pg_hint_plan
%prep
+PATH=/usr/pgsql-9.1/bin:$PATH
+if [ "${MAKE_ROOT}" != "" ]; then
+ pushd ${MAKE_ROOT}
+ make clean %{name}-%{version}.tar.gz
+ popd
+fi
+if [ ! -d %{_rpmdir} ]; then mkdir -p %{_rpmdir}; fi
%setup -q
## Set variables for build environment
%build
-make %{?_smp_mflags}
+PATH=/usr/pgsql-9.1/bin:$PATH
+make USE_PGXS=1 %{?_smp_mflags}
## Set variables for install
%install
install -d %{buildroot}%{_libdir}
install pg_hint_plan.so %{buildroot}%{_libdir}/pg_hint_plan.so
install -d %{buildroot}%{_datadir}/extension
-install -m 644 pg_hint_plan--1.0.sql %{buildroot}%{_datadir}/extension/pg_hint_plan--1.0.sql
+install -m 644 pg_hint_plan--1.0.1.sql %{buildroot}%{_datadir}/extension/pg_hint_plan--1.0.1.sql
+install -m 644 pg_hint_plan--1.0--1.0.1.sql %{buildroot}%{_datadir}/extension/pg_hint_plan--1.0--1.0.1.sql
install -m 644 pg_hint_plan.control %{buildroot}%{_datadir}/extension/pg_hint_plan.control
%clean
%defattr(0755,root,root)
%{_libdir}/pg_hint_plan.so
%defattr(0644,root,root)
-%{_datadir}/extension/pg_hint_plan--1.0.sql
+%{_datadir}/extension/pg_hint_plan--1.0.1.sql
+%{_datadir}/extension/pg_hint_plan--1.0--1.0.1.sql
%{_datadir}/extension/pg_hint_plan.control
# History of pg_hint_plan.
%changelog
+* Thu Sep 14 2014 Kyotaro Horiguchi
+- Bug fix.
* Mon Sep 02 2013 Takashi Suzuki
- Initial cut for 1.1.0
* Mon Sep 24 2012 Shigeru Hanada <shigeru.hanada@gmail.com>
+++ /dev/null
-# SPEC file for pg_hint_plan
-# Copyright(C) 2013 NIPPON TELEGRAPH AND TELEPHONE CORPORATION
-
-%define _pgdir /usr/pgsql-9.2
-%define _bindir %{_pgdir}/bin
-%define _libdir %{_pgdir}/lib
-%define _datadir %{_pgdir}/share
-
-## Set general information for pg_hint_plan.
-Summary: Optimizer hint for PostgreSQL 9.2
-Name: pg_hint_plan92
-Version: 1.1.0
-Release: 1%{?dist}
-License: BSD
-Group: Applications/Databases
-Source0: %{name}-%{version}.tar.gz
-#URL: http://example.com/pg_hint_plan/
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
-Vendor: NIPPON TELEGRAPH AND TELEPHONE CORPORATION
-
-## We use postgresql-devel package
-BuildRequires: postgresql92-devel
-Requires: postgresql92-libs
-
-## Description for "pg_hint_plan"
-%description
-pg_hint_plan provides capability to force arbitrary plan to PostgreSQL' planner
-to optimize queries by hand directly.
-
-If you have query plan better than which PostgreSQL chooses, you can force your
-plan by adding special comment block with optimizer hint before the query you
-want to optimize. You can control scan method, join method, join order, and
-planner-related GUC parameters during planning.
-
-Note that this package is available for only PostgreSQL 9.2.
-
-## pre work for build pg_hint_plan
-%prep
-%setup -q
-
-## Set variables for build environment
-%build
-make %{?_smp_mflags}
-
-## Set variables for install
-%install
-rm -rf %{buildroot}
-install -d %{buildroot}%{_libdir}
-install pg_hint_plan.so %{buildroot}%{_libdir}/pg_hint_plan.so
-install -d %{buildroot}%{_datadir}/extension
-install -m 644 pg_hint_plan--1.0.sql %{buildroot}%{_datadir}/extension/pg_hint_plan--1.0.sql
-install -m 644 pg_hint_plan.control %{buildroot}%{_datadir}/extension/pg_hint_plan.control
-
-%clean
-rm -rf %{buildroot}
-
-%files
-%defattr(0755,root,root)
-%{_libdir}/pg_hint_plan.so
-%defattr(0644,root,root)
-%{_datadir}/extension/pg_hint_plan--1.0.sql
-%{_datadir}/extension/pg_hint_plan.control
-
-# History of pg_hint_plan.
-%changelog
-* Mon Sep 02 2013 Takashi Suzuki
-- Initial cut for 1.1.0
-* Mon Sep 24 2012 Shigeru Hanada <shigeru.hanada@gmail.com>
-- Initial cut for 1.0.0
-
+++ /dev/null
-/*-------------------------------------------------------------------------
- *
- * core.c
- * Routines copied from PostgreSQL core distribution.
- *
- * src/backend/optimizer/path/allpaths.c
- * set_append_rel_pathlist()
- * generate_mergeappend_paths()
- * accumulate_append_subpath()
- * standard_join_search()
- *
- * src/backend/optimizer/path/joinrels.c
- * join_search_one_level()
- * make_rels_by_clause_joins()
- * make_rels_by_clauseless_joins()
- * join_is_legal()
- * has_join_restriction()
- * is_dummy_rel()
- * mark_dummy_rel()
- * restriction_is_constant_false()
- *
- * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- *-------------------------------------------------------------------------
- */
-
-/*
- * set_append_rel_pathlist
- * Build access paths for an "append relation"
- */
-static void
-set_append_rel_pathlist(PlannerInfo *root, RelOptInfo *rel,
- Index rti, RangeTblEntry *rte)
-{
- int parentRTindex = rti;
- List *live_childrels = NIL;
- List *subpaths = NIL;
- List *all_child_pathkeys = NIL;
- List *all_child_outers = NIL;
- ListCell *l;
-
- /*
- * Generate access paths for each member relation, and remember the
- * cheapest path for each one. Also, identify all pathkeys (orderings)
- * and parameterizations (required_outer sets) available for the member
- * relations.
- */
- foreach(l, root->append_rel_list)
- {
- AppendRelInfo *appinfo = (AppendRelInfo *) lfirst(l);
- int childRTindex;
- RangeTblEntry *childRTE;
- RelOptInfo *childrel;
- ListCell *lcp;
-
- /* append_rel_list contains all append rels; ignore others */
- if (appinfo->parent_relid != parentRTindex)
- continue;
-
- /* Re-locate the child RTE and RelOptInfo */
- childRTindex = appinfo->child_relid;
- childRTE = root->simple_rte_array[childRTindex];
- childrel = root->simple_rel_array[childRTindex];
-
- /*
- * Compute the child's access paths.
- */
- set_rel_pathlist(root, childrel, childRTindex, childRTE);
-
- /*
- * If child is dummy, ignore it.
- */
- if (IS_DUMMY_REL(childrel))
- continue;
-
- /*
- * Child is live, so add its cheapest access path to the Append path
- * we are constructing for the parent.
- */
- subpaths = accumulate_append_subpath(subpaths,
- childrel->cheapest_total_path);
-
- /* Remember which childrels are live, for logic below */
- live_childrels = lappend(live_childrels, childrel);
-
- /*
- * Collect lists of all the available path orderings and
- * parameterizations for all the children. We use these as a
- * heuristic to indicate which sort orderings and parameterizations we
- * should build Append and MergeAppend paths for.
- */
- foreach(lcp, childrel->pathlist)
- {
- Path *childpath = (Path *) lfirst(lcp);
- List *childkeys = childpath->pathkeys;
- Relids childouter = PATH_REQ_OUTER(childpath);
-
- /* Unsorted paths don't contribute to pathkey list */
- if (childkeys != NIL)
- {
- ListCell *lpk;
- bool found = false;
-
- /* Have we already seen this ordering? */
- foreach(lpk, all_child_pathkeys)
- {
- List *existing_pathkeys = (List *) lfirst(lpk);
-
- if (compare_pathkeys(existing_pathkeys,
- childkeys) == PATHKEYS_EQUAL)
- {
- found = true;
- break;
- }
- }
- if (!found)
- {
- /* No, so add it to all_child_pathkeys */
- all_child_pathkeys = lappend(all_child_pathkeys,
- childkeys);
- }
- }
-
- /* Unparameterized paths don't contribute to param-set list */
- if (childouter)
- {
- ListCell *lco;
- bool found = false;
-
- /* Have we already seen this param set? */
- foreach(lco, all_child_outers)
- {
- Relids existing_outers = (Relids) lfirst(lco);
-
- if (bms_equal(existing_outers, childouter))
- {
- found = true;
- break;
- }
- }
- if (!found)
- {
- /* No, so add it to all_child_outers */
- all_child_outers = lappend(all_child_outers,
- childouter);
- }
- }
- }
- }
-
- /*
- * Next, build an unordered, unparameterized Append path for the rel.
- * (Note: this is correct even if we have zero or one live subpath due to
- * constraint exclusion.)
- */
- add_path(rel, (Path *) create_append_path(rel, subpaths, NULL));
-
- /*
- * Build unparameterized MergeAppend paths based on the collected list of
- * child pathkeys.
- */
- generate_mergeappend_paths(root, rel, live_childrels, all_child_pathkeys);
-
- /*
- * Build Append paths for each parameterization seen among the child rels.
- * (This may look pretty expensive, but in most cases of practical
- * interest, the child rels will expose mostly the same parameterizations,
- * so that not that many cases actually get considered here.)
- *
- * The Append node itself cannot enforce quals, so all qual checking must
- * be done in the child paths. This means that to have a parameterized
- * Append path, we must have the exact same parameterization for each
- * child path; otherwise some children might be failing to check the
- * moved-down quals. To make them match up, we can try to increase the
- * parameterization of lesser-parameterized paths.
- */
- foreach(l, all_child_outers)
- {
- Relids required_outer = (Relids) lfirst(l);
- bool ok = true;
- ListCell *lcr;
-
- /* Select the child paths for an Append with this parameterization */
- subpaths = NIL;
- foreach(lcr, live_childrels)
- {
- RelOptInfo *childrel = (RelOptInfo *) lfirst(lcr);
- Path *cheapest_total;
-
- cheapest_total =
- get_cheapest_path_for_pathkeys(childrel->pathlist,
- NIL,
- required_outer,
- TOTAL_COST);
- Assert(cheapest_total != NULL);
-
- /* Children must have exactly the desired parameterization */
- if (!bms_equal(PATH_REQ_OUTER(cheapest_total), required_outer))
- {
- cheapest_total = reparameterize_path(root, cheapest_total,
- required_outer, 1.0);
- if (cheapest_total == NULL)
- {
- ok = false;
- break;
- }
- }
-
- subpaths = accumulate_append_subpath(subpaths, cheapest_total);
- }
-
- if (ok)
- add_path(rel, (Path *)
- create_append_path(rel, subpaths, required_outer));
- }
-
- /* Select cheapest paths */
- set_cheapest(rel);
-}
-
-/*
- * generate_mergeappend_paths
- * Generate MergeAppend paths for an append relation
- *
- * Generate a path for each ordering (pathkey list) appearing in
- * all_child_pathkeys.
- *
- * We consider both cheapest-startup and cheapest-total cases, ie, for each
- * interesting ordering, collect all the cheapest startup subpaths and all the
- * cheapest total paths, and build a MergeAppend path for each case.
- *
- * We don't currently generate any parameterized MergeAppend paths. While
- * it would not take much more code here to do so, it's very unclear that it
- * is worth the planning cycles to investigate such paths: there's little
- * use for an ordered path on the inside of a nestloop. In fact, it's likely
- * that the current coding of add_path would reject such paths out of hand,
- * because add_path gives no credit for sort ordering of parameterized paths,
- * and a parameterized MergeAppend is going to be more expensive than the
- * corresponding parameterized Append path. If we ever try harder to support
- * parameterized mergejoin plans, it might be worth adding support for
- * parameterized MergeAppends to feed such joins. (See notes in
- * optimizer/README for why that might not ever happen, though.)
- */
-static void
-generate_mergeappend_paths(PlannerInfo *root, RelOptInfo *rel,
- List *live_childrels,
- List *all_child_pathkeys)
-{
- ListCell *lcp;
-
- foreach(lcp, all_child_pathkeys)
- {
- List *pathkeys = (List *) lfirst(lcp);
- List *startup_subpaths = NIL;
- List *total_subpaths = NIL;
- bool startup_neq_total = false;
- ListCell *lcr;
-
- /* Select the child paths for this ordering... */
- foreach(lcr, live_childrels)
- {
- RelOptInfo *childrel = (RelOptInfo *) lfirst(lcr);
- Path *cheapest_startup,
- *cheapest_total;
-
- /* Locate the right paths, if they are available. */
- cheapest_startup =
- get_cheapest_path_for_pathkeys(childrel->pathlist,
- pathkeys,
- NULL,
- STARTUP_COST);
- cheapest_total =
- get_cheapest_path_for_pathkeys(childrel->pathlist,
- pathkeys,
- NULL,
- TOTAL_COST);
-
- /*
- * If we can't find any paths with the right order just use the
- * cheapest-total path; we'll have to sort it later.
- */
- if (cheapest_startup == NULL || cheapest_total == NULL)
- {
- cheapest_startup = cheapest_total =
- childrel->cheapest_total_path;
- Assert(cheapest_total != NULL);
- }
-
- /*
- * Notice whether we actually have different paths for the
- * "cheapest" and "total" cases; frequently there will be no point
- * in two create_merge_append_path() calls.
- */
- if (cheapest_startup != cheapest_total)
- startup_neq_total = true;
-
- startup_subpaths =
- accumulate_append_subpath(startup_subpaths, cheapest_startup);
- total_subpaths =
- accumulate_append_subpath(total_subpaths, cheapest_total);
- }
-
- /* ... and build the MergeAppend paths */
- add_path(rel, (Path *) create_merge_append_path(root,
- rel,
- startup_subpaths,
- pathkeys,
- NULL));
- if (startup_neq_total)
- add_path(rel, (Path *) create_merge_append_path(root,
- rel,
- total_subpaths,
- pathkeys,
- NULL));
- }
-}
-
-/*
- * accumulate_append_subpath
- * Add a subpath to the list being built for an Append or MergeAppend
- *
- * It's possible that the child is itself an Append path, in which case
- * we can "cut out the middleman" and just add its child paths to our
- * own list. (We don't try to do this earlier because we need to
- * apply both levels of transformation to the quals.)
- */
-static List *
-accumulate_append_subpath(List *subpaths, Path *path)
-{
- if (IsA(path, AppendPath))
- {
- AppendPath *apath = (AppendPath *) path;
-
- /* list_copy is important here to avoid sharing list substructure */
- return list_concat(subpaths, list_copy(apath->subpaths));
- }
- else
- return lappend(subpaths, path);
-}
-
-/*
- * standard_join_search
- * Find possible joinpaths for a query by successively finding ways
- * to join component relations into join relations.
- *
- * 'levels_needed' is the number of iterations needed, ie, the number of
- * independent jointree items in the query. This is > 1.
- *
- * 'initial_rels' is a list of RelOptInfo nodes for each independent
- * jointree item. These are the components to be joined together.
- * Note that levels_needed == list_length(initial_rels).
- *
- * Returns the final level of join relations, i.e., the relation that is
- * the result of joining all the original relations together.
- * At least one implementation path must be provided for this relation and
- * all required sub-relations.
- *
- * To support loadable plugins that modify planner behavior by changing the
- * join searching algorithm, we provide a hook variable that lets a plugin
- * replace or supplement this function. Any such hook must return the same
- * final join relation as the standard code would, but it might have a
- * different set of implementation paths attached, and only the sub-joinrels
- * needed for these paths need have been instantiated.
- *
- * Note to plugin authors: the functions invoked during standard_join_search()
- * modify root->join_rel_list and root->join_rel_hash. If you want to do more
- * than one join-order search, you'll probably need to save and restore the
- * original states of those data structures. See geqo_eval() for an example.
- */
-RelOptInfo *
-standard_join_search(PlannerInfo *root, int levels_needed, List *initial_rels)
-{
- int lev;
- RelOptInfo *rel;
-
- /*
- * This function cannot be invoked recursively within any one planning
- * problem, so join_rel_level[] can't be in use already.
- */
- Assert(root->join_rel_level == NULL);
-
- /*
- * We employ a simple "dynamic programming" algorithm: we first find all
- * ways to build joins of two jointree items, then all ways to build joins
- * of three items (from two-item joins and single items), then four-item
- * joins, and so on until we have considered all ways to join all the
- * items into one rel.
- *
- * root->join_rel_level[j] is a list of all the j-item rels. Initially we
- * set root->join_rel_level[1] to represent all the single-jointree-item
- * relations.
- */
- root->join_rel_level = (List **) palloc0((levels_needed + 1) * sizeof(List *));
-
- root->join_rel_level[1] = initial_rels;
-
- for (lev = 2; lev <= levels_needed; lev++)
- {
- ListCell *lc;
-
- /*
- * Determine all possible pairs of relations to be joined at this
- * level, and build paths for making each one from every available
- * pair of lower-level relations.
- */
- join_search_one_level(root, lev);
-
- /*
- * Do cleanup work on each just-processed rel.
- */
- foreach(lc, root->join_rel_level[lev])
- {
- rel = (RelOptInfo *) lfirst(lc);
-
- /* Find and save the cheapest paths for this rel */
- set_cheapest(rel);
-
-#ifdef OPTIMIZER_DEBUG
- debug_print_rel(root, rel);
-#endif
- }
- }
-
- /*
- * We should have a single rel at the final level.
- */
- if (root->join_rel_level[levels_needed] == NIL)
- elog(ERROR, "failed to build any %d-way joins", levels_needed);
- Assert(list_length(root->join_rel_level[levels_needed]) == 1);
-
- rel = (RelOptInfo *) linitial(root->join_rel_level[levels_needed]);
-
- root->join_rel_level = NULL;
-
- return rel;
-}
-
-/*
- * join_search_one_level
- * Consider ways to produce join relations containing exactly 'level'
- * jointree items. (This is one step of the dynamic-programming method
- * embodied in standard_join_search.) Join rel nodes for each feasible
- * combination of lower-level rels are created and returned in a list.
- * Implementation paths are created for each such joinrel, too.
- *
- * level: level of rels we want to make this time
- * root->join_rel_level[j], 1 <= j < level, is a list of rels containing j items
- *
- * The result is returned in root->join_rel_level[level].
- */
-void
-join_search_one_level(PlannerInfo *root, int level)
-{
- List **joinrels = root->join_rel_level;
- ListCell *r;
- int k;
-
- Assert(joinrels[level] == NIL);
-
- /* Set join_cur_level so that new joinrels are added to proper list */
- root->join_cur_level = level;
-
- /*
- * First, consider left-sided and right-sided plans, in which rels of
- * exactly level-1 member relations are joined against initial relations.
- * We prefer to join using join clauses, but if we find a rel of level-1
- * members that has no join clauses, we will generate Cartesian-product
- * joins against all initial rels not already contained in it.
- */
- foreach(r, joinrels[level - 1])
- {
- RelOptInfo *old_rel = (RelOptInfo *) lfirst(r);
-
- if (old_rel->joininfo != NIL || old_rel->has_eclass_joins ||
- has_join_restriction(root, old_rel))
- {
- /*
- * There are join clauses or join order restrictions relevant to
- * this rel, so consider joins between this rel and (only) those
- * initial rels it is linked to by a clause or restriction.
- *
- * At level 2 this condition is symmetric, so there is no need to
- * look at initial rels before this one in the list; we already
- * considered such joins when we were at the earlier rel. (The
- * mirror-image joins are handled automatically by make_join_rel.)
- * In later passes (level > 2), we join rels of the previous level
- * to each initial rel they don't already include but have a join
- * clause or restriction with.
- */
- ListCell *other_rels;
-
- if (level == 2) /* consider remaining initial rels */
- other_rels = lnext(r);
- else /* consider all initial rels */
- other_rels = list_head(joinrels[1]);
-
- make_rels_by_clause_joins(root,
- old_rel,
- other_rels);
- }
- else
- {
- /*
- * Oops, we have a relation that is not joined to any other
- * relation, either directly or by join-order restrictions.
- * Cartesian product time.
- *
- * We consider a cartesian product with each not-already-included
- * initial rel, whether it has other join clauses or not. At
- * level 2, if there are two or more clauseless initial rels, we
- * will redundantly consider joining them in both directions; but
- * such cases aren't common enough to justify adding complexity to
- * avoid the duplicated effort.
- */
- make_rels_by_clauseless_joins(root,
- old_rel,
- list_head(joinrels[1]));
- }
- }
-
- /*
- * Now, consider "bushy plans" in which relations of k initial rels are
- * joined to relations of level-k initial rels, for 2 <= k <= level-2.
- *
- * We only consider bushy-plan joins for pairs of rels where there is a
- * suitable join clause (or join order restriction), in order to avoid
- * unreasonable growth of planning time.
- */
- for (k = 2;; k++)
- {
- int other_level = level - k;
-
- /*
- * Since make_join_rel(x, y) handles both x,y and y,x cases, we only
- * need to go as far as the halfway point.
- */
- if (k > other_level)
- break;
-
- foreach(r, joinrels[k])
- {
- RelOptInfo *old_rel = (RelOptInfo *) lfirst(r);
- ListCell *other_rels;
- ListCell *r2;
-
- /*
- * We can ignore relations without join clauses here, unless they
- * participate in join-order restrictions --- then we might have
- * to force a bushy join plan.
- */
- if (old_rel->joininfo == NIL && !old_rel->has_eclass_joins &&
- !has_join_restriction(root, old_rel))
- continue;
-
- if (k == other_level)
- other_rels = lnext(r); /* only consider remaining rels */
- else
- other_rels = list_head(joinrels[other_level]);
-
- for_each_cell(r2, other_rels)
- {
- RelOptInfo *new_rel = (RelOptInfo *) lfirst(r2);
-
- if (!bms_overlap(old_rel->relids, new_rel->relids))
- {
- /*
- * OK, we can build a rel of the right level from this
- * pair of rels. Do so if there is at least one relevant
- * join clause or join order restriction.
- */
- if (have_relevant_joinclause(root, old_rel, new_rel) ||
- have_join_order_restriction(root, old_rel, new_rel))
- {
- (void) make_join_rel(root, old_rel, new_rel);
- }
- }
- }
- }
- }
-
- /*----------
- * Last-ditch effort: if we failed to find any usable joins so far, force
- * a set of cartesian-product joins to be generated. This handles the
- * special case where all the available rels have join clauses but we
- * cannot use any of those clauses yet. This can only happen when we are
- * considering a join sub-problem (a sub-joinlist) and all the rels in the
- * sub-problem have only join clauses with rels outside the sub-problem.
- * An example is
- *
- * SELECT ... FROM a INNER JOIN b ON TRUE, c, d, ...
- * WHERE a.w = c.x and b.y = d.z;
- *
- * If the "a INNER JOIN b" sub-problem does not get flattened into the
- * upper level, we must be willing to make a cartesian join of a and b;
- * but the code above will not have done so, because it thought that both
- * a and b have joinclauses. We consider only left-sided and right-sided
- * cartesian joins in this case (no bushy).
- *----------
- */
- if (joinrels[level] == NIL)
- {
- /*
- * This loop is just like the first one, except we always call
- * make_rels_by_clauseless_joins().
- */
- foreach(r, joinrels[level - 1])
- {
- RelOptInfo *old_rel = (RelOptInfo *) lfirst(r);
-
- make_rels_by_clauseless_joins(root,
- old_rel,
- list_head(joinrels[1]));
- }
-
- /*----------
- * When special joins are involved, there may be no legal way
- * to make an N-way join for some values of N. For example consider
- *
- * SELECT ... FROM t1 WHERE
- * x IN (SELECT ... FROM t2,t3 WHERE ...) AND
- * y IN (SELECT ... FROM t4,t5 WHERE ...)
- *
- * We will flatten this query to a 5-way join problem, but there are
- * no 4-way joins that join_is_legal() will consider legal. We have
- * to accept failure at level 4 and go on to discover a workable
- * bushy plan at level 5.
- *
- * However, if there are no special joins then join_is_legal() should
- * never fail, and so the following sanity check is useful.
- *----------
- */
- if (joinrels[level] == NIL && root->join_info_list == NIL)
- elog(ERROR, "failed to build any %d-way joins", level);
- }
-}
-
-/*
- * make_rels_by_clause_joins
- * Build joins between the given relation 'old_rel' and other relations
- * that participate in join clauses that 'old_rel' also participates in
- * (or participate in join-order restrictions with it).
- * The join rels are returned in root->join_rel_level[join_cur_level].
- *
- * Note: at levels above 2 we will generate the same joined relation in
- * multiple ways --- for example (a join b) join c is the same RelOptInfo as
- * (b join c) join a, though the second case will add a different set of Paths
- * to it. This is the reason for using the join_rel_level mechanism, which
- * automatically ensures that each new joinrel is only added to the list once.
- *
- * 'old_rel' is the relation entry for the relation to be joined
- * 'other_rels': the first cell in a linked list containing the other
- * rels to be considered for joining
- *
- * Currently, this is only used with initial rels in other_rels, but it
- * will work for joining to joinrels too.
- */
-static void
-make_rels_by_clause_joins(PlannerInfo *root,
- RelOptInfo *old_rel,
- ListCell *other_rels)
-{
- ListCell *l;
-
- for_each_cell(l, other_rels)
- {
- RelOptInfo *other_rel = (RelOptInfo *) lfirst(l);
-
- if (!bms_overlap(old_rel->relids, other_rel->relids) &&
- (have_relevant_joinclause(root, old_rel, other_rel) ||
- have_join_order_restriction(root, old_rel, other_rel)))
- {
- (void) make_join_rel(root, old_rel, other_rel);
- }
- }
-}
-
-/*
- * make_rels_by_clauseless_joins
- * Given a relation 'old_rel' and a list of other relations
- * 'other_rels', create a join relation between 'old_rel' and each
- * member of 'other_rels' that isn't already included in 'old_rel'.
- * The join rels are returned in root->join_rel_level[join_cur_level].
- *
- * 'old_rel' is the relation entry for the relation to be joined
- * 'other_rels': the first cell of a linked list containing the
- * other rels to be considered for joining
- *
- * Currently, this is only used with initial rels in other_rels, but it would
- * work for joining to joinrels too.
- */
-static void
-make_rels_by_clauseless_joins(PlannerInfo *root,
- RelOptInfo *old_rel,
- ListCell *other_rels)
-{
- ListCell *l;
-
- for_each_cell(l, other_rels)
- {
- RelOptInfo *other_rel = (RelOptInfo *) lfirst(l);
-
- if (!bms_overlap(other_rel->relids, old_rel->relids))
- {
- (void) make_join_rel(root, old_rel, other_rel);
- }
- }
-}
-
-/*
- * join_is_legal
- * Determine whether a proposed join is legal given the query's
- * join order constraints; and if it is, determine the join type.
- *
- * Caller must supply not only the two rels, but the union of their relids.
- * (We could simplify the API by computing joinrelids locally, but this
- * would be redundant work in the normal path through make_join_rel.)
- *
- * On success, *sjinfo_p is set to NULL if this is to be a plain inner join,
- * else it's set to point to the associated SpecialJoinInfo node. Also,
- * *reversed_p is set TRUE if the given relations need to be swapped to
- * match the SpecialJoinInfo node.
- */
-static bool
-join_is_legal(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2,
- Relids joinrelids,
- SpecialJoinInfo **sjinfo_p, bool *reversed_p)
-{
- SpecialJoinInfo *match_sjinfo;
- bool reversed;
- bool unique_ified;
- bool is_valid_inner;
- ListCell *l;
-
- /*
- * Ensure output params are set on failure return. This is just to
- * suppress uninitialized-variable warnings from overly anal compilers.
- */
- *sjinfo_p = NULL;
- *reversed_p = false;
-
- /*
- * If we have any special joins, the proposed join might be illegal; and
- * in any case we have to determine its join type. Scan the join info
- * list for conflicts.
- */
- match_sjinfo = NULL;
- reversed = false;
- unique_ified = false;
- is_valid_inner = true;
-
- foreach(l, root->join_info_list)
- {
- SpecialJoinInfo *sjinfo = (SpecialJoinInfo *) lfirst(l);
-
- /*
- * This special join is not relevant unless its RHS overlaps the
- * proposed join. (Check this first as a fast path for dismissing
- * most irrelevant SJs quickly.)
- */
- if (!bms_overlap(sjinfo->min_righthand, joinrelids))
- continue;
-
- /*
- * Also, not relevant if proposed join is fully contained within RHS
- * (ie, we're still building up the RHS).
- */
- if (bms_is_subset(joinrelids, sjinfo->min_righthand))
- continue;
-
- /*
- * Also, not relevant if SJ is already done within either input.
- */
- if (bms_is_subset(sjinfo->min_lefthand, rel1->relids) &&
- bms_is_subset(sjinfo->min_righthand, rel1->relids))
- continue;
- if (bms_is_subset(sjinfo->min_lefthand, rel2->relids) &&
- bms_is_subset(sjinfo->min_righthand, rel2->relids))
- continue;
-
- /*
- * If it's a semijoin and we already joined the RHS to any other rels
- * within either input, then we must have unique-ified the RHS at that
- * point (see below). Therefore the semijoin is no longer relevant in
- * this join path.
- */
- if (sjinfo->jointype == JOIN_SEMI)
- {
- if (bms_is_subset(sjinfo->syn_righthand, rel1->relids) &&
- !bms_equal(sjinfo->syn_righthand, rel1->relids))
- continue;
- if (bms_is_subset(sjinfo->syn_righthand, rel2->relids) &&
- !bms_equal(sjinfo->syn_righthand, rel2->relids))
- continue;
- }
-
- /*
- * If one input contains min_lefthand and the other contains
- * min_righthand, then we can perform the SJ at this join.
- *
- * Barf if we get matches to more than one SJ (is that possible?)
- */
- if (bms_is_subset(sjinfo->min_lefthand, rel1->relids) &&
- bms_is_subset(sjinfo->min_righthand, rel2->relids))
- {
- if (match_sjinfo)
- return false; /* invalid join path */
- match_sjinfo = sjinfo;
- reversed = false;
- }
- else if (bms_is_subset(sjinfo->min_lefthand, rel2->relids) &&
- bms_is_subset(sjinfo->min_righthand, rel1->relids))
- {
- if (match_sjinfo)
- return false; /* invalid join path */
- match_sjinfo = sjinfo;
- reversed = true;
- }
- else if (sjinfo->jointype == JOIN_SEMI &&
- bms_equal(sjinfo->syn_righthand, rel2->relids) &&
- create_unique_path(root, rel2, rel2->cheapest_total_path,
- sjinfo) != NULL)
- {
- /*----------
- * For a semijoin, we can join the RHS to anything else by
- * unique-ifying the RHS (if the RHS can be unique-ified).
- * We will only get here if we have the full RHS but less
- * than min_lefthand on the LHS.
- *
- * The reason to consider such a join path is exemplified by
- * SELECT ... FROM a,b WHERE (a.x,b.y) IN (SELECT c1,c2 FROM c)
- * If we insist on doing this as a semijoin we will first have
- * to form the cartesian product of A*B. But if we unique-ify
- * C then the semijoin becomes a plain innerjoin and we can join
- * in any order, eg C to A and then to B. When C is much smaller
- * than A and B this can be a huge win. So we allow C to be
- * joined to just A or just B here, and then make_join_rel has
- * to handle the case properly.
- *
- * Note that actually we'll allow unique-ified C to be joined to
- * some other relation D here, too. That is legal, if usually not
- * very sane, and this routine is only concerned with legality not
- * with whether the join is good strategy.
- *----------
- */
- if (match_sjinfo)
- return false; /* invalid join path */
- match_sjinfo = sjinfo;
- reversed = false;
- unique_ified = true;
- }
- else if (sjinfo->jointype == JOIN_SEMI &&
- bms_equal(sjinfo->syn_righthand, rel1->relids) &&
- create_unique_path(root, rel1, rel1->cheapest_total_path,
- sjinfo) != NULL)
- {
- /* Reversed semijoin case */
- if (match_sjinfo)
- return false; /* invalid join path */
- match_sjinfo = sjinfo;
- reversed = true;
- unique_ified = true;
- }
- else
- {
- /*----------
- * Otherwise, the proposed join overlaps the RHS but isn't
- * a valid implementation of this SJ. It might still be
- * a legal join, however. If both inputs overlap the RHS,
- * assume that it's OK. Since the inputs presumably got past
- * this function's checks previously, they can't overlap the
- * LHS and their violations of the RHS boundary must represent
- * SJs that have been determined to commute with this one.
- * We have to allow this to work correctly in cases like
- * (a LEFT JOIN (b JOIN (c LEFT JOIN d)))
- * when the c/d join has been determined to commute with the join
- * to a, and hence d is not part of min_righthand for the upper
- * join. It should be legal to join b to c/d but this will appear
- * as a violation of the upper join's RHS.
- * Furthermore, if one input overlaps the RHS and the other does
- * not, we should still allow the join if it is a valid
- * implementation of some other SJ. We have to allow this to
- * support the associative identity
- * (a LJ b on Pab) LJ c ON Pbc = a LJ (b LJ c ON Pbc) on Pab
- * since joining B directly to C violates the lower SJ's RHS.
- * We assume that make_outerjoininfo() set things up correctly
- * so that we'll only match to some SJ if the join is valid.
- * Set flag here to check at bottom of loop.
- *----------
- */
- if (sjinfo->jointype != JOIN_SEMI &&
- bms_overlap(rel1->relids, sjinfo->min_righthand) &&
- bms_overlap(rel2->relids, sjinfo->min_righthand))
- {
- /* seems OK */
- Assert(!bms_overlap(joinrelids, sjinfo->min_lefthand));
- }
- else
- is_valid_inner = false;
- }
- }
-
- /*
- * Fail if violated some SJ's RHS and didn't match to another SJ. However,
- * "matching" to a semijoin we are implementing by unique-ification
- * doesn't count (think: it's really an inner join).
- */
- if (!is_valid_inner &&
- (match_sjinfo == NULL || unique_ified))
- return false; /* invalid join path */
-
- /* Otherwise, it's a valid join */
- *sjinfo_p = match_sjinfo;
- *reversed_p = reversed;
- return true;
-}
-
-/*
- * has_join_restriction
- * Detect whether the specified relation has join-order restrictions
- * due to being inside an outer join or an IN (sub-SELECT).
- *
- * Essentially, this tests whether have_join_order_restriction() could
- * succeed with this rel and some other one. It's OK if we sometimes
- * say "true" incorrectly. (Therefore, we don't bother with the relatively
- * expensive has_legal_joinclause test.)
- */
-static bool
-has_join_restriction(PlannerInfo *root, RelOptInfo *rel)
-{
- ListCell *l;
-
- foreach(l, root->join_info_list)
- {
- SpecialJoinInfo *sjinfo = (SpecialJoinInfo *) lfirst(l);
-
- /* ignore full joins --- other mechanisms preserve their ordering */
- if (sjinfo->jointype == JOIN_FULL)
- continue;
-
- /* ignore if SJ is already contained in rel */
- if (bms_is_subset(sjinfo->min_lefthand, rel->relids) &&
- bms_is_subset(sjinfo->min_righthand, rel->relids))
- continue;
-
- /* restricted if it overlaps LHS or RHS, but doesn't contain SJ */
- if (bms_overlap(sjinfo->min_lefthand, rel->relids) ||
- bms_overlap(sjinfo->min_righthand, rel->relids))
- return true;
- }
-
- return false;
-}
-
-/*
- * is_dummy_rel --- has relation been proven empty?
- */
-static bool
-is_dummy_rel(RelOptInfo *rel)
-{
- return IS_DUMMY_REL(rel);
-}
-
-/*
- * Mark a relation as proven empty.
- *
- * During GEQO planning, this can get invoked more than once on the same
- * baserel struct, so it's worth checking to see if the rel is already marked
- * dummy.
- *
- * Also, when called during GEQO join planning, we are in a short-lived
- * memory context. We must make sure that the dummy path attached to a
- * baserel survives the GEQO cycle, else the baserel is trashed for future
- * GEQO cycles. On the other hand, when we are marking a joinrel during GEQO,
- * we don't want the dummy path to clutter the main planning context. Upshot
- * is that the best solution is to explicitly make the dummy path in the same
- * context the given RelOptInfo is in.
- */
-static void
-mark_dummy_rel(RelOptInfo *rel)
-{
- MemoryContext oldcontext;
-
- /* Already marked? */
- if (is_dummy_rel(rel))
- return;
-
- /* No, so choose correct context to make the dummy path in */
- oldcontext = MemoryContextSwitchTo(GetMemoryChunkContext(rel));
-
- /* Set dummy size estimate */
- rel->rows = 0;
-
- /* Evict any previously chosen paths */
- rel->pathlist = NIL;
-
- /* Set up the dummy path */
- add_path(rel, (Path *) create_append_path(rel, NIL, NULL));
-
- /* Set or update cheapest_total_path and related fields */
- set_cheapest(rel);
-
- MemoryContextSwitchTo(oldcontext);
-}
-
-/*
- * restriction_is_constant_false --- is a restrictlist just FALSE?
- *
- * In cases where a qual is provably constant FALSE, eval_const_expressions
- * will generally have thrown away anything that's ANDed with it. In outer
- * join situations this will leave us computing cartesian products only to
- * decide there's no match for an outer row, which is pretty stupid. So,
- * we need to detect the case.
- *
- * If only_pushed_down is TRUE, then consider only pushed-down quals.
- */
-static bool
-restriction_is_constant_false(List *restrictlist, bool only_pushed_down)
-{
- ListCell *lc;
-
- /*
- * Despite the above comment, the restriction list we see here might
- * possibly have other members besides the FALSE constant, since other
- * quals could get "pushed down" to the outer join level. So we check
- * each member of the list.
- */
- foreach(lc, restrictlist)
- {
- RestrictInfo *rinfo = (RestrictInfo *) lfirst(lc);
-
- Assert(IsA(rinfo, RestrictInfo));
- if (only_pushed_down && !rinfo->is_pushed_down)
- continue;
-
- if (rinfo->clause && IsA(rinfo->clause, Const))
- {
- Const *con = (Const *) rinfo->clause;
-
- /* constant NULL is as good as constant FALSE for our purposes */
- if (con->constisnull)
- return true;
- if (!DatumGetBool(con->constvalue))
- return true;
- }
- }
- return false;
-}
+++ /dev/null
-SET search_path TO public;
--- query type 1
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
- QUERY PLAN
---------------------------------------
- Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(4 rows)
-
--- query type 2
-EXPLAIN (COSTS false) SELECT * FROM t1, t4 WHERE t1.val < 10;
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Bitmap Heap Scan on t1
- Recheck Cond: (val < 10)
- -> Bitmap Index Scan on t1_val
- Index Cond: (val < 10)
- -> Materialize
- -> Seq Scan on t4
-(7 rows)
-
--- query type 3
-EXPLAIN (COSTS false) SELECT * FROM t3, t4 WHERE t3.id = t4.id AND t4.ctid = '(1,1)';
- QUERY PLAN
----------------------------------------------
- Merge Join
- Merge Cond: (t3.id = t4.id)
- -> Index Scan using t3_pkey on t3
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- Filter: (ctid = '(1,1)'::tid)
-(7 rows)
-
--- query type 4
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)';
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
-(5 rows)
-
--- query type 5
-EXPLAIN (COSTS false) SELECT * FROM t1, t3 WHERE t1.val = t3.val;
- QUERY PLAN
---------------------------------
- Hash Join
- Hash Cond: (t1.val = t3.val)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t3
-(5 rows)
-
--- query type 6
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
- QUERY PLAN
---------------------------------------------------
- Nested Loop
- -> Merge Join
- Merge Cond: (t1.id = t4.id)
- -> Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Index Scan using t3_pkey on t3
- Index Cond: (id = t1.id)
-(12 rows)
-
+++ /dev/null
-SET search_path TO public;
-CREATE EXTENSION pg_hint_plan;
-CREATE SCHEMA s0;
-CREATE TABLE t1 (id int PRIMARY KEY, val int);
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for table "t1"
-CREATE TABLE t2 (id int PRIMARY KEY, val int);
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t2_pkey" for table "t2"
-CREATE TABLE t3 (id int PRIMARY KEY, val int);
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t3_pkey" for table "t3"
-CREATE TABLE t4 (id int PRIMARY KEY, val int);
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t4_pkey" for table "t4"
-CREATE TABLE t5 (id int PRIMARY KEY, val int);
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t5_pkey" for table "t5"
-CREATE TABLE p1 (id int PRIMARY KEY, val int);
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_pkey" for table "p1"
-CREATE TABLE p1_c1 (LIKE p1 INCLUDING ALL, CHECK (id <= 100)) INHERITS(p1);
-NOTICE: merging column "id" with inherited definition
-NOTICE: merging column "val" with inherited definition
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_c1_pkey" for table "p1_c1"
-CREATE TABLE p1_c2 (LIKE p1 INCLUDING ALL, CHECK (id > 100 AND id <= 200)) INHERITS(p1);
-NOTICE: merging column "id" with inherited definition
-NOTICE: merging column "val" with inherited definition
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_c2_pkey" for table "p1_c2"
-CREATE TABLE p1_c3 (LIKE p1 INCLUDING ALL, CHECK (id > 200 AND id <= 300)) INHERITS(p1);
-NOTICE: merging column "id" with inherited definition
-NOTICE: merging column "val" with inherited definition
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_c3_pkey" for table "p1_c3"
-CREATE TABLE p1_c4 (LIKE p1 INCLUDING ALL, CHECK (id > 300)) INHERITS(p1);
-NOTICE: merging column "id" with inherited definition
-NOTICE: merging column "val" with inherited definition
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_c4_pkey" for table "p1_c4"
-CREATE TABLE p1_c1_c1 (LIKE p1 INCLUDING ALL, CHECK (id <= 50)) INHERITS(p1_c1);
-NOTICE: merging column "id" with inherited definition
-NOTICE: merging column "val" with inherited definition
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_c1_c1_pkey" for table "p1_c1_c1"
-CREATE TABLE p1_c1_c2 (LIKE p1 INCLUDING ALL, CHECK (id > 50 AND id <= 100)) INHERITS(p1_c1);
-NOTICE: merging column "id" with inherited definition
-NOTICE: merging column "val" with inherited definition
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_c1_c2_pkey" for table "p1_c1_c2"
-CREATE TABLE p1_c3_c1 (LIKE p1 INCLUDING ALL, CHECK (id > 200 AND id <= 250)) INHERITS(p1_c3);
-NOTICE: merging column "id" with inherited definition
-NOTICE: merging column "val" with inherited definition
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_c3_c1_pkey" for table "p1_c3_c1"
-CREATE TABLE p1_c3_c2 (LIKE p1 INCLUDING ALL, CHECK (id > 250 AND id <= 300)) INHERITS(p1_c3);
-NOTICE: merging column "id" with inherited definition
-NOTICE: merging column "val" with inherited definition
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p1_c3_c2_pkey" for table "p1_c3_c2"
-CREATE TABLE p2 (id int PRIMARY KEY, val text);
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_pkey" for table "p2"
-CREATE INDEX p2_id_val_idx ON p2 (id, val);
-CREATE UNIQUE INDEX p2_val_idx ON p2 (val);
-CREATE INDEX p2_ununi_id_val_idx ON p2 (val);
-CREATE INDEX p2_val_idx_1 ON p2 USING hash (val);
-CREATE INDEX p2_val_id_idx ON p2 (val, id);
-CREATE INDEX p2_val_idx2 ON p2 (val COLLATE "ja_JP");
-CREATE INDEX p2_val_idx3 ON p2 (val varchar_ops);
-CREATE INDEX p2_val_idx4 ON p2 (val DESC NULLS LAST);
-CREATE INDEX p2_val_idx5 ON p2 (val NULLS FIRST);
-CREATE INDEX p2_expr ON p2 ((val < '120'));
-CREATE INDEX p2_expr2 ON p2 ((id * 2 < 120));
-CREATE INDEX p2_val_idx6 ON p2 (val) WHERE val >= '50' AND val < '51';
-CREATE INDEX p2_val_idx7 ON p2 (val) WHERE id < 120;
-CREATE TABLE p2_c1 (LIKE p2 INCLUDING ALL, CHECK (id <= 100)) INHERITS(p2);
-NOTICE: merging column "id" with inherited definition
-NOTICE: merging column "val" with inherited definition
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_c1_pkey" for table "p2_c1"
-CREATE TABLE p2_c2 (LIKE p2 INCLUDING ALL, CHECK (id > 100 AND id <= 200)) INHERITS(p2);
-NOTICE: merging column "id" with inherited definition
-NOTICE: merging column "val" with inherited definition
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_c2_pkey" for table "p2_c2"
-CREATE TABLE p2_c3 (LIKE p2 INCLUDING ALL, CHECK (id > 200 AND id <= 300)) INHERITS(p2);
-NOTICE: merging column "id" with inherited definition
-NOTICE: merging column "val" with inherited definition
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_c3_pkey" for table "p2_c3"
-CREATE TABLE p2_c4 (LIKE p2 INCLUDING ALL, CHECK (id > 300)) INHERITS(p2);
-NOTICE: merging column "id" with inherited definition
-NOTICE: merging column "val" with inherited definition
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_c4_pkey" for table "p2_c4"
-CREATE TABLE p2_c1_c1 (LIKE p2 INCLUDING ALL, CHECK (id <= 50)) INHERITS(p2_c1);
-NOTICE: merging column "id" with inherited definition
-NOTICE: merging column "val" with inherited definition
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_c1_c1_pkey" for table "p2_c1_c1"
-CREATE TABLE p2_c1_c2 (LIKE p2 INCLUDING ALL, CHECK (id > 50 AND id <= 100)) INHERITS(p2_c1);
-NOTICE: merging column "id" with inherited definition
-NOTICE: merging column "val" with inherited definition
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_c1_c2_pkey" for table "p2_c1_c2"
-CREATE TABLE p2_c3_c1 (LIKE p2 INCLUDING ALL, CHECK (id > 200 AND id <= 250)) INHERITS(p2_c3);
-NOTICE: merging column "id" with inherited definition
-NOTICE: merging column "val" with inherited definition
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_c3_c1_pkey" for table "p2_c3_c1"
-CREATE TABLE p2_c3_c2 (LIKE p2 INCLUDING ALL, CHECK (id > 250 AND id <= 300)) INHERITS(p2_c3);
-NOTICE: merging column "id" with inherited definition
-NOTICE: merging column "val" with inherited definition
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "p2_c3_c2_pkey" for table "p2_c3_c2"
-CREATE TABLE s0.t1 (id int PRIMARY KEY, val int);
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for table "t1"
-INSERT INTO t1 SELECT i, i % 100 FROM (SELECT generate_series(1, 10000) i) t;
-INSERT INTO t2 SELECT i, i % 10 FROM (SELECT generate_series(1, 1000) i) t;
-INSERT INTO t3 SELECT i, i FROM (SELECT generate_series(1, 100) i) t;
-INSERT INTO t4 SELECT i, i FROM (SELECT generate_series(1, 10) i) t;
-INSERT INTO t5 SELECT i, i % 100 FROM (SELECT generate_series(1, 10000) i) t;
-INSERT INTO p1_c1_c1 SELECT i, i % 100 FROM (SELECT generate_series(1, 50) i) t;
-INSERT INTO p1_c1_c2 SELECT i, i % 100 FROM (SELECT generate_series(51, 100) i) t;
-INSERT INTO p1_c2 SELECT i, i % 100 FROM (SELECT generate_series(101, 200) i) t;
-INSERT INTO p1_c3_c1 SELECT i, i % 100 FROM (SELECT generate_series(201, 250) i) t;
-INSERT INTO p1_c3_c2 SELECT i, i % 100 FROM (SELECT generate_series(251, 300) i) t;
-INSERT INTO p1_c4 SELECT i, i % 100 FROM (SELECT generate_series(301, 400) i) t;
-INSERT INTO p2_c1_c1 SELECT i, i % 100 FROM (SELECT generate_series(1, 50) i) t;
-INSERT INTO p2_c1_c2 SELECT i, i % 100 FROM (SELECT generate_series(51, 100) i) t;
-INSERT INTO p2_c2 SELECT i, i % 100 FROM (SELECT generate_series(101, 200) i) t;
-INSERT INTO p2_c3_c1 SELECT i, i % 100 FROM (SELECT generate_series(201, 250) i) t;
-INSERT INTO p2_c3_c2 SELECT i, i % 100 FROM (SELECT generate_series(251, 300) i) t;
-INSERT INTO p2_c4 SELECT i, i % 100 FROM (SELECT generate_series(301, 400) i) t;
-CREATE INDEX t1_val ON t1 (val);
-CREATE INDEX t2_val ON t2 (val);
-CREATE INDEX t5_id1 ON t5 (id);
-CREATE INDEX t5_id2 ON t5 (id);
-CREATE INDEX t5_id3 ON t5 (id);
-CREATE INDEX t5_val ON t5 (val);
-DROP INDEX p2_c4_val_id_idx;
-CREATE INDEX p2_id2_val ON p2 (id, id, val);
-CREATE INDEX p2_c1_id2_val ON p2_c1 (id, id, val);
-CREATE INDEX p2_c2_id2_val ON p2_c2 (id, id, val);
-CREATE INDEX p2_val2_id ON p2 (val, id, val);
-CREATE INDEX t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ON t5 (id);
-CREATE INDEX p1_val1 ON p1 (val);
-CREATE INDEX p1_val2 ON p1 (val);
-CREATE INDEX p1_val3 ON p1 (val);
-CREATE INDEX p1_c1_val1 ON p1_c1 (val);
-CREATE INDEX p1_c1_val2 ON p1_c1 (val);
-CREATE INDEX p1_c1_val3 ON p1_c1 (val);
-CREATE INDEX p1_c1_c1_val1 ON p1_c1_c1 (val);
-CREATE INDEX p1_c1_c1_val2 ON p1_c1_c1 (val);
-CREATE INDEX p1_c1_c1_val3 ON p1_c1_c1 (val);
-CREATE INDEX p1_c1_c2_val1 ON p1_c1_c2 (val);
-CREATE INDEX p1_c1_c2_val2 ON p1_c1_c2 (val);
-CREATE INDEX p1_c1_c2_val3 ON p1_c1_c2 (val);
-CREATE INDEX p1_c2_val1 ON p1_c2 (val);
-CREATE INDEX p1_c2_val2 ON p1_c2 (val);
-CREATE INDEX p1_c2_val3 ON p1_c2 (val);
-CREATE INDEX p1_c3_val1 ON p1_c3 (val);
-CREATE INDEX p1_c3_val2 ON p1_c3 (val);
-CREATE INDEX p1_c3_val3 ON p1_c3 (val);
-CREATE INDEX p1_c3_c1_val1 ON p1_c3_c1 (val);
-CREATE INDEX p1_c3_c1_val2 ON p1_c3_c1 (val);
-CREATE INDEX p1_c3_c1_val3 ON p1_c3_c1 (val);
-CREATE INDEX p1_c3_c2_val1 ON p1_c3_c2 (val);
-CREATE INDEX p1_c3_c2_val2 ON p1_c3_c2 (val);
-CREATE INDEX p1_c3_c2_val3 ON p1_c3_c2 (val);
-CREATE INDEX p1_c4_val1 ON p1_c4 (val);
-CREATE INDEX p1_c4_val2 ON p1_c4 (val);
-CREATE INDEX p1_c4_val3 ON p1_c4 (val);
-ANALYZE t1;
-ANALYZE t2;
-ANALYZE t3;
-ANALYZE t4;
-ANALYZE t5;
-ANALYZE p1;
-ANALYZE p1_c1;
-ANALYZE p1_c2;
-ANALYZE p2;
-CREATE VIEW v1 AS SELECT id, val FROM t1;
-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;
-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;
-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;
-/*
- * The following GUC parameters need the setting of the default value to
- * succeed in regression test.
- */
-CREATE VIEW settings AS
-SELECT name, setting, category
- FROM pg_settings
- WHERE category LIKE 'Query Tuning%'
- OR name = 'client_min_messages'
- ORDER BY category, name;
-SELECT * FROM settings;
- name | setting | category
----------------------------+-----------+---------------------------------------------
- geqo | on | Query Tuning / Genetic Query Optimizer
- geqo_effort | 5 | Query Tuning / Genetic Query Optimizer
- geqo_generations | 0 | Query Tuning / Genetic Query Optimizer
- geqo_pool_size | 0 | Query Tuning / Genetic Query Optimizer
- geqo_seed | 0 | Query Tuning / Genetic Query Optimizer
- geqo_selection_bias | 2 | Query Tuning / Genetic Query Optimizer
- geqo_threshold | 12 | Query Tuning / Genetic Query Optimizer
- constraint_exclusion | partition | Query Tuning / Other Planner Options
- cursor_tuple_fraction | 0.1 | Query Tuning / Other Planner Options
- default_statistics_target | 100 | Query Tuning / Other Planner Options
- from_collapse_limit | 8 | Query Tuning / Other Planner Options
- join_collapse_limit | 8 | Query Tuning / Other Planner Options
- cpu_index_tuple_cost | 0.005 | Query Tuning / Planner Cost Constants
- cpu_operator_cost | 0.0025 | Query Tuning / Planner Cost Constants
- cpu_tuple_cost | 0.01 | Query Tuning / Planner Cost Constants
- effective_cache_size | 16384 | Query Tuning / Planner Cost Constants
- random_page_cost | 4 | Query Tuning / Planner Cost Constants
- seq_page_cost | 1 | Query Tuning / Planner Cost Constants
- enable_bitmapscan | on | Query Tuning / Planner Method Configuration
- enable_hashagg | on | Query Tuning / Planner Method Configuration
- enable_hashjoin | on | Query Tuning / Planner Method Configuration
- enable_indexonlyscan | on | Query Tuning / Planner Method Configuration
- enable_indexscan | on | Query Tuning / Planner Method Configuration
- enable_material | on | Query Tuning / Planner Method Configuration
- enable_mergejoin | on | Query Tuning / Planner Method Configuration
- enable_nestloop | on | Query Tuning / Planner Method Configuration
- enable_seqscan | on | Query Tuning / Planner Method Configuration
- enable_sort | on | Query Tuning / Planner Method Configuration
- enable_tidscan | on | Query Tuning / Planner Method Configuration
- client_min_messages | notice | Reporting and Logging / When to Log
-(30 rows)
-
-> Sort
Sort Key: t3_5.id
-> Seq Scan on t3 t3_5
- InitPlan 2 (returns $2)
+ InitPlan 2 (returns $3)
-> Aggregate
-> Merge Join
Merge Cond: (t1_2.id = t3_2.id)
-> Sort
Sort Key: t3_2.id
-> Seq Scan on t3 t3_2
- InitPlan 3 (returns $3)
+ InitPlan 3 (returns $5)
-> Aggregate
-> Merge Join
Merge Cond: (t1_4.id = t3_4.id)
-> Nested Loop
-> Nested Loop
-> Index Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Seq Scan on t3 t3_1
- Filter: (id = $3)
+ Filter: (id = $5)
-> Index Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Index Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Index Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Seq Scan on t3 t3_3
- Filter: (id = $3)
+ Filter: (id = $5)
-> CTE Scan on c1_1
- Filter: (id = $3)
+ Filter: (id = $5)
(53 rows)
/*+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)*/
-> Sort
Sort Key: t3_5.id
-> Seq Scan on t3 t3_5
- InitPlan 2 (returns $2)
+ InitPlan 2 (returns $3)
-> Aggregate
-> Merge Join
Merge Cond: (t1_2.id = t3_2.id)
-> Sort
Sort Key: t3_2.id
-> Seq Scan on t3 t3_2
- InitPlan 3 (returns $3)
+ InitPlan 3 (returns $5)
-> Aggregate
-> Merge Join
Merge Cond: (t1_4.id = t3_4.id)
-> Nested Loop
-> Nested Loop
-> Index Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Seq Scan on t3 t3_1
- Filter: (id = $3)
+ Filter: (id = $5)
-> Index Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Index Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Index Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Seq Scan on t3 t3_3
- Filter: (id = $3)
+ Filter: (id = $5)
-> CTE Scan on c1_1
- Filter: (id = $3)
+ Filter: (id = $5)
(53 rows)
/*+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)*/
-> Sort
Sort Key: t3_5.id
-> Seq Scan on t3 t3_5
- InitPlan 2 (returns $2)
+ InitPlan 2 (returns $3)
-> Aggregate
-> Merge Join
Merge Cond: (t1_2.id = t3_2.id)
-> Sort
Sort Key: t3_2.id
-> Seq Scan on t3 t3_2
- InitPlan 3 (returns $3)
+ InitPlan 3 (returns $5)
-> Aggregate
-> Merge Join
Merge Cond: (t1_4.id = t3_4.id)
-> Nested Loop
-> Nested Loop
-> Index Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Seq Scan on t3 t3_1
- Filter: (id = $3)
+ Filter: (id = $5)
-> Index Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Index Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Index Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Seq Scan on t3 t3_3
- Filter: (id = $3)
+ Filter: (id = $5)
-> CTE Scan on c1_1
- Filter: (id = $3)
+ Filter: (id = $5)
(53 rows)
/*+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)*/
-> Sort
Sort Key: t3_5.id
-> Seq Scan on t3 t3_5
- InitPlan 2 (returns $2)
+ InitPlan 2 (returns $3)
-> Aggregate
-> Merge Join
Merge Cond: (t1_2.id = t3_2.id)
-> Sort
Sort Key: t3_2.id
-> Seq Scan on t3 t3_2
- InitPlan 3 (returns $3)
+ InitPlan 3 (returns $5)
-> Aggregate
-> Merge Join
Merge Cond: (t1_4.id = t3_4.id)
-> Nested Loop
-> Nested Loop
-> Index Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Seq Scan on t3 t3_1
- Filter: (id = $3)
+ Filter: (id = $5)
-> Index Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Nested Loop
-> Nested Loop
-> Index Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Seq Scan on t3 t3_3
- Filter: (id = $3)
+ Filter: (id = $5)
-> Index Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> CTE Scan on c1_1
- Filter: (id = $3)
+ Filter: (id = $5)
(53 rows)
/*+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)*/
-> Sort
Sort Key: t3_5.id
-> Seq Scan on t3 t3_5
- InitPlan 2 (returns $2)
+ InitPlan 2 (returns $3)
-> Aggregate
-> Merge Join
Merge Cond: (t1_2.id = t3_2.id)
-> Sort
Sort Key: t3_2.id
-> Seq Scan on t3 t3_2
- InitPlan 3 (returns $3)
+ InitPlan 3 (returns $5)
-> Aggregate
-> Merge Join
Merge Cond: (t1_4.id = t3_4.id)
-> Nested Loop
-> Nested Loop
-> Index Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Seq Scan on t3 t3_1
- Filter: (id = $3)
+ Filter: (id = $5)
-> Index Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Nested Loop
-> Nested Loop
-> Index Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Seq Scan on t3 t3_3
- Filter: (id = $3)
+ Filter: (id = $5)
-> Index Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> CTE Scan on c1_1
- Filter: (id = $3)
+ Filter: (id = $5)
(53 rows)
/*+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)*/
-> Sort
Sort Key: t3_5.id
-> Seq Scan on t3 t3_5
- InitPlan 2 (returns $2)
+ InitPlan 2 (returns $3)
-> Aggregate
-> Merge Join
Merge Cond: (t1_2.id = t3_2.id)
-> Sort
Sort Key: t3_2.id
-> Seq Scan on t3 t3_2
- InitPlan 3 (returns $3)
+ InitPlan 3 (returns $5)
-> Aggregate
-> Merge Join
Merge Cond: (t1_4.id = t3_4.id)
-> Nested Loop
-> Nested Loop
-> Index Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Seq Scan on t3 t3_1
- Filter: (id = $3)
+ Filter: (id = $5)
-> Index Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Nested Loop
-> Nested Loop
-> Index Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> Seq Scan on t3 t3_3
- Filter: (id = $3)
+ Filter: (id = $5)
-> Index Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $3)
+ Index Cond: (id = $5)
-> CTE Scan on c1_1
- Filter: (id = $3)
+ Filter: (id = $5)
(53 rows)
/*+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)*/
+++ /dev/null
-SET search_path TO public;
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
- QUERY PLAN
---------------------------------------
- Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(4 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.val = t2.val;
- QUERY PLAN
--------------------------------------------
- Merge Join
- Merge Cond: (t2.val = t1.val)
- -> Index Scan using t2_val on t2
- -> Materialize
- -> Index Scan using t1_val on t1
-(5 rows)
-
-LOAD 'pg_hint_plan';
-SET pg_hint_plan.debug_print TO on;
-SET client_min_messages TO LOG;
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
- QUERY PLAN
---------------------------------------
- Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(4 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.val = t2.val;
- QUERY PLAN
--------------------------------------------
- Merge Join
- Merge Cond: (t2.val = t1.val)
- -> Index Scan using t2_val on t2
- -> Materialize
- -> Index Scan using t1_val on t1
-(5 rows)
-
-/*+ Test (t1 t2) */
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-INFO: hint syntax error at or near "Test (t1 t2) "
-DETAIL: Unrecognized hint keyword "Test".
- QUERY PLAN
---------------------------------------
- Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(4 rows)
-
-SET pg_hint_plan.enable_hint TO off;
-/*+ Test (t1 t2) */
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
- QUERY PLAN
---------------------------------------
- Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(4 rows)
-
-SET pg_hint_plan.enable_hint TO on;
-/*Set(enable_indexscan off)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
- QUERY PLAN
---------------------------------------
- Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(4 rows)
-
---+Set(enable_indexscan off)
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
- QUERY PLAN
---------------------------------------
- Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(4 rows)
-
-/*+Set(enable_indexscan off) /* nest comment */ */
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-INFO: hint syntax error at or near "/* nest comment */ */
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;"
-DETAIL: Nested block comments are not supported.
- QUERY PLAN
---------------------------------------
- Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(4 rows)
-
-/*+Set(enable_indexscan off)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-EXPLAIN (COSTS false) /*+Set(enable_indexscan off)*/
- SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-/*+ Set(enable_indexscan off) Set(enable_hashjoin off) */
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_hashjoin off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------
- Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Sort
- Sort Key: t1.id
- -> Seq Scan on t1
- -> Sort
- Sort Key: t2.id
- -> Seq Scan on t2
-(8 rows)
-
-/*+ Set ( enable_indexscan off ) */
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-/*+
- Set
- (
- enable_indexscan
- off
- )
- */
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-/*+ Set(enable_indexscan off)Set(enable_nestloop off)Set(enable_mergejoin off)
- Set(enable_seqscan off)
- */
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_indexscan off)
-Set(enable_mergejoin off)
-Set(enable_nestloop off)
-Set(enable_seqscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Index Scan using t2_pkey on t2
- -> Bitmap Heap Scan on t1
- Recheck Cond: (id = t2.id)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id = t2.id)
-(6 rows)
-
-/*+Set(work_mem "1M")*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-INFO: invalid value for parameter "work_mem": "1M"
-HINT: Valid units for this parameter are "kB", "MB", and "GB".
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Set(work_mem 1M)
-
- QUERY PLAN
---------------------------------------
- Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(4 rows)
-
-/*+Set(work_mem "1MB")*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-Set(work_mem 1MB)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------
- Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(4 rows)
-
-/*+Set(work_mem TO "1MB")*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-INFO: hint syntax error at or near "Set(work_mem TO "1MB")"
-DETAIL: Set hint requires name and value of GUC parameter.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Set(work_mem TO 1MB)
-
- QUERY PLAN
---------------------------------------
- Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(4 rows)
-
-/*+SeqScan(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-INFO: hint syntax error at or near ""
-DETAIL: SeqScan hint accepts only one relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-SeqScan(t1 t2)
-
- QUERY PLAN
---------------------------------------
- Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-/*+SeqScan(t1)IndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-IndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------
- Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Seq Scan on t1
- -> Hash
- -> Index Scan using t2_pkey on t2
-(5 rows)
-
-/*+BitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Seq Scan on t1
- -> Bitmap Heap Scan on t2
- Recheck Cond: (id = t1.id)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (id = t1.id)
-(6 rows)
-
-/*+BitmapScan(t2)NoSeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-NoSeqScan(t1)
-BitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Index Scan using t1_pkey on t1
- -> Bitmap Heap Scan on t2
- Recheck Cond: (id = t1.id)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (id = t1.id)
-(6 rows)
-
-/*+NoIndexScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-NoIndexScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-/*+NoBitmapScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t4 WHERE t1.val < 10;
-LOG: pg_hint_plan:
-used hint:
-NoBitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------
- Nested Loop
- -> Seq Scan on t1
- Filter: (val < 10)
- -> Materialize
- -> Seq Scan on t4
-(5 rows)
-
-/*+TidScan(t4)*/
-EXPLAIN (COSTS false) SELECT * FROM t3, t4 WHERE t3.id = t4.id AND t4.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(t4)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------
- Merge Join
- Merge Cond: (t3.id = t4.id)
- -> Index Scan using t3_pkey on t3
- -> Sort
- Sort Key: t4.id
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-(7 rows)
-
-/*+NoTidScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoTidScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Nested Loop
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
-(5 rows)
-
-/*+HashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-/*+NestLoop(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------
- Nested Loop
- -> Seq Scan on t2
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
-(4 rows)
-
-/*+NoMergeJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-NoMergeJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-/*+MergeJoin(t1 t3)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t3 WHERE t1.val = t3.val;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(t1 t3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Merge Join
- Merge Cond: (t1.val = t3.val)
- -> Index Scan using t1_val on t1
- -> Sort
- Sort Key: t3.val
- -> Seq Scan on t3
-(6 rows)
-
-/*+NestLoop(t1 t3)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t3 WHERE t1.val = t3.val;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Nested Loop
- -> Seq Scan on t3
- -> Index Scan using t1_val on t1
- Index Cond: (val = t3.val)
-(4 rows)
-
-/*+NoHashJoin(t1 t3)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t3 WHERE t1.val = t3.val;
-LOG: pg_hint_plan:
-used hint:
-NoHashJoin(t1 t3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Nested Loop
- -> Seq Scan on t3
- -> Index Scan using t1_val on t1
- Index Cond: (val = t3.val)
-(4 rows)
-
-/*+MergeJoin(t4 t1 t2 t3)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(t1 t2 t3 t4)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------
- Merge Join
- Merge Cond: (t1.id = t4.id)
- -> Merge Join
- Merge Cond: (t1.id = t3.id)
- -> Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
- -> Index Scan using t3_pkey on t3
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
-(12 rows)
-
-/*+HashJoin(t3 t4 t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1 t2 t3 t4)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------
- Hash Join
- Hash Cond: (t3.id = t1.id)
- -> Seq Scan on t3
- -> Hash
- -> Merge Join
- Merge Cond: (t1.id = t4.id)
- -> Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
-(13 rows)
-
-/*+NestLoop(t2 t3 t4 t1) IndexScan(t3)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t3)
-NestLoop(t1 t2 t3 t4)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------
- Nested Loop
- -> Merge Join
- Merge Cond: (t1.id = t4.id)
- -> Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Index Scan using t3_pkey on t3
- Index Cond: (id = t1.id)
-(12 rows)
-
-/*+NoNestLoop(t4 t1 t3 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
-LOG: pg_hint_plan:
-used hint:
-NoNestLoop(t1 t2 t3 t4)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------
- Merge Join
- Merge Cond: (t1.id = t4.id)
- -> Merge Join
- Merge Cond: (t1.id = t3.id)
- -> Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
- -> Index Scan using t3_pkey on t3
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
-(12 rows)
-
-/*+Leading( */
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
-INFO: hint syntax error at or near ""
-DETAIL: Closing parenthesis is necessary.
- QUERY PLAN
---------------------------------------------------
- Nested Loop
- -> Merge Join
- Merge Cond: (t1.id = t4.id)
- -> Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Index Scan using t3_pkey on t3
- Index Cond: (id = t1.id)
-(12 rows)
-
-/*+Leading( )*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
-INFO: hint syntax error at or near "Leading( )"
-DETAIL: Leading hint requires at least two relations.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading()
-
- QUERY PLAN
---------------------------------------------------
- Nested Loop
- -> Merge Join
- Merge Cond: (t1.id = t4.id)
- -> Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Index Scan using t3_pkey on t3
- Index Cond: (id = t1.id)
-(12 rows)
-
-/*+Leading( t3 )*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
-INFO: hint syntax error at or near "Leading( t3 )"
-DETAIL: Leading hint requires at least two relations.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading(t3)
-
- QUERY PLAN
---------------------------------------------------
- Nested Loop
- -> Merge Join
- Merge Cond: (t1.id = t4.id)
- -> Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Index Scan using t3_pkey on t3
- Index Cond: (id = t1.id)
-(12 rows)
-
-/*+Leading( t3 t4 )*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
-LOG: pg_hint_plan:
-used hint:
-Leading(t3 t4)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------
- Nested Loop
- -> Nested Loop
- -> Merge Join
- Merge Cond: (t3.id = t4.id)
- -> Index Scan using t3_pkey on t3
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t3.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
-(12 rows)
-
-/*+Leading(t3 t4 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
-LOG: pg_hint_plan:
-used hint:
-Leading(t3 t4 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------
- Nested Loop
- -> Merge Join
- Merge Cond: (t3.id = t1.id)
- -> Merge Join
- Merge Cond: (t3.id = t4.id)
- -> Index Scan using t3_pkey on t3
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
-(12 rows)
-
-/*+Leading(t3 t4 t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
-LOG: pg_hint_plan:
-used hint:
-Leading(t3 t4 t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------
- Nested Loop
- -> Merge Join
- Merge Cond: (t3.id = t1.id)
- -> Merge Join
- Merge Cond: (t3.id = t4.id)
- -> Index Scan using t3_pkey on t3
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
-(12 rows)
-
-/*+Leading(t3 t4 t1 t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
-INFO: hint syntax error at or near "Leading(t3 t4 t1 t2 t1)"
-DETAIL: Relation name "t1" is duplicated.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading(t3 t4 t1 t2 t1)
-
- QUERY PLAN
---------------------------------------------------
- Nested Loop
- -> Merge Join
- Merge Cond: (t1.id = t4.id)
- -> Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Index Scan using t3_pkey on t3
- Index Cond: (id = t1.id)
-(12 rows)
-
-/*+Leading(t3 t4 t4)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
-INFO: hint syntax error at or near "Leading(t3 t4 t4)"
-DETAIL: Relation name "t4" is duplicated.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading(t3 t4 t4)
-
- QUERY PLAN
---------------------------------------------------
- Nested Loop
- -> Merge Join
- Merge Cond: (t1.id = t4.id)
- -> Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Index Scan using t3_pkey on t3
- Index Cond: (id = t1.id)
-(12 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM t1, (VALUES(1,1),(2,2),(3,3)) AS t2(id,val) WHERE t1.id = t2.id;
- QUERY PLAN
------------------------------------------------
- Nested Loop
- -> Values Scan on "*VALUES*"
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = "*VALUES*".column1)
-(4 rows)
-
-/*+HashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, (VALUES(1,1),(2,2),(3,3)) AS t2(id,val) WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-HashJoin(t1 t2)
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------
- Nested Loop
- -> Values Scan on "*VALUES*"
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = "*VALUES*".column1)
-(4 rows)
-
-/*+HashJoin(t1 *VALUES*)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, (VALUES(1,1),(2,2),(3,3)) AS t2(id,val) WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(*VALUES* t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------
- Hash Join
- Hash Cond: (t1.id = "*VALUES*".column1)
- -> Seq Scan on t1
- -> Hash
- -> Values Scan on "*VALUES*"
-(5 rows)
-
-/*+HashJoin(t1 *VALUES*) IndexScan(t1) IndexScan(*VALUES*)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, (VALUES(1,1),(2,2),(3,3)) AS t2(id,val) WHERE t1.id = t2.id;
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t1)
-HashJoin(*VALUES* t1)
-not used hint:
-IndexScan(*VALUES*)
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------
- Hash Join
- Hash Cond: (t1.id = "*VALUES*".column1)
- -> Index Scan using t1_pkey on t1
- -> Hash
- -> Values Scan on "*VALUES*"
-(5 rows)
-
--- single table scan hint test
-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);
- QUERY PLAN
-------------------------------------------------------------------------
- Index Only Scan using t1_pkey on t1
- Index Cond: (id = $3)
- InitPlan 2 (returns $1)
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Index Only Scan Backward using t1_pkey on t1 v_1
- Index Cond: ((id IS NOT NULL) AND (id < 10))
- InitPlan 4 (returns $3)
- -> Result
- InitPlan 3 (returns $2)
- -> Limit
- -> Index Only Scan Backward using t1_pkey on t1 v_2
- Index Cond: ((id IS NOT NULL) AND (id < 10))
-(14 rows)
-
-/*+BitmapScan(v_1)*/
-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);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(v_1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------
- Index Only Scan using t1_pkey on t1
- Index Cond: (id = $2)
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Bitmap Heap Scan on t1 v_1
- Recheck Cond: (id < 10)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id < 10)
- InitPlan 3 (returns $2)
- -> Result
- InitPlan 2 (returns $1)
- -> Limit
- -> Index Only Scan Backward using t1_pkey on t1 v_2
- Index Cond: ((id IS NOT NULL) AND (id < 10))
-(14 rows)
-
-/*+BitmapScan(v_2)*/
-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);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(v_2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------
- Index Only Scan using t1_pkey on t1
- Index Cond: (id = $2)
- InitPlan 2 (returns $1)
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Index Only Scan Backward using t1_pkey on t1 v_1
- Index Cond: ((id IS NOT NULL) AND (id < 10))
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Bitmap Heap Scan on t1 v_2
- Recheck Cond: (id < 10)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id < 10)
-(14 rows)
-
-/*+BitmapScan(t1)*/
-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);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (id = $3)
- InitPlan 2 (returns $1)
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Index Only Scan Backward using t1_pkey on t1 v_1
- Index Cond: ((id IS NOT NULL) AND (id < 10))
- InitPlan 4 (returns $3)
- -> Result
- InitPlan 3 (returns $2)
- -> Limit
- -> Index Only Scan Backward using t1_pkey on t1 v_2
- Index Cond: ((id IS NOT NULL) AND (id < 10))
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id = $3)
-(16 rows)
-
-/*+BitmapScan(v_1)BitmapScan(v_2)*/
-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);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(v_1)
-BitmapScan(v_2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------
- Index Only Scan using t1_pkey on t1
- Index Cond: (id = $1)
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Bitmap Heap Scan on t1 v_1
- Recheck Cond: (id < 10)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id < 10)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Bitmap Heap Scan on t1 v_2
- Recheck Cond: (id < 10)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id < 10)
-(14 rows)
-
-/*+BitmapScan(v_1)BitmapScan(t1)*/
-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);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-BitmapScan(v_1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (id = $2)
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Bitmap Heap Scan on t1 v_1
- Recheck Cond: (id < 10)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id < 10)
- InitPlan 3 (returns $2)
- -> Result
- InitPlan 2 (returns $1)
- -> Limit
- -> Index Only Scan Backward using t1_pkey on t1 v_2
- Index Cond: ((id IS NOT NULL) AND (id < 10))
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id = $2)
-(16 rows)
-
-/*+BitmapScan(v_2)BitmapScan(t1)*/
-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);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-BitmapScan(v_2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (id = $2)
- InitPlan 2 (returns $1)
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Index Only Scan Backward using t1_pkey on t1 v_1
- Index Cond: ((id IS NOT NULL) AND (id < 10))
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Bitmap Heap Scan on t1 v_2
- Recheck Cond: (id < 10)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id < 10)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id = $2)
-(16 rows)
-
-/*+BitmapScan(v_1)BitmapScan(v_2)BitmapScan(t1)*/
-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);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-BitmapScan(v_1)
-BitmapScan(v_2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (id = $1)
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Bitmap Heap Scan on t1 v_1
- Recheck Cond: (id < 10)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id < 10)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Bitmap Heap Scan on t1 v_2
- Recheck Cond: (id < 10)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id < 10)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id = $1)
-(16 rows)
-
--- full scan hint pattern test
-EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------
- Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (id < 10)
-(3 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------
- Seq Scan on t1
- Filter: ((id < 10) AND (ctid = '(1,1)'::tid))
-(2 rows)
-
-/*+IndexScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------
- Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- Filter: (ctid = '(1,1)'::tid)
-(3 rows)
-
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (id < 10)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id < 10)
-(5 rows)
-
-/*+TidScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (id < 10)
-(3 rows)
-
-/*+NoSeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoSeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (id < 10)
-(3 rows)
-
-/*+NoIndexScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoIndexScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (id < 10)
-(3 rows)
-
-/*+NoBitmapScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoBitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (id < 10)
-(3 rows)
-
-/*+NoTidScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoTidScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------
- Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- Filter: (ctid = '(1,1)'::tid)
-(3 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+SeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+SeqScan(t1) SeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-SeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+SeqScan(t1) IndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-IndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Nested Loop
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+SeqScan(t1) BitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-BitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t2
- Recheck Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (id = t1.id)
-(8 rows)
-
-/*+SeqScan(t1) TidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-TidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+SeqScan(t1) NoSeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-NoSeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+SeqScan(t1) NoIndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-NoIndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+SeqScan(t1) NoBitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-NoBitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+SeqScan(t1) NoTidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-NoTidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Nested Loop
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+IndexScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+IndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+IndexScan(t1) SeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t1)
-SeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Nested Loop
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+IndexScan(t1) IndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t1)
-IndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Nested Loop
- -> Index Scan using t2_pkey on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+IndexScan(t1) BitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t1)
-BitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Index Scan using t1_pkey on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t2
- Recheck Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (id = t1.id)
-(8 rows)
-
-/*+IndexScan(t1) TidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t1)
-TidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+IndexScan(t1) NoSeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t1)
-NoSeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+IndexScan(t1) NoIndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t1)
-NoIndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+IndexScan(t1) NoBitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t1)
-NoBitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+IndexScan(t1) NoTidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t1)
-NoTidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Nested Loop
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t1
- Recheck Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id = t2.id)
-(8 rows)
-
-/*+BitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t2
- Recheck Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (id = t1.id)
-(8 rows)
-
-/*+BitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t2
- Recheck Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (id = t1.id)
-(8 rows)
-
-/*+BitmapScan(t1) SeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-SeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t1
- Recheck Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id = t2.id)
-(8 rows)
-
-/*+BitmapScan(t1) IndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-IndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Index Scan using t2_pkey on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t1
- Recheck Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id = t2.id)
-(8 rows)
-
-/*+BitmapScan(t1) BitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-BitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Index Scan using t2_pkey on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t1
- Recheck Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id = t2.id)
-(8 rows)
-
-/*+BitmapScan(t1) TidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-TidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t1
- Recheck Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id = t2.id)
-(8 rows)
-
-/*+BitmapScan(t1) NoSeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-NoSeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t1
- Recheck Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id = t2.id)
-(8 rows)
-
-/*+BitmapScan(t1) NoIndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-NoIndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t1
- Recheck Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id = t2.id)
-(8 rows)
-
-/*+BitmapScan(t1) NoBitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-NoBitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t1
- Recheck Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id = t2.id)
-(8 rows)
-
-/*+BitmapScan(t1) NoTidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-NoTidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t1
- Recheck Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (id = t2.id)
-(8 rows)
-
-/*+TidScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+TidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+TidScan(t1) SeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(t1)
-SeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+TidScan(t1) IndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(t1)
-IndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+TidScan(t1) BitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(t1)
-BitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t2
- Recheck Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (id = t1.id)
-(8 rows)
-
-/*+TidScan(t1) TidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(t1)
-TidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+TidScan(t1) NoSeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(t1)
-NoSeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+TidScan(t1) NoIndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(t1)
-NoIndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+TidScan(t1) NoBitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(t1)
-NoBitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+TidScan(t1) NoTidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(t1)
-NoTidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoSeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoSeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoSeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoSeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoSeqScan(t1) SeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoSeqScan(t1)
-SeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoSeqScan(t1) IndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoSeqScan(t1)
-IndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoSeqScan(t1) BitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoSeqScan(t1)
-BitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t2
- Recheck Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (id = t1.id)
-(8 rows)
-
-/*+NoSeqScan(t1) TidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoSeqScan(t1)
-TidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoSeqScan(t1) NoSeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoSeqScan(t1)
-NoSeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoSeqScan(t1) NoIndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoSeqScan(t1)
-NoIndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoSeqScan(t1) NoBitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoSeqScan(t1)
-NoBitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoSeqScan(t1) NoTidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoSeqScan(t1)
-NoTidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoIndexScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoIndexScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoIndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoIndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoIndexScan(t1) SeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoIndexScan(t1)
-SeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoIndexScan(t1) IndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoIndexScan(t1)
-IndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoIndexScan(t1) BitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoIndexScan(t1)
-BitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t2
- Recheck Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (id = t1.id)
-(8 rows)
-
-/*+NoIndexScan(t1) TidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoIndexScan(t1)
-TidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoIndexScan(t1) NoSeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoIndexScan(t1)
-NoSeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoIndexScan(t1) NoIndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoIndexScan(t1)
-NoIndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoIndexScan(t1) NoBitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoIndexScan(t1)
-NoBitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoIndexScan(t1) NoTidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoIndexScan(t1)
-NoTidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoBitmapScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoBitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoBitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoBitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoBitmapScan(t1) SeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoBitmapScan(t1)
-SeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoBitmapScan(t1) IndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoBitmapScan(t1)
-IndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoBitmapScan(t1) BitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoBitmapScan(t1)
-BitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t2
- Recheck Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (id = t1.id)
-(8 rows)
-
-/*+NoBitmapScan(t1) TidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoBitmapScan(t1)
-TidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoBitmapScan(t1) NoSeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoBitmapScan(t1)
-NoSeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoBitmapScan(t1) NoIndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoBitmapScan(t1)
-NoIndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoBitmapScan(t1) NoBitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoBitmapScan(t1)
-NoBitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoBitmapScan(t1) NoTidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoBitmapScan(t1)
-NoTidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoTidScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoTidScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoTidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoTidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoTidScan(t1) SeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoTidScan(t1)
-SeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Nested Loop
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoTidScan(t1) IndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoTidScan(t1)
-IndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Nested Loop
- -> Index Scan using t2_pkey on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoTidScan(t1) BitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoTidScan(t1)
-BitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t2
- Recheck Cond: (id = t1.id)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (id = t1.id)
-(8 rows)
-
-/*+NoTidScan(t1) TidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoTidScan(t1)
-TidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoTidScan(t1) NoSeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoTidScan(t1)
-NoSeqScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoTidScan(t1) NoIndexScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoTidScan(t1)
-NoIndexScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoTidScan(t1) NoBitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoTidScan(t1)
-NoBitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-/*+NoTidScan(t1) NoTidScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoTidScan(t1)
-NoTidScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Nested Loop
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
--- additional test
-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;
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.id = t2.id)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (id < 10)
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (id < 10)
-(8 rows)
-
-/*+BitmapScan(t1) BitmapScan(t2)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-BitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------
- Nested Loop
- -> Bitmap Heap Scan on t2
- Recheck Cond: (id < 10)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (id < 10)
- -> Bitmap Heap Scan on t1
- Recheck Cond: ((id = t2.id) AND (id < 10))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: ((id = t2.id) AND (id < 10))
-(11 rows)
-
--- outer join test
-EXPLAIN (COSTS false) SELECT * FROM t1 FULL OUTER JOIN t2 ON (t1.id = t2.id);
- QUERY PLAN
-------------------------------
- Hash Full Join
- Hash Cond: (t1.id = t2.id)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-/*+MergeJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1 FULL OUTER JOIN t2 ON (t1.id = t2.id);
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------
- Merge Full Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(4 rows)
-
-/*+NestLoop(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1 FULL OUTER JOIN t2 ON (t1.id = t2.id);
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------
- Merge Full Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(4 rows)
-
--- inherite table test
-SET constraint_exclusion TO off;
-EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c4 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-(20 rows)
-
-SET constraint_exclusion TO on;
-EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-(10 rows)
-
-SET constraint_exclusion TO off;
-/*+SeqScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c4 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-(20 rows)
-
-/*+IndexScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------
- Result
- -> Append
- -> Index Scan using p1_pkey on p1
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p1_c1_pkey on p1_c1 p1
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p1_c2_pkey on p1_c2 p1
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p1_c3_pkey on p1_c3 p1
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p1_c4_pkey on p1_c4 p1
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p1_c1_c1_pkey on p1_c1_c1 p1
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p1_c1_c2_pkey on p1_c1_c2 p1
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p1_c3_c1_pkey on p1_c3_c1 p1
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p1_c3_c2_pkey on p1_c3_c2 p1
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
-(29 rows)
-
-/*+BitmapScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------
- Result
- -> Append
- -> Bitmap Heap Scan on p1
- Recheck Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on p1_pkey
- Index Cond: ((id >= 50) AND (id <= 51))
- -> Bitmap Heap Scan on p1_c1 p1
- Recheck Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on p1_c1_pkey
- Index Cond: ((id >= 50) AND (id <= 51))
- -> Bitmap Heap Scan on p1_c2 p1
- Recheck Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on p1_c2_pkey
- Index Cond: ((id >= 50) AND (id <= 51))
- -> Bitmap Heap Scan on p1_c3 p1
- Recheck Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on p1_c3_pkey
- Index Cond: ((id >= 50) AND (id <= 51))
- -> Bitmap Heap Scan on p1_c4 p1
- Recheck Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on p1_c4_pkey
- Index Cond: ((id >= 50) AND (id <= 51))
- -> Bitmap Heap Scan on p1_c1_c1 p1
- Recheck Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on p1_c1_c1_pkey
- Index Cond: ((id >= 50) AND (id <= 51))
- -> Bitmap Heap Scan on p1_c1_c2 p1
- Recheck Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on p1_c1_c2_pkey
- Index Cond: ((id >= 50) AND (id <= 51))
- -> Bitmap Heap Scan on p1_c3_c1 p1
- Recheck Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on p1_c3_c1_pkey
- Index Cond: ((id >= 50) AND (id <= 51))
- -> Bitmap Heap Scan on p1_c3_c2 p1
- Recheck Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on p1_c3_c2_pkey
- Index Cond: ((id >= 50) AND (id <= 51))
-(47 rows)
-
-/*+TidScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------
- Result
- -> Append
- -> Tid Scan on p1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p1_c1 p1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p1_c2 p1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p1_c3 p1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p1_c4 p1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p1_c1_c1 p1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p1_c1_c2 p1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p1_c3_c1 p1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p1_c3_c2 p1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
-(29 rows)
-
-SET constraint_exclusion TO on;
-/*+SeqScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-(10 rows)
-
-/*+IndexScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------
- Result
- -> Append
- -> Index Scan using p1_pkey on p1
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p1_c1_pkey on p1_c1 p1
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p1_c1_c1_pkey on p1_c1_c1 p1
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p1_c1_c2_pkey on p1_c1_c2 p1
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
-(14 rows)
-
-/*+BitmapScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------
- Result
- -> Append
- -> Bitmap Heap Scan on p1
- Recheck Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on p1_pkey
- Index Cond: ((id >= 50) AND (id <= 51))
- -> Bitmap Heap Scan on p1_c1 p1
- Recheck Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on p1_c1_pkey
- Index Cond: ((id >= 50) AND (id <= 51))
- -> Bitmap Heap Scan on p1_c1_c1 p1
- Recheck Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on p1_c1_c1_pkey
- Index Cond: ((id >= 50) AND (id <= 51))
- -> Bitmap Heap Scan on p1_c1_c2 p1
- Recheck Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on p1_c1_c2_pkey
- Index Cond: ((id >= 50) AND (id <= 51))
-(22 rows)
-
-/*+TidScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------
- Result
- -> Append
- -> Tid Scan on p1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p1_c1 p1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p1_c1_c1 p1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p1_c1_c2 p1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
-(14 rows)
-
-SET constraint_exclusion TO off;
-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;
- QUERY PLAN
------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (public.p1.id = t1.id)
- -> Sort
- Sort Key: public.p1.id
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c4 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(25 rows)
-
-SET constraint_exclusion TO on;
-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;
- QUERY PLAN
------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (public.p1.id = t1.id)
- -> Sort
- Sort Key: public.p1.id
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(15 rows)
-
-SET constraint_exclusion TO off;
-/*+SeqScan(p1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (public.p1.id = t1.id)
- -> Sort
- Sort Key: public.p1.id
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c4 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(25 rows)
-
-/*+IndexScan(p1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (public.p1.id = t1.id)
- -> Sort
- Sort Key: public.p1.id
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c4 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(25 rows)
-
-/*+BitmapScan(p1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (public.p1.id = t1.id)
- -> Sort
- Sort Key: public.p1.id
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c4 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(25 rows)
-
-/*+TidScan(p1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-TidScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (public.p1.id = t1.id)
- -> Sort
- Sort Key: public.p1.id
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c4 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(25 rows)
-
-/*+NestLoop(p1 t1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(p1 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Nested Loop
- Join Filter: (public.p1.id = t1.id)
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c4 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Materialize
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(24 rows)
-
-/*+MergeJoin(p1 t1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(p1 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (public.p1.id = t1.id)
- -> Sort
- Sort Key: public.p1.id
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c4 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(25 rows)
-
-/*+HashJoin(p1 t1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(p1 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Hash Join
- Hash Cond: (public.p1.id = t1.id)
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c4 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c3_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Hash
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(24 rows)
-
-SET constraint_exclusion TO on;
-/*+SeqScan(p1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (public.p1.id = t1.id)
- -> Sort
- Sort Key: public.p1.id
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(15 rows)
-
-/*+IndexScan(p1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (public.p1.id = t1.id)
- -> Sort
- Sort Key: public.p1.id
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(15 rows)
-
-/*+BitmapScan(p1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (public.p1.id = t1.id)
- -> Sort
- Sort Key: public.p1.id
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(15 rows)
-
-/*+TidScan(p1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-TidScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (public.p1.id = t1.id)
- -> Sort
- Sort Key: public.p1.id
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(15 rows)
-
-/*+NestLoop(p1 t1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(p1 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------
- Nested Loop
- Join Filter: (public.p1.id = t1.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Materialize
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-(14 rows)
-
-/*+MergeJoin(p1 t1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(p1 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (public.p1.id = t1.id)
- -> Sort
- Sort Key: public.p1.id
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(15 rows)
-
-/*+HashJoin(p1 t1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(p1 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------
- Hash Join
- Hash Cond: (t1.id = public.p1.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Append
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c1 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p1_c1_c2 p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-(14 rows)
-
-SET constraint_exclusion TO off;
-EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-(2 rows)
-
-SET constraint_exclusion TO on;
-EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-(2 rows)
-
-SET constraint_exclusion TO off;
-/*+SeqScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------
- Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-(2 rows)
-
-/*+IndexScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------
- Index Scan using p1_pkey on p1
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
-(3 rows)
-
-/*+BitmapScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------
- Bitmap Heap Scan on p1
- Recheck Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on p1_pkey
- Index Cond: ((id >= 50) AND (id <= 51))
-(5 rows)
-
-/*+TidScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Tid Scan on p1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
-(3 rows)
-
-/*+NestLoop(p1 t1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(p1 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------
- Nested Loop
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: ((id = p1.id) AND (id < 10))
-(5 rows)
-
-/*+MergeJoin(p1 t1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(p1 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (p1.id = t1.id)
- -> Sort
- Sort Key: p1.id
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(8 rows)
-
-/*+HashJoin(p1 t1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(p1 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Hash Join
- Hash Cond: (t1.id = p1.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-(7 rows)
-
-SET constraint_exclusion TO on;
-/*+SeqScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------
- Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-(2 rows)
-
-/*+IndexScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------
- Index Scan using p1_pkey on p1
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
-(3 rows)
-
-/*+BitmapScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------
- Bitmap Heap Scan on p1
- Recheck Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on p1_pkey
- Index Cond: ((id >= 50) AND (id <= 51))
-(5 rows)
-
-/*+TidScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Tid Scan on p1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
-(3 rows)
-
-/*+NestLoop(p1 t1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(p1 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------
- Nested Loop
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: ((id = p1.id) AND (id < 10))
-(5 rows)
-
-/*+MergeJoin(p1 t1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(p1 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (p1.id = t1.id)
- -> Sort
- Sort Key: p1.id
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(8 rows)
-
-/*+HashJoin(p1 t1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(p1 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Hash Join
- Hash Cond: (t1.id = p1.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-(7 rows)
-
-SET constraint_exclusion TO off;
-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;
- QUERY PLAN
------------------------------------------------------------------------
- Nested Loop
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: ((id = p1.id) AND (id < 10))
-(5 rows)
-
-SET constraint_exclusion TO on;
-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;
- QUERY PLAN
------------------------------------------------------------------------
- Nested Loop
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: ((id = p1.id) AND (id < 10))
-(5 rows)
-
-SET constraint_exclusion TO off;
-/*+SeqScan(p1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------
- Nested Loop
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: ((id = p1.id) AND (id < 10))
-(5 rows)
-
-/*+IndexScan(p1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------
- Nested Loop
- -> Index Scan using p1_pkey on p1
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: ((id = p1.id) AND (id < 10))
-(6 rows)
-
-/*+BitmapScan(p1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------
- Nested Loop
- -> Bitmap Heap Scan on p1
- Recheck Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on p1_pkey
- Index Cond: ((id >= 50) AND (id <= 51))
- -> Index Scan using t1_pkey on t1
- Index Cond: ((id = p1.id) AND (id < 10))
-(8 rows)
-
-/*+TidScan(p1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-TidScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------
- Nested Loop
- -> Tid Scan on p1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Index Scan using t1_pkey on t1
- Index Cond: ((id = p1.id) AND (id < 10))
-(6 rows)
-
-SET constraint_exclusion TO on;
-/*+SeqScan(p1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------
- Nested Loop
- -> Seq Scan on p1
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t1_pkey on t1
- Index Cond: ((id = p1.id) AND (id < 10))
-(5 rows)
-
-/*+IndexScan(p1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------
- Nested Loop
- -> Index Scan using p1_pkey on p1
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1
- Index Cond: ((id = p1.id) AND (id < 10))
-(6 rows)
-
-/*+BitmapScan(p1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------
- Nested Loop
- -> Bitmap Heap Scan on p1
- Recheck Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on p1_pkey
- Index Cond: ((id >= 50) AND (id <= 51))
- -> Index Scan using t1_pkey on t1
- Index Cond: ((id = p1.id) AND (id < 10))
-(8 rows)
-
-/*+TidScan(p1)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-TidScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------
- Nested Loop
- -> Tid Scan on p1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Index Scan using t1_pkey on t1
- Index Cond: ((id = p1.id) AND (id < 10))
-(6 rows)
-
--- quote test
-/*+SeqScan("""t1 ) ")IndexScan("t 2 """)HashJoin("""t1 ) "T3"t 2 """)Leading("""t1 ) "T3"t 2 """)Set(application_name"a a a"" a A")*/
-EXPLAIN (COSTS false) SELECT * FROM t1 """t1 ) ", t2 "t 2 """, t3 "T3" WHERE """t1 ) ".id = "t 2 """.id AND """t1 ) ".id = "T3".id;
-LOG: pg_hint_plan:
-used hint:
-SeqScan("""t1 ) ")
-IndexScan("t 2 """)
-HashJoin("""t1 ) " T3 "t 2 """)
-Leading("""t1 ) " T3 "t 2 """)
-Set(application_name "a a a"" a A")
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------
- Hash Join
- Hash Cond: ("t 2 """.id = """t1 ) ".id)
- -> Index Scan using t2_pkey on t2 "t 2 """
- -> Hash
- -> Hash Join
- Hash Cond: ("""t1 ) ".id = "T3".id)
- -> Seq Scan on t1 """t1 ) "
- -> Hash
- -> Seq Scan on t3 "T3"
-(9 rows)
-
--- duplicate hint test
-/*+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)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-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)"
-DETAIL: Conflict scan method hint.
-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)"
-DETAIL: Conflict scan method hint.
-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)"
-DETAIL: Conflict scan method hint.
-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)"
-DETAIL: Conflict scan method hint.
-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)"
-DETAIL: Conflict scan method hint.
-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)"
-DETAIL: Conflict scan method hint.
-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)"
-DETAIL: Conflict join method hint.
-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)"
-DETAIL: Conflict join method hint.
-INFO: hint syntax error at or near "Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
-DETAIL: Conflict set hint.
-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)"
-DETAIL: Conflict leading hint.
-LOG: pg_hint_plan:
-used hint:
-TidScan(t1)
-TidScan(t2)
-MergeJoin(t1 t2)
-Leading(t2 t1)
-Set(enable_mergejoin on)
-Set(enable_seqscan on)
-not used hint:
-duplication hint:
-SeqScan(t1)
-IndexScan(t1)
-BitmapScan(t1)
-SeqScan(t2)
-IndexScan(t2)
-BitmapScan(t2)
-HashJoin(t1 t2)
-NestLoop(t1 t2)
-Leading(t1 t2)
-Set(enable_seqscan off)
-error hint:
-
- QUERY PLAN
------------------------------------------------
- Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Sort
- Sort Key: t1.id
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: t2.id
- -> Tid Scan on t2
- TID Cond: (ctid = '(1,1)'::tid)
-(10 rows)
-
--- sub query Leading hint test
-SET from_collapse_limit TO 100;
-SET geqo_threshold TO 100;
-EXPLAIN (COSTS false)
-WITH c1_1(id) AS (
-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
-)
-SELECT t1_1.id, (
-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
-) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
-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
-) 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 = (
-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
-);
- QUERY PLAN
-------------------------------------------------------------------------------
- Nested Loop
- CTE c1_1
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_5.id = t3_5.id)
- -> Merge Join
- Merge Cond: (t1_5.id = t2_5.id)
- -> Index Only Scan using t1_pkey on t1 t1_5
- -> Index Only Scan using t2_pkey on t2 t2_5
- -> Sort
- Sort Key: t3_5.id
- -> Seq Scan on t3 t3_5
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_2.id = t3_2.id)
- -> Merge Join
- Merge Cond: (t1_2.id = t2_2.id)
- -> Index Only Scan using t1_pkey on t1 t1_2
- -> Index Only Scan using t2_pkey on t2 t2_2
- -> Sort
- Sort Key: t3_2.id
- -> Seq Scan on t3 t3_2
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_4.id = t3_4.id)
- -> Merge Join
- Merge Cond: (t1_4.id = t2_4.id)
- -> Index Only Scan using t1_pkey on t1 t1_4
- -> Index Only Scan using t2_pkey on t2 t2_4
- -> Sort
- Sort Key: t3_4.id
- -> Seq Scan on t3 t3_4
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Index Only Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $2)
- -> Index Only Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $2)
- -> Seq Scan on t3 t3_1
- Filter: (id = $2)
- -> Index Only Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $2)
- -> Index Only Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $2)
- -> Seq Scan on t3 t3_3
- Filter: (id = $2)
- -> CTE Scan on c1_1
- Filter: (id = $2)
-(53 rows)
-
-/*+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)*/
-EXPLAIN (COSTS false)
-WITH c1_1(id) AS (
-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
-)
-SELECT t1_1.id, (
-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
-) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
-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
-) 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 = (
-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
-);
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1_1 t3_1)
-NestLoop(t1_2 t2_2)
-MergeJoin(t1_3 t3_3)
-NestLoop(t1_4 t2_4)
-NestLoop(t1_5 t2_5)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------------
- Nested Loop
- CTE c1_1
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_5.id = t3_5.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_5
- -> Index Only Scan using t1_pkey on t1 t1_5
- Index Cond: (id = t2_5.id)
- -> Sort
- Sort Key: t3_5.id
- -> Seq Scan on t3 t3_5
- InitPlan 2 (returns $3)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_2.id = t3_2.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_2
- -> Index Only Scan using t1_pkey on t1 t1_2
- Index Cond: (id = t2_2.id)
- -> Sort
- Sort Key: t3_2.id
- -> Seq Scan on t3 t3_2
- InitPlan 3 (returns $5)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_4.id = t3_4.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_4
- -> Index Only Scan using t1_pkey on t1 t1_4
- Index Cond: (id = t2_4.id)
- -> Sort
- Sort Key: t3_4.id
- -> Seq Scan on t3 t3_4
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Index Only Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $5)
- -> Index Only Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $5)
- -> Seq Scan on t3 t3_1
- Filter: (id = $5)
- -> Index Only Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $5)
- -> Index Only Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $5)
- -> Seq Scan on t3 t3_3
- Filter: (id = $5)
- -> CTE Scan on c1_1
- Filter: (id = $5)
-(53 rows)
-
-/*+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)*/
-EXPLAIN (COSTS false)
-WITH c1_1(id) AS (
-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
-)
-SELECT t1_1.id, (
-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
-) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
-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
-) 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 = (
-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
-);
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1_1 t3_1)
-NestLoop(t1_2 t2_2)
-MergeJoin(t1_3 t3_3)
-NestLoop(t1_4 t2_4)
-NestLoop(t1_5 t2_5)
-not used hint:
-Leading(a t1_1 t1_2 t1_4 t1_5)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------------
- Nested Loop
- CTE c1_1
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_5.id = t3_5.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_5
- -> Index Only Scan using t1_pkey on t1 t1_5
- Index Cond: (id = t2_5.id)
- -> Sort
- Sort Key: t3_5.id
- -> Seq Scan on t3 t3_5
- InitPlan 2 (returns $3)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_2.id = t3_2.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_2
- -> Index Only Scan using t1_pkey on t1 t1_2
- Index Cond: (id = t2_2.id)
- -> Sort
- Sort Key: t3_2.id
- -> Seq Scan on t3 t3_2
- InitPlan 3 (returns $5)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_4.id = t3_4.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_4
- -> Index Only Scan using t1_pkey on t1 t1_4
- Index Cond: (id = t2_4.id)
- -> Sort
- Sort Key: t3_4.id
- -> Seq Scan on t3 t3_4
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Index Only Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $5)
- -> Index Only Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $5)
- -> Seq Scan on t3 t3_1
- Filter: (id = $5)
- -> Index Only Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $5)
- -> Index Only Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $5)
- -> Seq Scan on t3 t3_3
- Filter: (id = $5)
- -> CTE Scan on c1_1
- Filter: (id = $5)
-(53 rows)
-
-/*+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)*/
-EXPLAIN (COSTS false)
-WITH c1_1(id) AS (
-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
-)
-SELECT t1_1.id, (
-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
-) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
-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
-) 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 = (
-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
-);
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1_1 t3_1)
-NestLoop(t1_2 t2_2)
-MergeJoin(t1_3 t3_3)
-NestLoop(t1_4 t2_4)
-NestLoop(t1_5 t2_5)
-not used hint:
-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)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------------
- Nested Loop
- CTE c1_1
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_5.id = t3_5.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_5
- -> Index Only Scan using t1_pkey on t1 t1_5
- Index Cond: (id = t2_5.id)
- -> Sort
- Sort Key: t3_5.id
- -> Seq Scan on t3 t3_5
- InitPlan 2 (returns $3)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_2.id = t3_2.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_2
- -> Index Only Scan using t1_pkey on t1 t1_2
- Index Cond: (id = t2_2.id)
- -> Sort
- Sort Key: t3_2.id
- -> Seq Scan on t3 t3_2
- InitPlan 3 (returns $5)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_4.id = t3_4.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_4
- -> Index Only Scan using t1_pkey on t1 t1_4
- Index Cond: (id = t2_4.id)
- -> Sort
- Sort Key: t3_4.id
- -> Seq Scan on t3 t3_4
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Index Only Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $5)
- -> Index Only Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $5)
- -> Seq Scan on t3 t3_1
- Filter: (id = $5)
- -> Index Only Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $5)
- -> Index Only Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $5)
- -> Seq Scan on t3 t3_3
- Filter: (id = $5)
- -> CTE Scan on c1_1
- Filter: (id = $5)
-(53 rows)
-
-/*+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)*/
-EXPLAIN (COSTS false)
-WITH c1_1(id) AS (
-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
-)
-SELECT t1_1.id, (
-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
-) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
-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
-) 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 = (
-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
-);
-LOG: pg_hint_plan:
-used hint:
-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)
-not used hint:
-HashJoin(t1_1 t3_1)
-NestLoop(t1_2 t2_2)
-MergeJoin(t1_3 t3_3)
-NestLoop(t1_4 t2_4)
-NestLoop(t1_5 t2_5)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------
- Nested Loop
- CTE c1_1
- -> Aggregate
- -> Merge Join
- Merge Cond: (t2_5.id = t1_5.id)
- -> Merge Join
- Merge Cond: (t2_5.id = t3_5.id)
- -> Index Only Scan using t2_pkey on t2 t2_5
- -> Sort
- Sort Key: t3_5.id
- -> Seq Scan on t3 t3_5
- -> Index Only Scan using t1_pkey on t1 t1_5
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t2_2.id = t1_2.id)
- -> Merge Join
- Merge Cond: (t2_2.id = t3_2.id)
- -> Index Only Scan using t2_pkey on t2 t2_2
- -> Sort
- Sort Key: t3_2.id
- -> Seq Scan on t3 t3_2
- -> Index Only Scan using t1_pkey on t1 t1_2
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t2_4.id = t1_4.id)
- -> Merge Join
- Merge Cond: (t2_4.id = t3_4.id)
- -> Index Only Scan using t2_pkey on t2 t2_4
- -> Sort
- Sort Key: t3_4.id
- -> Seq Scan on t3 t3_4
- -> Index Only Scan using t1_pkey on t1 t1_4
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Seq Scan on t3 t3_3
- Filter: (id = $2)
- -> CTE Scan on c1_1
- Filter: (id = $2)
- -> Index Only Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $2)
- -> Index Only Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $2)
- -> Seq Scan on t3 t3_1
- Filter: (id = $2)
- -> Index Only Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $2)
- -> Index Only Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $2)
-(53 rows)
-
-SET from_collapse_limit TO 1;
-EXPLAIN (COSTS false)
-WITH c1_1(id) AS (
-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
-)
-SELECT t1_1.id, (
-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
-) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
-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
-) 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 = (
-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
-);
- QUERY PLAN
---------------------------------------------------------------------
- Nested Loop
- CTE c1_1
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_5.id = t3_5.id)
- -> Merge Join
- Merge Cond: (t1_5.id = t2_5.id)
- -> Index Only Scan using t1_pkey on t1 t1_5
- -> Index Only Scan using t2_pkey on t2 t2_5
- -> Sort
- Sort Key: t3_5.id
- -> Seq Scan on t3 t3_5
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_2.id = t3_2.id)
- -> Merge Join
- Merge Cond: (t1_2.id = t2_2.id)
- -> Index Only Scan using t1_pkey on t1 t1_2
- -> Index Only Scan using t2_pkey on t2 t2_2
- -> Sort
- Sort Key: t3_2.id
- -> Seq Scan on t3 t3_2
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_4.id = t3_4.id)
- -> Merge Join
- Merge Cond: (t1_4.id = t2_4.id)
- -> Index Only Scan using t1_pkey on t1 t1_4
- -> Index Only Scan using t2_pkey on t2 t2_4
- -> Sort
- Sort Key: t3_4.id
- -> Seq Scan on t3 t3_4
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Index Only Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $2)
- -> Index Only Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $2)
- -> Seq Scan on t3 t3_1
- Filter: (id = $2)
- -> Nested Loop
- -> Nested Loop
- -> Index Only Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $2)
- -> Index Only Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $2)
- -> Seq Scan on t3 t3_3
- Filter: (id = $2)
- -> CTE Scan on c1_1
- Filter: (id = $2)
-(53 rows)
-
-/*+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)*/
-EXPLAIN (COSTS false)
-WITH c1_1(id) AS (
-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
-)
-SELECT t1_1.id, (
-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
-) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
-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
-) 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 = (
-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
-);
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1_1 t3_1)
-NestLoop(t1_2 t2_2)
-MergeJoin(t1_3 t3_3)
-NestLoop(t1_4 t2_4)
-NestLoop(t1_5 t2_5)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------------------
- Nested Loop
- CTE c1_1
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_5.id = t3_5.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_5
- -> Index Only Scan using t1_pkey on t1 t1_5
- Index Cond: (id = t2_5.id)
- -> Sort
- Sort Key: t3_5.id
- -> Seq Scan on t3 t3_5
- InitPlan 2 (returns $3)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_2.id = t3_2.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_2
- -> Index Only Scan using t1_pkey on t1 t1_2
- Index Cond: (id = t2_2.id)
- -> Sort
- Sort Key: t3_2.id
- -> Seq Scan on t3 t3_2
- InitPlan 3 (returns $5)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_4.id = t3_4.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_4
- -> Index Only Scan using t1_pkey on t1 t1_4
- Index Cond: (id = t2_4.id)
- -> Sort
- Sort Key: t3_4.id
- -> Seq Scan on t3 t3_4
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Index Only Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $5)
- -> Index Only Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $5)
- -> Seq Scan on t3 t3_1
- Filter: (id = $5)
- -> Nested Loop
- -> Nested Loop
- -> Index Only Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $5)
- -> Index Only Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $5)
- -> Seq Scan on t3 t3_3
- Filter: (id = $5)
- -> CTE Scan on c1_1
- Filter: (id = $5)
-(53 rows)
-
-/*+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)*/
-EXPLAIN (COSTS false)
-WITH c1_1(id) AS (
-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
-)
-SELECT t1_1.id, (
-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
-) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
-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
-) 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 = (
-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
-);
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1_1 t3_1)
-NestLoop(t1_2 t2_2)
-MergeJoin(t1_3 t3_3)
-NestLoop(t1_4 t2_4)
-NestLoop(t1_5 t2_5)
-not used hint:
-Leading(a t1_1 t1_2 t1_4 t1_5)
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------------------
- Nested Loop
- CTE c1_1
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_5.id = t3_5.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_5
- -> Index Only Scan using t1_pkey on t1 t1_5
- Index Cond: (id = t2_5.id)
- -> Sort
- Sort Key: t3_5.id
- -> Seq Scan on t3 t3_5
- InitPlan 2 (returns $3)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_2.id = t3_2.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_2
- -> Index Only Scan using t1_pkey on t1 t1_2
- Index Cond: (id = t2_2.id)
- -> Sort
- Sort Key: t3_2.id
- -> Seq Scan on t3 t3_2
- InitPlan 3 (returns $5)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_4.id = t3_4.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_4
- -> Index Only Scan using t1_pkey on t1 t1_4
- Index Cond: (id = t2_4.id)
- -> Sort
- Sort Key: t3_4.id
- -> Seq Scan on t3 t3_4
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Index Only Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $5)
- -> Index Only Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $5)
- -> Seq Scan on t3 t3_1
- Filter: (id = $5)
- -> Nested Loop
- -> Nested Loop
- -> Index Only Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $5)
- -> Index Only Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $5)
- -> Seq Scan on t3 t3_3
- Filter: (id = $5)
- -> CTE Scan on c1_1
- Filter: (id = $5)
-(53 rows)
-
-/*+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)*/
-EXPLAIN (COSTS false)
-WITH c1_1(id) AS (
-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
-)
-SELECT t1_1.id, (
-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
-) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
-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
-) 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 = (
-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
-);
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1_1 t3_1)
-NestLoop(t1_2 t2_2)
-MergeJoin(t1_3 t3_3)
-NestLoop(t1_4 t2_4)
-NestLoop(t1_5 t2_5)
-not used hint:
-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)
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------------------
- Nested Loop
- CTE c1_1
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_5.id = t3_5.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_5
- -> Index Only Scan using t1_pkey on t1 t1_5
- Index Cond: (id = t2_5.id)
- -> Sort
- Sort Key: t3_5.id
- -> Seq Scan on t3 t3_5
- InitPlan 2 (returns $3)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_2.id = t3_2.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_2
- -> Index Only Scan using t1_pkey on t1 t1_2
- Index Cond: (id = t2_2.id)
- -> Sort
- Sort Key: t3_2.id
- -> Seq Scan on t3 t3_2
- InitPlan 3 (returns $5)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_4.id = t3_4.id)
- -> Nested Loop
- -> Index Only Scan using t2_pkey on t2 t2_4
- -> Index Only Scan using t1_pkey on t1 t1_4
- Index Cond: (id = t2_4.id)
- -> Sort
- Sort Key: t3_4.id
- -> Seq Scan on t3 t3_4
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Index Only Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $5)
- -> Index Only Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $5)
- -> Seq Scan on t3 t3_1
- Filter: (id = $5)
- -> Nested Loop
- -> Nested Loop
- -> Index Only Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $5)
- -> Index Only Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $5)
- -> Seq Scan on t3 t3_3
- Filter: (id = $5)
- -> CTE Scan on c1_1
- Filter: (id = $5)
-(53 rows)
-
-/*+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)*/
-EXPLAIN (COSTS false)
-WITH c1_1(id) AS (
-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
-)
-SELECT t1_1.id, (
-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
-) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
-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
-) 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 = (
-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
-);
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(t1_3 t3_3)
-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)
-not used hint:
-HashJoin(t1_1 t3_1)
-NestLoop(t1_2 t2_2)
-NestLoop(t1_4 t2_4)
-NestLoop(t1_5 t2_5)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------------
- Nested Loop
- CTE c1_1
- -> Aggregate
- -> Merge Join
- Merge Cond: (t2_5.id = t1_5.id)
- -> Merge Join
- Merge Cond: (t2_5.id = t3_5.id)
- -> Index Only Scan using t2_pkey on t2 t2_5
- -> Sort
- Sort Key: t3_5.id
- -> Seq Scan on t3 t3_5
- -> Index Only Scan using t1_pkey on t1 t1_5
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t2_2.id = t1_2.id)
- -> Merge Join
- Merge Cond: (t2_2.id = t3_2.id)
- -> Index Only Scan using t2_pkey on t2 t2_2
- -> Sort
- Sort Key: t3_2.id
- -> Seq Scan on t3 t3_2
- -> Index Only Scan using t1_pkey on t1 t1_2
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t2_4.id = t1_4.id)
- -> Merge Join
- Merge Cond: (t2_4.id = t3_4.id)
- -> Index Only Scan using t2_pkey on t2 t2_4
- -> Sort
- Sort Key: t3_4.id
- -> Seq Scan on t3 t3_4
- -> Index Only Scan using t1_pkey on t1 t1_4
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Index Only Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $2)
- -> Index Only Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $2)
- -> Seq Scan on t3 t3_3
- Filter: (id = $2)
- -> CTE Scan on c1_1
- Filter: (id = $2)
- -> Seq Scan on t3 t3_1
- Filter: (id = $2)
- -> Index Only Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $2)
- -> Index Only Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $2)
-(53 rows)
-
--- ambigous error
-EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id AND public.t1.id = t2.id;
- QUERY PLAN
------------------------------------------------
- Merge Join
- Merge Cond: (public.t1.id = t2.id)
- -> Merge Join
- Merge Cond: (public.t1.id = s0.t1.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(7 rows)
-
-/*+NestLoop(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id AND public.t1.id = t2.id;
-INFO: hint syntax error at or near "NestLoop(t1 t2)"
-DETAIL: Relation name "t1" is ambiguous.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-NestLoop(t1 t2)
-
- QUERY PLAN
------------------------------------------------
- Merge Join
- Merge Cond: (public.t1.id = t2.id)
- -> Merge Join
- Merge Cond: (public.t1.id = s0.t1.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(7 rows)
-
-/*+Leading(t1 t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id AND public.t1.id = t2.id;
-INFO: hint syntax error at or near "Leading(t1 t2 t1)"
-DETAIL: Relation name "t1" is ambiguous.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading(t1 t2 t1)
-
- QUERY PLAN
------------------------------------------------
- Merge Join
- Merge Cond: (public.t1.id = t2.id)
- -> Merge Join
- Merge Cond: (public.t1.id = s0.t1.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(7 rows)
-
--- identifier length test
-EXPLAIN (COSTS false) SELECT * FROM t1 "123456789012345678901234567890123456789012345678901234567890123" JOIN t2 ON ("123456789012345678901234567890123456789012345678901234567890123".id = t2.id) JOIN t3 ON (t2.id = t3.id);
- QUERY PLAN
---------------------------------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t3.id)
- -> Merge Join
- Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t2.id)
- -> Index Scan using t1_pkey on t1 "123456789012345678901234567890123456789012345678901234567890123"
- -> Index Scan using t2_pkey on t2
- -> Sort
- Sort Key: t3.id
- -> Seq Scan on t3
-(9 rows)
-
-/*+
-Leading(123456789012345678901234567890123456789012345678901234567890123 t2 t3)
-SeqScan(123456789012345678901234567890123456789012345678901234567890123)
-MergeJoin(123456789012345678901234567890123456789012345678901234567890123 t2)
-Set(123456789012345678901234567890123456789012345678901234567890123 1)
-*/
-EXPLAIN (COSTS false) SELECT * FROM t1 "123456789012345678901234567890123456789012345678901234567890123" JOIN t2 ON ("123456789012345678901234567890123456789012345678901234567890123".id = t2.id) JOIN t3 ON (t2.id = t3.id);
-INFO: unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
-LOG: pg_hint_plan:
-used hint:
-SeqScan(123456789012345678901234567890123456789012345678901234567890123)
-MergeJoin(123456789012345678901234567890123456789012345678901234567890123 t2)
-Leading(123456789012345678901234567890123456789012345678901234567890123 t2 t3)
-not used hint:
-duplication hint:
-error hint:
-Set(123456789012345678901234567890123456789012345678901234567890123 1)
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t3.id)
- -> Merge Join
- Merge Cond: (t2.id = "123456789012345678901234567890123456789012345678901234567890123".id)
- -> Index Scan using t2_pkey on t2
- -> Sort
- Sort Key: "123456789012345678901234567890123456789012345678901234567890123".id
- -> Seq Scan on t1 "123456789012345678901234567890123456789012345678901234567890123"
- -> Sort
- Sort Key: t3.id
- -> Seq Scan on t3
-(11 rows)
-
-/*+
-Leading(1234567890123456789012345678901234567890123456789012345678901234 t2 t3)
-SeqScan(1234567890123456789012345678901234567890123456789012345678901234)
-MergeJoin(1234567890123456789012345678901234567890123456789012345678901234 t2)
-Set(1234567890123456789012345678901234567890123456789012345678901234 1)
-Set(cursor_tuple_fraction 0.1234567890123456789012345678901234567890123456789012345678901234)
-*/
-EXPLAIN (COSTS false) SELECT * FROM t1 "1234567890123456789012345678901234567890123456789012345678901234" JOIN t2 ON ("1234567890123456789012345678901234567890123456789012345678901234".id = t2.id) JOIN t3 ON (t2.id = t3.id);
-NOTICE: identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
-NOTICE: identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
-NOTICE: identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
-NOTICE: identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
-NOTICE: identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
-NOTICE: identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
-INFO: unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
-LOG: pg_hint_plan:
-used hint:
-SeqScan(123456789012345678901234567890123456789012345678901234567890123)
-MergeJoin(123456789012345678901234567890123456789012345678901234567890123 t2)
-Leading(123456789012345678901234567890123456789012345678901234567890123 t2 t3)
-Set(cursor_tuple_fraction 0.1234567890123456789012345678901234567890123456789012345678901234)
-not used hint:
-duplication hint:
-error hint:
-Set(123456789012345678901234567890123456789012345678901234567890123 1)
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t3.id)
- -> Merge Join
- Merge Cond: (t2.id = "123456789012345678901234567890123456789012345678901234567890123".id)
- -> Index Scan using t2_pkey on t2
- -> Sort
- Sort Key: "123456789012345678901234567890123456789012345678901234567890123".id
- -> Seq Scan on t1 "123456789012345678901234567890123456789012345678901234567890123"
- -> Sort
- Sort Key: t3.id
- -> Seq Scan on t3
-(11 rows)
-
-SET "123456789012345678901234567890123456789012345678901234567890123" TO 1;
-ERROR: unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
-SET "1234567890123456789012345678901234567890123456789012345678901234" TO 1;
-NOTICE: identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
-ERROR: unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
-SET cursor_tuple_fraction TO 1234567890123456789012345678901234567890123456789012345678901234;
-ERROR: 1.23457e+63 is outside the valid range for parameter "cursor_tuple_fraction" (0 .. 1)
--- multi error
-/*+ Set(enable_seqscan 100)Set(seq_page_cost on)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-INFO: parameter "enable_seqscan" requires a Boolean value
-INFO: parameter "seq_page_cost" requires a numeric value
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Set(enable_seqscan 100)
-Set(seq_page_cost on)
-
- QUERY PLAN
---------------------------------------
- Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
-(4 rows)
-
--- debug log of candidate index to use IndexScan
-EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
- QUERY PLAN
-----------------------------------------------------------------------------------------
- Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
- Index Cond: (id = 1)
-(2 rows)
-
-/*+IndexScan(t5 t5_id2)*/
-EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
-LOG: available indexes for IndexScan(t5): t5_id2
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t5 t5_id2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------
- Index Scan using t5_id2 on t5
- Index Cond: (id = 1)
-(2 rows)
-
-/*+IndexScan(t5 no_exist)*/
-EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
-LOG: available indexes for IndexScan(t5):
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t5 no_exist)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t5
- Filter: (id = 1)
-(2 rows)
-
-/*+IndexScan(t5 t5_id1 t5_id2)*/
-EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
-LOG: available indexes for IndexScan(t5): t5_id2 t5_id1
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t5 t5_id1 t5_id2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------
- Index Scan using t5_id2 on t5
- Index Cond: (id = 1)
-(2 rows)
-
-/*+IndexScan(t5 no_exist t5_id2)*/
-EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
-LOG: available indexes for IndexScan(t5): t5_id2
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t5 no_exist t5_id2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------
- Index Scan using t5_id2 on t5
- Index Cond: (id = 1)
-(2 rows)
-
-/*+IndexScan(t5 no_exist5 no_exist2)*/
-EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
-LOG: available indexes for IndexScan(t5):
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t5 no_exist5 no_exist2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t5
- Filter: (id = 1)
-(2 rows)
-
--- outer inner
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
- QUERY PLAN
---------------------------------------------------------
- Hash Join
- Hash Cond: (t3.val = t2.val)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (t2.id = t1.id)
- -> Seq Scan on t2
- -> Hash
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(10 rows)
-
-/*+Leading((t1))*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-INFO: hint syntax error at or near "Leading((t1))"
-DETAIL: Leading hint requires two sets of relations when parentheses nests.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading((t1))
-
- QUERY PLAN
---------------------------------------------------------
- Hash Join
- Hash Cond: (t3.val = t2.val)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (t2.id = t1.id)
- -> Seq Scan on t2
- -> Hash
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(10 rows)
-
-/*+Leading((t1 t2))*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-LOG: pg_hint_plan:
-used hint:
-Leading((t1 t2))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------
- Nested Loop
- Join Filter: (t2.val = t3.val)
- -> Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Seq Scan on t2
- -> Seq Scan on t3
-(9 rows)
-
-/*+Leading((t1 t2 t3))*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-INFO: hint syntax error at or near "Leading((t1 t2 t3))"
-DETAIL: Leading hint requires two sets of relations when parentheses nests.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading((t1 t2 t3))
-
- QUERY PLAN
---------------------------------------------------------
- Hash Join
- Hash Cond: (t3.val = t2.val)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (t2.id = t1.id)
- -> Seq Scan on t2
- -> Hash
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(10 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.id < 10;
- QUERY PLAN
---------------------------------------------
- Hash Join
- Hash Cond: (t2.id = t1.id)
- -> Seq Scan on t2
- -> Hash
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(6 rows)
-
-/*+Leading((t1 t2))*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.id < 10;
-LOG: pg_hint_plan:
-used hint:
-Leading((t1 t2))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------
- Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Seq Scan on t2
-(6 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
- QUERY PLAN
---------------------------------------------------------
- Hash Join
- Hash Cond: (t3.val = t2.val)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (t2.id = t1.id)
- -> Seq Scan on t2
- -> Hash
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(10 rows)
-
-/*+Leading(((t1 t2) t3))*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-LOG: pg_hint_plan:
-used hint:
-Leading(((t1 t2) t3))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------
- Nested Loop
- Join Filter: (t2.val = t3.val)
- -> Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Seq Scan on t2
- -> Seq Scan on t3
-(9 rows)
-
-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;
- QUERY PLAN
---------------------------------------------------------
- Nested Loop
- -> Merge Join
- Merge Cond: (t3.id = t4.id)
- -> Nested Loop
- Join Filter: (t1.val = t3.val)
- -> Index Scan using t3_pkey on t3
- -> Materialize
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
-(14 rows)
-
-/*+Leading((((t1 t2) t3) t4))*/
-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;
-LOG: pg_hint_plan:
-used hint:
-Leading((((t1 t2) t3) t4))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------
- Nested Loop
- -> Nested Loop
- Join Filter: (t1.val = t3.val)
- -> Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Seq Scan on t2
- -> Seq Scan on t3
- -> Index Scan using t4_pkey on t4
- Index Cond: (id = t3.id)
-(12 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
- QUERY PLAN
---------------------------------------------------------
- Hash Join
- Hash Cond: (t3.val = t2.val)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (t2.id = t1.id)
- -> Seq Scan on t2
- -> Hash
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(10 rows)
-
-/*+Leading(((t1 t2) t3))*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-LOG: pg_hint_plan:
-used hint:
-Leading(((t1 t2) t3))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------
- Nested Loop
- Join Filter: (t2.val = t3.val)
- -> Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Seq Scan on t2
- -> Seq Scan on t3
-(9 rows)
-
-/*+Leading((t1 (t2 t3)))*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-LOG: pg_hint_plan:
-used hint:
-Leading((t1 (t2 t3)))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------
- Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Hash Join
- Hash Cond: (t2.val = t3.val)
- -> Seq Scan on t2
- -> Hash
- -> Seq Scan on t3
-(10 rows)
-
-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;
- QUERY PLAN
---------------------------------------------------------
- Nested Loop
- -> Merge Join
- Merge Cond: (t3.id = t4.id)
- -> Nested Loop
- Join Filter: (t1.val = t3.val)
- -> Index Scan using t3_pkey on t3
- -> Materialize
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
-(14 rows)
-
-/*+Leading(((t1 t2) (t3 t4)))*/
-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;
-LOG: pg_hint_plan:
-used hint:
-Leading(((t1 t2) (t3 t4)))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------
- Nested Loop
- Join Filter: (t1.val = t3.val)
- -> Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Seq Scan on t2
- -> Merge Join
- Merge Cond: (t3.id = t4.id)
- -> Index Scan using t3_pkey on t3
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
-(14 rows)
-
-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);
- QUERY PLAN
---------------------------------------------------------------------
- Hash Join
- Hash Cond: (t2.val = t3.val)
- InitPlan 1 (returns $1)
- -> Limit
- -> Sort
- Sort Key: t1_2.id
- -> Nested Loop
- -> Index Scan using t2_val on t2 t2_2
- Index Cond: (val > 100)
- -> Index Only Scan using t1_pkey on t1 t1_2
- Index Cond: (id = t2_2.id)
- -> Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < $1)
- -> Index Scan using t2_pkey on t2
- -> Hash
- -> Seq Scan on t3
-(18 rows)
-
-/*+Leading(((t1 t2) t3)) Leading(((t3 t1) t2))*/
-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);
-INFO: hint syntax error at or near "Leading(((t1 t2) t3)) Leading(((t3 t1) t2))"
-DETAIL: Conflict leading hint.
-LOG: pg_hint_plan:
-used hint:
-Leading(((t3 t1) t2))
-not used hint:
-duplication hint:
-Leading(((t1 t2) t3))
-error hint:
-
- QUERY PLAN
---------------------------------------------------------------------
- Hash Join
- Hash Cond: (t1.id = t2.id)
- InitPlan 1 (returns $1)
- -> Limit
- -> Sort
- Sort Key: t1_2.id
- -> Nested Loop
- -> Index Scan using t2_val on t2 t2_2
- Index Cond: (val > 100)
- -> Index Only Scan using t1_pkey on t1 t1_2
- Index Cond: (id = t2_2.id)
- -> Hash Join
- Hash Cond: (t3.val = t1.val)
- -> Seq Scan on t3
- -> Hash
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < $1)
- -> Hash
- -> Seq Scan on t2
-(19 rows)
-
-/*+Leading(((t1 t2) t3)) Leading((t1_2 t2_2))*/
-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);
-LOG: pg_hint_plan:
-used hint:
-Leading(((t1 t2) t3))
-Leading((t1_2 t2_2))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------------
- Hash Join
- Hash Cond: (t2.val = t3.val)
- InitPlan 1 (returns $0)
- -> Limit
- -> Merge Join
- Merge Cond: (t1_2.id = t2_2.id)
- -> Index Only Scan using t1_pkey on t1 t1_2
- -> Sort
- Sort Key: t2_2.id
- -> Index Scan using t2_val on t2 t2_2
- Index Cond: (val > 100)
- -> Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < $0)
- -> Index Scan using t2_pkey on t2
- -> Hash
- -> Seq Scan on t3
-(18 rows)
-
-/*+Leading(((((t1 t2) t3) t1_2) t2_2))*/
-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);
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-Leading(((((t1 t2) t3) t1_2) t2_2))
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------------------
- Hash Join
- Hash Cond: (t2.val = t3.val)
- InitPlan 1 (returns $1)
- -> Limit
- -> Sort
- Sort Key: t1_2.id
- -> Nested Loop
- -> Index Scan using t2_val on t2 t2_2
- Index Cond: (val > 100)
- -> Index Only Scan using t1_pkey on t1 t1_2
- Index Cond: (id = t2_2.id)
- -> Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < $1)
- -> Index Scan using t2_pkey on t2
- -> Hash
- -> Seq Scan on t3
-(18 rows)
-
--- Specified outer/inner leading hint and join method hint at the same time
-/*+Leading(((t1 t2) t3))*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-LOG: pg_hint_plan:
-used hint:
-Leading(((t1 t2) t3))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------
- Nested Loop
- Join Filter: (t2.val = t3.val)
- -> Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Seq Scan on t2
- -> Seq Scan on t3
-(9 rows)
-
-/*+Leading(((t1 t2) t3)) MergeJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(t1 t2)
-Leading(((t1 t2) t3))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------
- Nested Loop
- Join Filter: (t2.val = t3.val)
- -> Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Index Scan using t2_pkey on t2
- -> Seq Scan on t3
-(8 rows)
-
-/*+Leading(((t1 t2) t3)) MergeJoin(t1 t2 t3)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(t1 t2 t3)
-Leading(((t1 t2) t3))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------
- Merge Join
- Merge Cond: (t2.val = t3.val)
- -> Sort
- Sort Key: t2.val
- -> Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Seq Scan on t2
- -> Sort
- Sort Key: t3.val
- -> Seq Scan on t3
-(13 rows)
-
-/*+Leading(((t1 t2) t3)) MergeJoin(t1 t3)*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-LOG: pg_hint_plan:
-used hint:
-Leading(((t1 t2) t3))
-not used hint:
-MergeJoin(t1 t3)
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------
- Nested Loop
- Join Filter: (t2.val = t3.val)
- -> Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Seq Scan on t2
- -> Seq Scan on t3
-(9 rows)
-
-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;
- QUERY PLAN
---------------------------------------------------------
- Nested Loop
- -> Merge Join
- Merge Cond: (t3.id = t4.id)
- -> Nested Loop
- Join Filter: (t1.val = t3.val)
- -> Index Scan using t3_pkey on t3
- -> Materialize
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t1.id)
-(14 rows)
-
-/*+Leading(((t1 t2) t3)) MergeJoin(t3 t4)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-Leading(((t1 t2) t3))
-not used hint:
-MergeJoin(t3 t4)
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------
- Nested Loop
- -> Nested Loop
- Join Filter: (t1.val = t3.val)
- -> Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Seq Scan on t2
- -> Seq Scan on t3
- -> Index Scan using t4_pkey on t4
- Index Cond: (id = t3.id)
-(12 rows)
-
-/*+Leading(((t1 t2) t3)) MergeJoin(t1 t2 t3 t4)*/
-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;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(t1 t2 t3 t4)
-Leading(((t1 t2) t3))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------
- Merge Join
- Merge Cond: (t3.id = t4.id)
- -> Sort
- Sort Key: t3.id
- -> Nested Loop
- Join Filter: (t1.val = t3.val)
- -> Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Seq Scan on t2
- -> Seq Scan on t3
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
-(16 rows)
-
-/*+ Leading ( ( t1 ( t2 t3 ) ) ) */
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-LOG: pg_hint_plan:
-used hint:
-Leading((t1 (t2 t3)))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------
- Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Hash Join
- Hash Cond: (t2.val = t3.val)
- -> Seq Scan on t2
- -> Hash
- -> Seq Scan on t3
-(10 rows)
-
-/*+Leading((t1(t2 t3)))*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-LOG: pg_hint_plan:
-used hint:
-Leading((t1 (t2 t3)))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------
- Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Hash Join
- Hash Cond: (t2.val = t3.val)
- -> Seq Scan on t2
- -> Hash
- -> Seq Scan on t3
-(10 rows)
-
-/*+Leading(("t1(t2" "t3)"))*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-Leading(("t1(t2" "t3)"))
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------
- Hash Join
- Hash Cond: (t3.val = t2.val)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (t2.id = t1.id)
- -> Seq Scan on t2
- -> Hash
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(10 rows)
-
-/*+ Leading ( ( ( t1 t2 ) t3 ) ) */
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-LOG: pg_hint_plan:
-used hint:
-Leading(((t1 t2) t3))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------
- Nested Loop
- Join Filter: (t2.val = t3.val)
- -> Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Seq Scan on t2
- -> Seq Scan on t3
-(9 rows)
-
-/*+Leading(((t1 t2)t3))*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-LOG: pg_hint_plan:
-used hint:
-Leading(((t1 t2) t3))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------
- Nested Loop
- Join Filter: (t2.val = t3.val)
- -> Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
- -> Hash
- -> Seq Scan on t2
- -> Seq Scan on t3
-(9 rows)
-
-/*+Leading(("(t1" "t2)t3"))*/
-EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-Leading(("(t1" "t2)t3"))
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------
- Hash Join
- Hash Cond: (t3.val = t2.val)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (t2.id = t1.id)
- -> Seq Scan on t2
- -> Hash
- -> Index Scan using t1_pkey on t1
- Index Cond: (id < 10)
-(10 rows)
-
-/*+Leading((t1(t2(t3(t4 t5)))))*/
-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;
-LOG: pg_hint_plan:
-used hint:
-Leading((t1 (t2 (t3 (t4 t5)))))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Materialize
- -> Merge Join
- Merge Cond: (t2.id = t3.id)
- -> Index Scan using t2_pkey on t2
- -> Materialize
- -> Merge Join
- Merge Cond: (t3.id = t4.id)
- -> Index Scan using t3_pkey on t3
- -> Materialize
- -> Merge Join
- Merge Cond: (t4.id = t5.id)
- -> Index Scan using t4_pkey on t4
- -> Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
-(16 rows)
-
-/*+Leading((t5(t4(t3(t2 t1)))))*/
-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;
-LOG: pg_hint_plan:
-used hint:
-Leading((t5 (t4 (t3 (t2 t1)))))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------------------------
- Hash Join
- Hash Cond: (t5.id = t1.id)
- -> Seq Scan on t5
- -> Hash
- -> Merge Join
- Merge Cond: (t4.id = t1.id)
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Materialize
- -> Merge Join
- Merge Cond: (t3.id = t1.id)
- -> Sort
- Sort Key: t3.id
- -> Seq Scan on t3
- -> Materialize
- -> Merge Join
- Merge Cond: (t2.id = t1.id)
- -> Index Scan using t2_pkey on t2
- -> Index Scan using t1_pkey on t1
-(20 rows)
-
-/*+Leading(((((t1 t2)t3)t4)t5))*/
-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;
-LOG: pg_hint_plan:
-used hint:
-Leading(((((t1 t2) t3) t4) t5))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------
- Nested Loop
- -> Merge Join
- Merge Cond: (t1.id = t4.id)
- -> Merge Join
- Merge Cond: (t1.id = t3.id)
- -> Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
- -> Index Scan using t3_pkey on t3
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
- Index Cond: (id = t1.id)
-(15 rows)
-
-/*+Leading(((((t5 t4)t3)t2)t1))*/
-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;
-LOG: pg_hint_plan:
-used hint:
-Leading(((((t5 t4) t3) t2) t1))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------------
- Nested Loop
- Join Filter: (t2.id = t1.id)
- -> Nested Loop
- Join Filter: (t3.id = t2.id)
- -> Merge Join
- Merge Cond: (t4.id = t3.id)
- -> Merge Join
- Merge Cond: (t5.id = t4.id)
- -> Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Index Scan using t3_pkey on t3
- -> Index Scan using t2_pkey on t2
- Index Cond: (id = t5.id)
- -> Index Scan using t1_pkey on t1
- Index Cond: (id = t5.id)
-(17 rows)
-
-/*+Leading(((t1 t2)(t3(t4 t5))))*/
-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;
-LOG: pg_hint_plan:
-used hint:
-Leading(((t1 t2) (t3 (t4 t5))))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (t1.id = t3.id)
- -> Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
- -> Materialize
- -> Merge Join
- Merge Cond: (t3.id = t4.id)
- -> Index Scan using t3_pkey on t3
- -> Materialize
- -> Merge Join
- Merge Cond: (t4.id = t5.id)
- -> Index Scan using t4_pkey on t4
- -> Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
-(15 rows)
-
-/*+Leading(((t5 t4)(t3(t2 t1))))*/
-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;
-LOG: pg_hint_plan:
-used hint:
-Leading(((t5 t4) (t3 (t2 t1))))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (t4.id = t1.id)
- -> Merge Join
- Merge Cond: (t5.id = t4.id)
- -> Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Materialize
- -> Merge Join
- Merge Cond: (t3.id = t1.id)
- -> Index Scan using t3_pkey on t3
- -> Materialize
- -> Merge Join
- Merge Cond: (t2.id = t1.id)
- -> Index Scan using t2_pkey on t2
- -> Index Scan using t1_pkey on t1
-(17 rows)
-
-/*+Leading((((t1 t2)t3)(t4 t5)))*/
-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;
-LOG: pg_hint_plan:
-used hint:
-Leading((((t1 t2) t3) (t4 t5)))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (t1.id = t4.id)
- -> Merge Join
- Merge Cond: (t1.id = t3.id)
- -> Merge Join
- Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Index Scan using t2_pkey on t2
- -> Index Scan using t3_pkey on t3
- -> Materialize
- -> Merge Join
- Merge Cond: (t4.id = t5.id)
- -> Index Scan using t4_pkey on t4
- -> Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
-(14 rows)
-
-/*+Leading((((t5 t4)t3)(t2 t1)))*/
-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;
-LOG: pg_hint_plan:
-used hint:
-Leading((((t5 t4) t3) (t2 t1)))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (t3.id = t1.id)
- -> Merge Join
- Merge Cond: (t4.id = t3.id)
- -> Merge Join
- Merge Cond: (t5.id = t4.id)
- -> Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
- -> Sort
- Sort Key: t4.id
- -> Seq Scan on t4
- -> Index Scan using t3_pkey on t3
- -> Materialize
- -> Merge Join
- Merge Cond: (t2.id = t1.id)
- -> Index Scan using t2_pkey on t2
- -> Index Scan using t1_pkey on t1
-(16 rows)
-
--- inherite table test to specify the index's name
-EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------------------
- Result
- -> Append
- -> Seq Scan on p2
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p2_c1 p2
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Tid Scan on p2_c1_c1 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p2_c1_c2 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
-(12 rows)
-
-/*+IndexScan(p2 p2_pkey)*/
-EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2): p2_pkey
-LOG: available indexes for IndexScan(p2_c1): p2_c1_pkey
-LOG: available indexes for IndexScan(p2_c2): p2_c2_pkey
-LOG: available indexes for IndexScan(p2_c3): p2_c3_pkey
-LOG: available indexes for IndexScan(p2_c4): p2_c4_pkey
-LOG: available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
-LOG: available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
-LOG: available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
-LOG: available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2_pkey)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------
- Result
- -> Append
- -> Index Scan using p2_pkey on p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_pkey on p2_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c1_pkey on p2_c1_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c2_pkey on p2_c1_c2 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
-(14 rows)
-
-/*+IndexScan(p2 p2_id_val_idx)*/
-EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2): p2_id_val_idx
-LOG: available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
-LOG: available indexes for IndexScan(p2_c2): p2_c2_id_val_idx
-LOG: available indexes for IndexScan(p2_c3): p2_c3_id_val_idx
-LOG: available indexes for IndexScan(p2_c4): p2_c4_id_val_idx
-LOG: available indexes for IndexScan(p2_c1_c1): p2_c1_c1_id_val_idx
-LOG: available indexes for IndexScan(p2_c1_c2): p2_c1_c2_id_val_idx
-LOG: available indexes for IndexScan(p2_c3_c1): p2_c3_c1_id_val_idx
-LOG: available indexes for IndexScan(p2_c3_c2): p2_c3_c2_id_val_idx
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2_id_val_idx)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------
- Result
- -> Append
- -> Index Scan using p2_id_val_idx on p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_id_val_idx on p2_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c1_id_val_idx on p2_c1_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c2_id_val_idx on p2_c1_c2 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
-(14 rows)
-
-/*+IndexScan(p2 p2_val_id_idx)*/
-EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2): p2_val_id_idx
-LOG: available indexes for IndexScan(p2_c1): p2_c1_val_id_idx
-LOG: available indexes for IndexScan(p2_c2): p2_c2_val_id_idx
-LOG: available indexes for IndexScan(p2_c3): p2_c3_val_id_idx
-LOG: available indexes for IndexScan(p2_c4):
-LOG: available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_id_idx
-LOG: available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_id_idx
-LOG: available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_id_idx
-LOG: available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_id_idx
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2_val_id_idx)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------
- Result
- -> Append
- -> Index Scan using p2_val_id_idx on p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_val_id_idx on p2_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c1_val_id_idx on p2_c1_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c2_val_id_idx on p2_c1_c2 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
-(14 rows)
-
-EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------------------------------------
- Result
- -> Append
- -> Seq Scan on p2
- Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p2_c1 p2
- Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p2_c2 p2
- Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p2_c3 p2
- Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Tid Scan on p2_c4 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c1_c1 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c1_c2 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c3_c1 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c3_c2 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
-(25 rows)
-
-/*+IndexScan(p2 p2_val)*/
-EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2):
-LOG: available indexes for IndexScan(p2_c1):
-LOG: available indexes for IndexScan(p2_c2):
-LOG: available indexes for IndexScan(p2_c3):
-LOG: available indexes for IndexScan(p2_c4):
-LOG: available indexes for IndexScan(p2_c1_c1):
-LOG: available indexes for IndexScan(p2_c1_c2):
-LOG: available indexes for IndexScan(p2_c3_c1):
-LOG: available indexes for IndexScan(p2_c3_c2):
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2_val)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------------------
- Result
- -> Append
- -> Seq Scan on p2
- Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p2_c1 p2
- Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p2_c2 p2
- Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p2_c3 p2
- Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Tid Scan on p2_c4 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c1_c1 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c1_c2 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c3_c1 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c3_c2 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
-(25 rows)
-
-/*+IndexScan(p2 p2_pkey)*/
-EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2): p2_pkey
-LOG: available indexes for IndexScan(p2_c1): p2_c1_pkey
-LOG: available indexes for IndexScan(p2_c2): p2_c2_pkey
-LOG: available indexes for IndexScan(p2_c3): p2_c3_pkey
-LOG: available indexes for IndexScan(p2_c4): p2_c4_pkey
-LOG: available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
-LOG: available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
-LOG: available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
-LOG: available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2_pkey)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------
- Result
- -> Append
- -> Index Scan using p2_pkey on p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_pkey on p2_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c1_pkey on p2_c1_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c2_pkey on p2_c1_c2 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
-(14 rows)
-
-/*+IndexScan(p2 p2_id2_val)*/
-EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2): p2_id2_val
-LOG: available indexes for IndexScan(p2_c1): p2_c1_id2_val
-LOG: available indexes for IndexScan(p2_c2): p2_c2_id2_val
-LOG: available indexes for IndexScan(p2_c3):
-LOG: available indexes for IndexScan(p2_c4):
-LOG: available indexes for IndexScan(p2_c1_c1):
-LOG: available indexes for IndexScan(p2_c1_c2):
-LOG: available indexes for IndexScan(p2_c3_c1):
-LOG: available indexes for IndexScan(p2_c3_c2):
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2_id2_val)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------
- Result
- -> Append
- -> Index Scan using p2_id2_val on p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_id2_val on p2_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on p2_c1_c1 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p2_c1_c2 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
-(14 rows)
-
-/*+IndexScan(p2 p2_val2_id)*/
-EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2): p2_val2_id
-LOG: available indexes for IndexScan(p2_c1):
-LOG: available indexes for IndexScan(p2_c2):
-LOG: available indexes for IndexScan(p2_c3):
-LOG: available indexes for IndexScan(p2_c4):
-LOG: available indexes for IndexScan(p2_c1_c1):
-LOG: available indexes for IndexScan(p2_c1_c2):
-LOG: available indexes for IndexScan(p2_c3_c1):
-LOG: available indexes for IndexScan(p2_c3_c2):
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2_val2_id)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Result
- -> Append
- -> Index Scan using p2_val2_id on p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on p2_c1 p2
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Tid Scan on p2_c1_c1 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p2_c1_c2 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
-(13 rows)
-
-/*+IndexScan(p2 p2_pkey)*/
-EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2): p2_pkey
-LOG: available indexes for IndexScan(p2_c1): p2_c1_pkey
-LOG: available indexes for IndexScan(p2_c2): p2_c2_pkey
-LOG: available indexes for IndexScan(p2_c3): p2_c3_pkey
-LOG: available indexes for IndexScan(p2_c4): p2_c4_pkey
-LOG: available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
-LOG: available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
-LOG: available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
-LOG: available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2_pkey)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------
- Result
- -> Append
- -> Index Scan using p2_pkey on p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_pkey on p2_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c1_pkey on p2_c1_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c2_pkey on p2_c1_c2 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
-(14 rows)
-
-/*+IndexScan(p2 p2_c1_id_val_idx)*/
-EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2):
-LOG: available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
-LOG: available indexes for IndexScan(p2_c2):
-LOG: available indexes for IndexScan(p2_c3):
-LOG: available indexes for IndexScan(p2_c4):
-LOG: available indexes for IndexScan(p2_c1_c1):
-LOG: available indexes for IndexScan(p2_c1_c2):
-LOG: available indexes for IndexScan(p2_c3_c1):
-LOG: available indexes for IndexScan(p2_c3_c2):
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2_c1_id_val_idx)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Result
- -> Append
- -> Seq Scan on p2
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using p2_c1_id_val_idx on p2_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on p2_c1_c1 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p2_c1_c2 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
-(13 rows)
-
-/*+IndexScan(p2 no_exist)*/
-EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2):
-LOG: available indexes for IndexScan(p2_c1):
-LOG: available indexes for IndexScan(p2_c2):
-LOG: available indexes for IndexScan(p2_c3):
-LOG: available indexes for IndexScan(p2_c4):
-LOG: available indexes for IndexScan(p2_c1_c1):
-LOG: available indexes for IndexScan(p2_c1_c2):
-LOG: available indexes for IndexScan(p2_c3_c1):
-LOG: available indexes for IndexScan(p2_c3_c2):
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 no_exist)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Result
- -> Append
- -> Seq Scan on p2
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p2_c1 p2
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Tid Scan on p2_c1_c1 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p2_c1_c2 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
-(12 rows)
-
-/*+IndexScan(p2 p2_pkey p2_c1_id_val_idx)*/
-EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2): p2_pkey
-LOG: available indexes for IndexScan(p2_c1): p2_c1_id_val_idx p2_c1_pkey
-LOG: available indexes for IndexScan(p2_c2): p2_c2_pkey
-LOG: available indexes for IndexScan(p2_c3): p2_c3_pkey
-LOG: available indexes for IndexScan(p2_c4): p2_c4_pkey
-LOG: available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
-LOG: available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
-LOG: available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
-LOG: available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2_pkey p2_c1_id_val_idx)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------
- Result
- -> Append
- -> Index Scan using p2_pkey on p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_id_val_idx on p2_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c1_pkey on p2_c1_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c2_pkey on p2_c1_c2 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
-(14 rows)
-
-/*+IndexScan(p2 p2_pkey no_exist)*/
-EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2): p2_pkey
-LOG: available indexes for IndexScan(p2_c1): p2_c1_pkey
-LOG: available indexes for IndexScan(p2_c2): p2_c2_pkey
-LOG: available indexes for IndexScan(p2_c3): p2_c3_pkey
-LOG: available indexes for IndexScan(p2_c4): p2_c4_pkey
-LOG: available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
-LOG: available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
-LOG: available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
-LOG: available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2_pkey no_exist)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------
- Result
- -> Append
- -> Index Scan using p2_pkey on p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_pkey on p2_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c1_pkey on p2_c1_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c2_pkey on p2_c1_c2 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
-(14 rows)
-
-/*+IndexScan(p2 p2_c1_id_val_idx no_exist)*/
-EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2):
-LOG: available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
-LOG: available indexes for IndexScan(p2_c2):
-LOG: available indexes for IndexScan(p2_c3):
-LOG: available indexes for IndexScan(p2_c4):
-LOG: available indexes for IndexScan(p2_c1_c1):
-LOG: available indexes for IndexScan(p2_c1_c2):
-LOG: available indexes for IndexScan(p2_c3_c1):
-LOG: available indexes for IndexScan(p2_c3_c2):
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2_c1_id_val_idx no_exist)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Result
- -> Append
- -> Seq Scan on p2
- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Index Scan using p2_c1_id_val_idx on p2_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on p2_c1_c1 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p2_c1_c2 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
-(13 rows)
-
-/*+IndexScan(p2 p2_pkey p2_c1_id_val_idx no_exist)*/
-EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2): p2_pkey
-LOG: available indexes for IndexScan(p2_c1): p2_c1_id_val_idx p2_c1_pkey
-LOG: available indexes for IndexScan(p2_c2): p2_c2_pkey
-LOG: available indexes for IndexScan(p2_c3): p2_c3_pkey
-LOG: available indexes for IndexScan(p2_c4): p2_c4_pkey
-LOG: available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
-LOG: available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
-LOG: available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
-LOG: available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2_pkey p2_c1_id_val_idx no_exist)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------
- Result
- -> Append
- -> Index Scan using p2_pkey on p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_id_val_idx on p2_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c1_pkey on p2_c1_c1 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c2_pkey on p2_c1_c2 p2
- Index Cond: ((id >= 50) AND (id <= 51))
- Filter: (ctid = '(1,1)'::tid)
-(14 rows)
-
-/*+IndexScan(p2 p2_val_idx)*/
-EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2): p2_val_idx
-LOG: available indexes for IndexScan(p2_c1): p2_c1_val_idx
-LOG: available indexes for IndexScan(p2_c2): p2_c2_val_idx
-LOG: available indexes for IndexScan(p2_c3): p2_c3_val_idx
-LOG: available indexes for IndexScan(p2_c4): p2_c4_val_idx
-LOG: available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_idx
-LOG: available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_idx
-LOG: available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_idx
-LOG: available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_idx
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2_val_idx)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------------
- Result
- -> Append
- -> Index Scan using p2_val_idx on p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_val_idx on p2_c1 p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c2_val_idx on p2_c2 p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c3_val_idx on p2_c3 p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c4_val_idx on p2_c4 p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c1_val_idx on p2_c1_c1 p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c2_val_idx on p2_c1_c2 p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c3_c1_val_idx on p2_c3_c1 p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c3_c2_val_idx on p2_c3_c2 p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
-(29 rows)
-
-/*+IndexScan(p2 p2_expr)*/
-EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2): p2_expr
-LOG: available indexes for IndexScan(p2_c1): p2_c1_expr_idx
-LOG: available indexes for IndexScan(p2_c2): p2_c2_expr_idx
-LOG: available indexes for IndexScan(p2_c3): p2_c3_expr_idx
-LOG: available indexes for IndexScan(p2_c4): p2_c4_expr_idx
-LOG: available indexes for IndexScan(p2_c1_c1): p2_c1_c1_expr_idx
-LOG: available indexes for IndexScan(p2_c1_c2): p2_c1_c2_expr_idx
-LOG: available indexes for IndexScan(p2_c3_c1): p2_c3_c1_expr_idx
-LOG: available indexes for IndexScan(p2_c3_c2): p2_c3_c2_expr_idx
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2_expr)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------------------
- Result
- -> Append
- -> Seq Scan on p2
- Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p2_c1 p2
- Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p2_c2 p2
- Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p2_c3 p2
- Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Tid Scan on p2_c4 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c1_c1 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c1_c2 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c3_c1 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c3_c2 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
-(25 rows)
-
-/*+IndexScan(p2 p2_val_idx6)*/
-EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2): p2_val_idx6
-LOG: available indexes for IndexScan(p2_c1): p2_c1_val_idx6
-LOG: available indexes for IndexScan(p2_c2): p2_c2_val_idx6
-LOG: available indexes for IndexScan(p2_c3): p2_c3_val_idx6
-LOG: available indexes for IndexScan(p2_c4): p2_c4_val_idx6
-LOG: available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_idx6
-LOG: available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_idx6
-LOG: available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_idx6
-LOG: available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_idx6
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2_val_idx6)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------------------
- Result
- -> Append
- -> Seq Scan on p2
- Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p2_c1 p2
- Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p2_c2 p2
- Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Seq Scan on p2_c3 p2
- Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Tid Scan on p2_c4 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c1_c1 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c1_c2 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c3_c1 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c3_c2 p2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
-(25 rows)
-
-/*+IndexScan(p2 p2_val_idx p2_val_idx6)*/
-EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
-LOG: available indexes for IndexScan(p2): p2_val_idx6 p2_val_idx
-LOG: available indexes for IndexScan(p2_c1): p2_c1_val_idx6 p2_c1_val_idx
-LOG: available indexes for IndexScan(p2_c2): p2_c2_val_idx6 p2_c2_val_idx
-LOG: available indexes for IndexScan(p2_c3): p2_c3_val_idx6 p2_c3_val_idx
-LOG: available indexes for IndexScan(p2_c4): p2_c4_val_idx6 p2_c4_val_idx
-LOG: available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_idx6 p2_c1_c1_val_idx
-LOG: available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_idx6 p2_c1_c2_val_idx
-LOG: available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_idx6 p2_c3_c1_val_idx
-LOG: available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_idx6 p2_c3_c2_val_idx
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2_val_idx p2_val_idx6)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------------
- Result
- -> Append
- -> Index Scan using p2_val_idx on p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_val_idx on p2_c1 p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c2_val_idx on p2_c2 p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c3_val_idx on p2_c3 p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c4_val_idx on p2_c4 p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c1_val_idx on p2_c1_c1 p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c1_c2_val_idx on p2_c1_c2 p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c3_c1_val_idx on p2_c3_c1 p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using p2_c3_c2_val_idx on p2_c3_c2 p2
- Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
- Filter: (ctid = '(1,1)'::tid)
-(29 rows)
-
--- regular expression
--- ordinary table
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
- QUERY PLAN
----------------------------------------------------------------------------------------------
- Index Only Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
- Index Cond: (id = 1)
-(2 rows)
-
-/*+ IndexScanRegexp(t5 t5_[^i].*)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-LOG: available indexes for IndexScanRegexp(t5): t5_val t5_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexScanRegexp(t5 t5_[^i].*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------
- Index Scan using t5_pkey on t5
- Index Cond: (id = 1)
-(2 rows)
-
-/*+ IndexScanRegexp(t5 t5_id[0-9].*)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-LOG: available indexes for IndexScanRegexp(t5): t5_id3 t5_id2 t5_id1
-LOG: pg_hint_plan:
-used hint:
-IndexScanRegexp(t5 t5_id[0-9].*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------
- Index Scan using t5_id3 on t5
- Index Cond: (id = 1)
-(2 rows)
-
-/*+ IndexScanRegexp(t5 t5[^_].*)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-LOG: available indexes for IndexScanRegexp(t5):
-LOG: pg_hint_plan:
-used hint:
-IndexScanRegexp(t5 t5[^_].*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t5
- Filter: (id = 1)
-(2 rows)
-
-/*+ IndexScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-LOG: available indexes for IndexScanRegexp(t5):
-LOG: pg_hint_plan:
-used hint:
-IndexScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t5
- Filter: (id = 1)
-(2 rows)
-
-/*+ IndexScan(t5 t5_id[0-9].*)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-LOG: available indexes for IndexScan(t5):
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t5 t5_id[0-9].*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t5
- Filter: (id = 1)
-(2 rows)
-
-/*+ IndexOnlyScanRegexp(t5 t5_[^i].*)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-LOG: available indexes for IndexOnlyScanRegexp(t5): t5_val t5_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScanRegexp(t5 t5_[^i].*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Index Only Scan using t5_pkey on t5
- Index Cond: (id = 1)
-(2 rows)
-
-/*+ IndexOnlyScanRegexp(t5 t5_id[0-9].*)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-LOG: available indexes for IndexOnlyScanRegexp(t5): t5_id3 t5_id2 t5_id1
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScanRegexp(t5 t5_id[0-9].*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Index Only Scan using t5_id3 on t5
- Index Cond: (id = 1)
-(2 rows)
-
-/*+ IndexOnlyScanRegexp(t5 t5[^_].*)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-LOG: available indexes for IndexOnlyScanRegexp(t5):
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScanRegexp(t5 t5[^_].*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t5
- Filter: (id = 1)
-(2 rows)
-
-/*+ IndexOnlyScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-LOG: available indexes for IndexOnlyScanRegexp(t5):
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t5
- Filter: (id = 1)
-(2 rows)
-
-/*+ IndexOnlyScan(t5 t5_id[0-9].*)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-LOG: available indexes for IndexOnlyScan(t5):
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(t5 t5_id[0-9].*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t5
- Filter: (id = 1)
-(2 rows)
-
-/*+ BitmapScanRegexp(t5 t5_[^i].*)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-LOG: available indexes for BitmapScanRegexp(t5): t5_val t5_pkey
-LOG: pg_hint_plan:
-used hint:
-BitmapScanRegexp(t5 t5_[^i].*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Bitmap Heap Scan on t5
- Recheck Cond: (id = 1)
- -> Bitmap Index Scan on t5_pkey
- Index Cond: (id = 1)
-(4 rows)
-
-/*+ BitmapScanRegexp(t5 t5_id[0-9].*)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-LOG: available indexes for BitmapScanRegexp(t5): t5_id3 t5_id2 t5_id1
-LOG: pg_hint_plan:
-used hint:
-BitmapScanRegexp(t5 t5_id[0-9].*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Bitmap Heap Scan on t5
- Recheck Cond: (id = 1)
- -> Bitmap Index Scan on t5_id3
- Index Cond: (id = 1)
-(4 rows)
-
-/*+ BitmapScanRegexp(t5 t5[^_].*)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-LOG: available indexes for BitmapScanRegexp(t5):
-LOG: pg_hint_plan:
-used hint:
-BitmapScanRegexp(t5 t5[^_].*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t5
- Filter: (id = 1)
-(2 rows)
-
-/*+ BitmapScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-LOG: available indexes for BitmapScanRegexp(t5):
-LOG: pg_hint_plan:
-used hint:
-BitmapScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t5
- Filter: (id = 1)
-(2 rows)
-
-/*+ BitmapScan(t5 t5_id[0-9].*)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-LOG: available indexes for BitmapScan(t5):
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t5 t5_id[0-9].*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t5
- Filter: (id = 1)
-(2 rows)
-
--- Inheritance
-EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
- QUERY PLAN
--------------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c4 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c2 p1
- Filter: (val = 1)
-(20 rows)
-
-/*+ IndexScanRegexp(p1 p1_.*[^0-9]$)*/
-EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
-LOG: available indexes for IndexScanRegexp(p1): p1_pkey
-LOG: available indexes for IndexScanRegexp(p1_c1): p1_c1_pkey
-LOG: available indexes for IndexScanRegexp(p1_c2): p1_c2_pkey
-LOG: available indexes for IndexScanRegexp(p1_c3): p1_c3_pkey
-LOG: available indexes for IndexScanRegexp(p1_c4): p1_c4_pkey
-LOG: available indexes for IndexScanRegexp(p1_c1_c1): p1_c1_c1_pkey
-LOG: available indexes for IndexScanRegexp(p1_c1_c2): p1_c1_c2_pkey
-LOG: available indexes for IndexScanRegexp(p1_c3_c1): p1_c3_c1_pkey
-LOG: available indexes for IndexScanRegexp(p1_c3_c2): p1_c3_c2_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexScanRegexp(p1 p1_.*[^0-9]$)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c4 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c2 p1
- Filter: (val = 1)
-(20 rows)
-
-/*+ IndexScanRegexp(p1 p1_.*val2.*)*/
-EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
-LOG: available indexes for IndexScanRegexp(p1): p1_val2
-LOG: available indexes for IndexScanRegexp(p1_c1): p1_c1_val2
-LOG: available indexes for IndexScanRegexp(p1_c2): p1_c2_val2
-LOG: available indexes for IndexScanRegexp(p1_c3): p1_c3_val2
-LOG: available indexes for IndexScanRegexp(p1_c4): p1_c4_val2
-LOG: available indexes for IndexScanRegexp(p1_c1_c1): p1_c1_c1_val2
-LOG: available indexes for IndexScanRegexp(p1_c1_c2): p1_c1_c2_val2
-LOG: available indexes for IndexScanRegexp(p1_c3_c1): p1_c3_c1_val2
-LOG: available indexes for IndexScanRegexp(p1_c3_c2): p1_c3_c2_val2
-LOG: pg_hint_plan:
-used hint:
-IndexScanRegexp(p1 p1_.*val2.*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------
- Result
- -> Append
- -> Index Scan using p1_val2 on p1
- Index Cond: (val = 1)
- -> Index Scan using p1_c1_val2 on p1_c1 p1
- Index Cond: (val = 1)
- -> Index Scan using p1_c2_val2 on p1_c2 p1
- Index Cond: (val = 1)
- -> Index Scan using p1_c3_val2 on p1_c3 p1
- Index Cond: (val = 1)
- -> Index Scan using p1_c4_val2 on p1_c4 p1
- Index Cond: (val = 1)
- -> Index Scan using p1_c1_c1_val2 on p1_c1_c1 p1
- Index Cond: (val = 1)
- -> Index Scan using p1_c1_c2_val2 on p1_c1_c2 p1
- Index Cond: (val = 1)
- -> Index Scan using p1_c3_c1_val2 on p1_c3_c1 p1
- Index Cond: (val = 1)
- -> Index Scan using p1_c3_c2_val2 on p1_c3_c2 p1
- Index Cond: (val = 1)
-(20 rows)
-
-/*+ IndexScanRegexp(p1 p1[^_].*)*/
-EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
-LOG: available indexes for IndexScanRegexp(p1):
-LOG: available indexes for IndexScanRegexp(p1_c1):
-LOG: available indexes for IndexScanRegexp(p1_c2):
-LOG: available indexes for IndexScanRegexp(p1_c3):
-LOG: available indexes for IndexScanRegexp(p1_c4):
-LOG: available indexes for IndexScanRegexp(p1_c1_c1):
-LOG: available indexes for IndexScanRegexp(p1_c1_c2):
-LOG: available indexes for IndexScanRegexp(p1_c3_c1):
-LOG: available indexes for IndexScanRegexp(p1_c3_c2):
-LOG: pg_hint_plan:
-used hint:
-IndexScanRegexp(p1 p1[^_].*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c4 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c2 p1
- Filter: (val = 1)
-(20 rows)
-
-/*+ IndexScan(p1 p1_.*val2.*)*/
-EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
-LOG: available indexes for IndexScan(p1):
-LOG: available indexes for IndexScan(p1_c1):
-LOG: available indexes for IndexScan(p1_c2):
-LOG: available indexes for IndexScan(p1_c3):
-LOG: available indexes for IndexScan(p1_c4):
-LOG: available indexes for IndexScan(p1_c1_c1):
-LOG: available indexes for IndexScan(p1_c1_c2):
-LOG: available indexes for IndexScan(p1_c3_c1):
-LOG: available indexes for IndexScan(p1_c3_c2):
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p1 p1_.*val2.*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c4 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c2 p1
- Filter: (val = 1)
-(20 rows)
-
-/*+ IndexOnlyScanRegexp(p1 p1_.*[^0-9]$)*/
-EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
-LOG: available indexes for IndexOnlyScanRegexp(p1): p1_pkey
-LOG: available indexes for IndexOnlyScanRegexp(p1_c1): p1_c1_pkey
-LOG: available indexes for IndexOnlyScanRegexp(p1_c2): p1_c2_pkey
-LOG: available indexes for IndexOnlyScanRegexp(p1_c3): p1_c3_pkey
-LOG: available indexes for IndexOnlyScanRegexp(p1_c4): p1_c4_pkey
-LOG: available indexes for IndexOnlyScanRegexp(p1_c1_c1): p1_c1_c1_pkey
-LOG: available indexes for IndexOnlyScanRegexp(p1_c1_c2): p1_c1_c2_pkey
-LOG: available indexes for IndexOnlyScanRegexp(p1_c3_c1): p1_c3_c1_pkey
-LOG: available indexes for IndexOnlyScanRegexp(p1_c3_c2): p1_c3_c2_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScanRegexp(p1 p1_.*[^0-9]$)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c4 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c2 p1
- Filter: (val = 1)
-(20 rows)
-
-/*+ IndexOnlyScanRegexp(p1 p1_.*val2.*)*/
-EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
-LOG: available indexes for IndexOnlyScanRegexp(p1): p1_val2
-LOG: available indexes for IndexOnlyScanRegexp(p1_c1): p1_c1_val2
-LOG: available indexes for IndexOnlyScanRegexp(p1_c2): p1_c2_val2
-LOG: available indexes for IndexOnlyScanRegexp(p1_c3): p1_c3_val2
-LOG: available indexes for IndexOnlyScanRegexp(p1_c4): p1_c4_val2
-LOG: available indexes for IndexOnlyScanRegexp(p1_c1_c1): p1_c1_c1_val2
-LOG: available indexes for IndexOnlyScanRegexp(p1_c1_c2): p1_c1_c2_val2
-LOG: available indexes for IndexOnlyScanRegexp(p1_c3_c1): p1_c3_c1_val2
-LOG: available indexes for IndexOnlyScanRegexp(p1_c3_c2): p1_c3_c2_val2
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScanRegexp(p1 p1_.*val2.*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------
- Result
- -> Append
- -> Index Only Scan using p1_val2 on p1
- Index Cond: (val = 1)
- -> Index Only Scan using p1_c1_val2 on p1_c1 p1
- Index Cond: (val = 1)
- -> Index Only Scan using p1_c2_val2 on p1_c2 p1
- Index Cond: (val = 1)
- -> Index Only Scan using p1_c3_val2 on p1_c3 p1
- Index Cond: (val = 1)
- -> Index Only Scan using p1_c4_val2 on p1_c4 p1
- Index Cond: (val = 1)
- -> Index Only Scan using p1_c1_c1_val2 on p1_c1_c1 p1
- Index Cond: (val = 1)
- -> Index Only Scan using p1_c1_c2_val2 on p1_c1_c2 p1
- Index Cond: (val = 1)
- -> Index Only Scan using p1_c3_c1_val2 on p1_c3_c1 p1
- Index Cond: (val = 1)
- -> Index Only Scan using p1_c3_c2_val2 on p1_c3_c2 p1
- Index Cond: (val = 1)
-(20 rows)
-
-/*+ IndexOnlyScanRegexp(p1 p1[^_].*)*/
-EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
-LOG: available indexes for IndexOnlyScanRegexp(p1):
-LOG: available indexes for IndexOnlyScanRegexp(p1_c1):
-LOG: available indexes for IndexOnlyScanRegexp(p1_c2):
-LOG: available indexes for IndexOnlyScanRegexp(p1_c3):
-LOG: available indexes for IndexOnlyScanRegexp(p1_c4):
-LOG: available indexes for IndexOnlyScanRegexp(p1_c1_c1):
-LOG: available indexes for IndexOnlyScanRegexp(p1_c1_c2):
-LOG: available indexes for IndexOnlyScanRegexp(p1_c3_c1):
-LOG: available indexes for IndexOnlyScanRegexp(p1_c3_c2):
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScanRegexp(p1 p1[^_].*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c4 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c2 p1
- Filter: (val = 1)
-(20 rows)
-
-/*+ IndexOnlyScan(p1 p1_.*val2.*)*/
-EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
-LOG: available indexes for IndexOnlyScan(p1):
-LOG: available indexes for IndexOnlyScan(p1_c1):
-LOG: available indexes for IndexOnlyScan(p1_c2):
-LOG: available indexes for IndexOnlyScan(p1_c3):
-LOG: available indexes for IndexOnlyScan(p1_c4):
-LOG: available indexes for IndexOnlyScan(p1_c1_c1):
-LOG: available indexes for IndexOnlyScan(p1_c1_c2):
-LOG: available indexes for IndexOnlyScan(p1_c3_c1):
-LOG: available indexes for IndexOnlyScan(p1_c3_c2):
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(p1 p1_.*val2.*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c4 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c2 p1
- Filter: (val = 1)
-(20 rows)
-
-/*+ BitmapScanRegexp(p1 p1_.*[^0-9]$)*/
-EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
-LOG: available indexes for BitmapScanRegexp(p1): p1_pkey
-LOG: available indexes for BitmapScanRegexp(p1_c1): p1_c1_pkey
-LOG: available indexes for BitmapScanRegexp(p1_c2): p1_c2_pkey
-LOG: available indexes for BitmapScanRegexp(p1_c3): p1_c3_pkey
-LOG: available indexes for BitmapScanRegexp(p1_c4): p1_c4_pkey
-LOG: available indexes for BitmapScanRegexp(p1_c1_c1): p1_c1_c1_pkey
-LOG: available indexes for BitmapScanRegexp(p1_c1_c2): p1_c1_c2_pkey
-LOG: available indexes for BitmapScanRegexp(p1_c3_c1): p1_c3_c1_pkey
-LOG: available indexes for BitmapScanRegexp(p1_c3_c2): p1_c3_c2_pkey
-LOG: pg_hint_plan:
-used hint:
-BitmapScanRegexp(p1 p1_.*[^0-9]$)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c4 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c2 p1
- Filter: (val = 1)
-(20 rows)
-
-/*+ BitmapScanRegexp(p1 p1_.*val2.*)*/
-EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
-LOG: available indexes for BitmapScanRegexp(p1): p1_val2
-LOG: available indexes for BitmapScanRegexp(p1_c1): p1_c1_val2
-LOG: available indexes for BitmapScanRegexp(p1_c2): p1_c2_val2
-LOG: available indexes for BitmapScanRegexp(p1_c3): p1_c3_val2
-LOG: available indexes for BitmapScanRegexp(p1_c4): p1_c4_val2
-LOG: available indexes for BitmapScanRegexp(p1_c1_c1): p1_c1_c1_val2
-LOG: available indexes for BitmapScanRegexp(p1_c1_c2): p1_c1_c2_val2
-LOG: available indexes for BitmapScanRegexp(p1_c3_c1): p1_c3_c1_val2
-LOG: available indexes for BitmapScanRegexp(p1_c3_c2): p1_c3_c2_val2
-LOG: pg_hint_plan:
-used hint:
-BitmapScanRegexp(p1 p1_.*val2.*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------
- Result
- -> Append
- -> Bitmap Heap Scan on p1
- Recheck Cond: (val = 1)
- -> Bitmap Index Scan on p1_val2
- Index Cond: (val = 1)
- -> Bitmap Heap Scan on p1_c1 p1
- Recheck Cond: (val = 1)
- -> Bitmap Index Scan on p1_c1_val2
- Index Cond: (val = 1)
- -> Bitmap Heap Scan on p1_c2 p1
- Recheck Cond: (val = 1)
- -> Bitmap Index Scan on p1_c2_val2
- Index Cond: (val = 1)
- -> Bitmap Heap Scan on p1_c3 p1
- Recheck Cond: (val = 1)
- -> Bitmap Index Scan on p1_c3_val2
- Index Cond: (val = 1)
- -> Bitmap Heap Scan on p1_c4 p1
- Recheck Cond: (val = 1)
- -> Bitmap Index Scan on p1_c4_val2
- Index Cond: (val = 1)
- -> Bitmap Heap Scan on p1_c1_c1 p1
- Recheck Cond: (val = 1)
- -> Bitmap Index Scan on p1_c1_c1_val2
- Index Cond: (val = 1)
- -> Bitmap Heap Scan on p1_c1_c2 p1
- Recheck Cond: (val = 1)
- -> Bitmap Index Scan on p1_c1_c2_val2
- Index Cond: (val = 1)
- -> Bitmap Heap Scan on p1_c3_c1 p1
- Recheck Cond: (val = 1)
- -> Bitmap Index Scan on p1_c3_c1_val2
- Index Cond: (val = 1)
- -> Bitmap Heap Scan on p1_c3_c2 p1
- Recheck Cond: (val = 1)
- -> Bitmap Index Scan on p1_c3_c2_val2
- Index Cond: (val = 1)
-(38 rows)
-
-/*+ BitmapScanRegexp(p1 p1[^_].*)*/
-EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
-LOG: available indexes for BitmapScanRegexp(p1):
-LOG: available indexes for BitmapScanRegexp(p1_c1):
-LOG: available indexes for BitmapScanRegexp(p1_c2):
-LOG: available indexes for BitmapScanRegexp(p1_c3):
-LOG: available indexes for BitmapScanRegexp(p1_c4):
-LOG: available indexes for BitmapScanRegexp(p1_c1_c1):
-LOG: available indexes for BitmapScanRegexp(p1_c1_c2):
-LOG: available indexes for BitmapScanRegexp(p1_c3_c1):
-LOG: available indexes for BitmapScanRegexp(p1_c3_c2):
-LOG: pg_hint_plan:
-used hint:
-BitmapScanRegexp(p1 p1[^_].*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c4 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c2 p1
- Filter: (val = 1)
-(20 rows)
-
-/*+ BitmapScan(p1 p1_.*val2.*)*/
-EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
-LOG: available indexes for BitmapScan(p1):
-LOG: available indexes for BitmapScan(p1_c1):
-LOG: available indexes for BitmapScan(p1_c2):
-LOG: available indexes for BitmapScan(p1_c3):
-LOG: available indexes for BitmapScan(p1_c4):
-LOG: available indexes for BitmapScan(p1_c1_c1):
-LOG: available indexes for BitmapScan(p1_c1_c2):
-LOG: available indexes for BitmapScan(p1_c3_c1):
-LOG: available indexes for BitmapScan(p1_c3_c2):
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(p1 p1_.*val2.*)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c4 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c1_c2 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c1 p1
- Filter: (val = 1)
- -> Seq Scan on p1_c3_c2 p1
- Filter: (val = 1)
-(20 rows)
-
--- search from hint table
-INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?;', '', 'SeqScan(t1)');
-INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN (COSTS false) SELECT id FROM t1 WHERE t1.id = ?;', '', 'IndexScan(t1)');
-INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN SELECT * FROM t1 WHERE t1.id = ?;', '', 'BitmapScan(t1)');
-SELECT * FROM hint_plan.hints ORDER BY id;
- id | norm_query_string | application_name | hints
-----+----------------------------------------------------------+------------------+----------------
- 1 | EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?; | | SeqScan(t1)
- 2 | EXPLAIN (COSTS false) SELECT id FROM t1 WHERE t1.id = ?; | | IndexScan(t1)
- 3 | EXPLAIN SELECT * FROM t1 WHERE t1.id = ?; | | BitmapScan(t1)
-(3 rows)
-
-SET pg_hint_plan.enable_hint_table = on;
-EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (id = 1)
-(2 rows)
-
-SET pg_hint_plan.enable_hint_table = off;
-EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = 1;
- QUERY PLAN
---------------------------------
- Index Scan using t1_pkey on t1
- Index Cond: (id = 1)
-(2 rows)
-
-TRUNCATE hint_plan.hints;
-VACUUM ANALYZE hint_plan.hints;
--- plpgsql test
-EXPLAIN (COSTS false) SELECT id FROM t1 WHERE t1.id = 1;
- QUERY PLAN
--------------------------------------
- Index Only Scan using t1_pkey on t1
- Index Cond: (id = 1)
-(2 rows)
-
-DO LANGUAGE plpgsql $$
-DECLARE
- id integer;
-BEGIN
- SELECT /*+SeqScan(t1)*/ t1.id INTO id FROM t1 WHERE t1.id = 1;
- RETURN;
-END;
-$$;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
-CONTEXT: SQL statement "SELECT /*+SeqScan(t1)*/ t1.id FROM t1 WHERE t1.id = 1"
-PL/pgSQL function inline_code_block line 5 at SQL statement
-DROP EXTENSION pg_hint_plan;
ORDER BY 1;
query | calls
-------------------------------------------------------------------+-------
- /*+SeqScan(t1)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1; | 1
- /*+Set(enable_seqscan off)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1; | 1
SELECT * FROM s1.t1 WHERE t1.c1 = 1; | 1
SELECT pg_stat_statements_reset(); | 1
+ /*+SeqScan(t1)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1; | 1
+ /*+Set(enable_seqscan off)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1; | 1
(4 rows)
----
+++ /dev/null
-LOAD 'pg_hint_plan';
-SET pg_hint_plan.enable_hint TO on;
-SET pg_hint_plan.debug_print TO on;
-SET client_min_messages TO LOG;
-SET search_path TO public;
-----
----- No.A-1-1 install
----- No.A-2-1 uninstall
-----
--- No.A-1-1-3
-CREATE EXTENSION pg_hint_plan;
--- No.A-1-2-3
-DROP EXTENSION pg_hint_plan;
--- No.A-1-1-4
-CREATE EXTENSION pg_hint_plan SCHEMA other_name;
-ERROR: extension "pg_hint_plan" must be installed in schema "hint_plan"
-CREATE EXTENSION pg_hint_plan;
-----
----- No. A-5-1 comment pattern
-----
--- No. A-5-1-1
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-5-1-2
-/* +SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. A-5-1-3
-/*SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. A-5-1-4
---+SeqScan(t1)
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. A-5-1-5
-/* /*+SeqScan(t1)*/ */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-----
----- No. A-5-2 hint position
-----
--- No. A-5-2-1
-EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
------------------------------------
- Index Only Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-5-2-2
-EXPLAIN (COSTS false) SELECT c1, c2 AS c_2 /*+SeqScan(t1)*/ FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-5-2-3
-EXPLAIN (COSTS false) SELECT c1 AS "c1"/*+SeqScan(t1)*/ FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
------------------------------------
- Index Only Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. A-5-2-4
-EXPLAIN (COSTS false) SELECT * /*+SeqScan(t1)*/ FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-----
----- No. A-6-1 hint's table definition
-----
-SET pg_hint_plan.enable_hint_table TO on;
--- No. A-6-1-1
-\d hint_plan.hints
- Table "hint_plan.hints"
- Column | Type | Modifiers
--------------------+---------+--------------------------------------------------------------
- id | integer | not null default nextval('hint_plan.hints_id_seq'::regclass)
- norm_query_string | text | not null
- application_name | text | not null
- hints | text | not null
-Indexes:
- "hints_pkey" PRIMARY KEY, btree (id)
- "hints_norm_and_app" UNIQUE, btree (norm_query_string, application_name)
-
-----
----- No. A-6-2 search condition
-----
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. A-6-2-1
-INSERT INTO hint_plan.hints (norm_query_string, application_name, hints)
- VALUES (
- 'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ?;',
- '',
- 'SeqScan(t1)');
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-6-2-2
-INSERT INTO hint_plan.hints (norm_query_string, application_name, hints)
- VALUES (
- 'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ?;',
- 'psql',
- 'BitmapScan(t1)');
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
-TRUNCATE hint_plan.hints;
--- No. A-6-2-3
-INSERT INTO hint_plan.hints (norm_query_string, application_name, hints)
- VALUES (
- 'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ?;',
- 'dummy_application_name',
- 'SeqScan(t1)'
-);
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-TRUNCATE hint_plan.hints;
--- No. A-6-2-4
-INSERT INTO hint_plan.hints (norm_query_string, application_name, hints)
- VALUES (
- 'EXPLAIN (COSTS false) SELECT * FROM s1.t1;',
- '',
- 'SeqScan(t1)'
-);
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-TRUNCATE hint_plan.hints;
-----
----- No. A-6-3 number of constant
-----
--- No. A-6-3-1
-INSERT INTO hint_plan.hints (norm_query_string, application_name, hints)
- VALUES (
- 'EXPLAIN (COSTS false) SELECT c1 FROM s1.t1;',
- '',
- 'SeqScan(t1)'
-);
-EXPLAIN (COSTS false) SELECT c1 FROM s1.t1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------
- Seq Scan on t1
-(1 row)
-
-TRUNCATE hint_plan.hints;
--- No. A-6-3-2
-INSERT INTO hint_plan.hints (norm_query_string, application_name, hints)
- VALUES (
- 'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ?;',
- '',
- 'SeqScan(t1)'
-);
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
-TRUNCATE hint_plan.hints;
--- No. A-6-3-3
-INSERT INTO hint_plan.hints (norm_query_string, application_name, hints)
- VALUES (
- 'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ? OR t1.c1 = ?;',
- '',
- 'SeqScan(t1)'
-);
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 OR t1.c1 = 0;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Seq Scan on t1
- Filter: ((c1 = 1) OR (c1 = 0))
-(2 rows)
-
-TRUNCATE hint_plan.hints;
-SET pg_hint_plan.enable_hint_table TO off;
-----
----- No. A-7-2 hint delimiter
-----
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-1
--- No. A-7-2-2
--- No. A-7-2-3
--- No. A-7-2-4
--- No. A-7-2-5
--- No. A-7-2-6
--- No. A-7-2-7
-/*+Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-8
-/*+ Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-9
-/*+Set(enable_indexscan"off")Set(enable_bitmapscan"off") */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-10
-/*+ Set (enable_indexscan"off") Set (enable_bitmapscan"off")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-11
-/*+Set ( enable_indexscan"off")Set ( enable_bitmapscan"off")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-12
-/*+Set(enable_indexscan"off" ) Set(enable_bitmapscan"off" ) */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-13
-/*+Set( enable_indexscan "off" )Set( enable_bitmapscan "off" )*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-14
-/*+ Set ( enable_indexscan "off" ) Set ( enable_bitmapscan "off" ) */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-15
-/*+ Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-16
-/*+Set(enable_indexscan"off")Set(enable_bitmapscan"off") */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-17
-/*+ Set (enable_indexscan"off") Set (enable_bitmapscan"off")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-18
-/*+Set ( enable_indexscan"off")Set ( enable_bitmapscan"off")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-19
-/*+Set(enable_indexscan"off" ) Set(enable_bitmapscan"off" ) */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-20
-/*+Set( enable_indexscan "off" )Set( enable_bitmapscan "off" )*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-21
-/*+ Set ( enable_indexscan "off" ) Set ( enable_bitmapscan "off" ) */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-22
-/*+
-Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-23
-/*+Set(enable_indexscan"off")Set(enable_bitmapscan"off")
-*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-24
-/*+
-Set
-(enable_indexscan"off")
-Set
-(enable_bitmapscan"off")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-25
-/*+Set
-(
-enable_indexscan"off")Set
-(
-enable_bitmapscan"off")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-26
-/*+Set(enable_indexscan"off"
-)
-Set(enable_bitmapscan"off"
-)
-*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-27
-/*+Set(
-enable_indexscan
-"off"
-)Set(
-enable_bitmapscan
-"off"
-)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-28
-/*+
-Set
-(
-enable_indexscan
-"off"
-)
-Set
-(
-enable_bitmapscan
-"off"
-)
-*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-29
-/*+
- Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-30
-/*+Set(enable_indexscan"off")Set(enable_bitmapscan"off")
- */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-31
-/*+
- Set
- (enable_indexscan"off")
- Set
- (enable_bitmapscan"off")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-32
-/*+Set
- (
- enable_indexscan"off")Set
- (
- enable_bitmapscan"off")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-33
-/*+Set(enable_indexscan"off"
- )
- Set(enable_bitmapscan"off"
- )
- */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-34
-/*+Set(
- enable_indexscan
- "off"
- )Set(
- enable_bitmapscan
- "off"
- )*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-2-35
-/*+
- Set
- (
- enable_indexscan
- "off"
- )
- Set
- (
- enable_bitmapscan
- "off"
- )
- */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_bitmapscan off)
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
-----
----- No. A-7-3 hint object pattern
----- No. A-9-2 message object pattern
-----
--- No. A-7-3-1
--- No. A-9-2-1
-/*+SeqScan(t)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 t WHERE t.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1 t
- Filter: (c1 = 1)
-(2 rows)
-
-/*+SeqScan(ttt)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 ttt WHERE ttt.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(ttt)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1 ttt
- Filter: (c1 = 1)
-(2 rows)
-
-/*+SeqScan("t")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 t WHERE t.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1 t
- Filter: (c1 = 1)
-(2 rows)
-
-/*+SeqScan("ttt")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 ttt WHERE ttt.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(ttt)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1 ttt
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-3-2
--- No. A-9-2-2
-/*+SeqScan(T)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "T" WHERE "T".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(T)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1 "T"
- Filter: (c1 = 1)
-(2 rows)
-
-/*+SeqScan(TTT)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "TTT" WHERE "TTT".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(TTT)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------
- Seq Scan on t1 "TTT"
- Filter: (c1 = 1)
-(2 rows)
-
-/*+SeqScan("T")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "T" WHERE "T".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(T)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1 "T"
- Filter: (c1 = 1)
-(2 rows)
-
-/*+SeqScan("TTT")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "TTT" WHERE "TTT".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(TTT)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------
- Seq Scan on t1 "TTT"
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-3-3
--- No. A-9-2-3
-/*+SeqScan(()*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "(" WHERE "(".c1 = 1;
-INFO: hint syntax error at or near "()"
-DETAIL: Zero-length delimited string.
- QUERY PLAN
-----------------------------------
- Index Scan using t1_i1 on t1 "("
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+SeqScan("(")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "(" WHERE "(".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan("(")
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1 "("
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-3-4
--- No. A-9-2-4
-/*+SeqScan())*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")" WHERE ")".c1 = 1;
-INFO: hint syntax error at or near ")"
-DETAIL: SeqScan hint requires a relation.
-INFO: hint syntax error at or near ")"
-DETAIL: Unrecognized hint keyword ")".
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-SeqScan()
-
- QUERY PLAN
-----------------------------------
- Index Scan using t1_i1 on t1 ")"
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+SeqScan(")")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")" WHERE ")".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(")")
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1 ")"
- Filter: (c1 = 1)
-(2 rows)
-
-/*+SeqScan(")))")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")))" WHERE ")))".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(")))")
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------
- Seq Scan on t1 ")))"
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-3-5
--- No. A-9-2-5
-/*+SeqScan(")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 """" WHERE """".c1 = 1;
-INFO: hint syntax error at or near ""
-DETAIL: Unterminated quoted string.
- QUERY PLAN
------------------------------------
- Index Scan using t1_i1 on t1 """"
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+SeqScan("""")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 """" WHERE """".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan("""")
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------
- Seq Scan on t1 """"
- Filter: (c1 = 1)
-(2 rows)
-
-/*+SeqScan("""""""")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 """""""" WHERE """""""".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan("""""""")
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------
- Seq Scan on t1 """"""""
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-3-6
--- No. A-9-2-6
-/*+SeqScan( )*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
-INFO: hint syntax error at or near ""
-DETAIL: SeqScan hint requires a relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-SeqScan()
-
- QUERY PLAN
-----------------------------------
- Index Scan using t1_i1 on t1 " "
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+SeqScan(" ")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(" ")
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1 " "
- Filter: (c1 = 1)
-(2 rows)
-
-/*+SeqScan(" ")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(" ")
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------
- Seq Scan on t1 " "
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-3-7
--- No. A-9-2-7
-/*+SeqScan( )*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
-INFO: hint syntax error at or near ""
-DETAIL: SeqScan hint requires a relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-SeqScan()
-
- QUERY PLAN
------------------------------------
- Index Scan using t1_i1 on t1 " "
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+SeqScan(" ")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(" ")
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------
- Seq Scan on t1 " "
- Filter: (c1 = 1)
-(2 rows)
-
-/*+SeqScan(" ")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(" ")
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------
- Seq Scan on t1 " "
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-3-8
--- No. A-9-2-8
-/*+SeqScan(
-)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
-" WHERE "
-".c1 = 1;
-INFO: hint syntax error at or near ""
-DETAIL: SeqScan hint requires a relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-SeqScan()
-
- QUERY PLAN
---------------------------------
- Index Scan using t1_i1 on t1 "
- "
- Index Cond: (c1 = 1)
-(3 rows)
-
-/*+SeqScan("
-")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
-" WHERE "
-".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan("
-")
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1 "
- "
- Filter: (c1 = 1)
-(3 rows)
-
-/*+SeqScan("
-
-
-")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
-
-
-" WHERE "
-
-
-".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan("
-
-
-")
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1 "
-
-
- "
- Filter: (c1 = 1)
-(5 rows)
-
--- No. A-7-3-9
--- No. A-9-2-9
-/*+SeqScan(Set)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set" WHERE "Set".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(Set)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------
- Seq Scan on t1 "Set"
- Filter: (c1 = 1)
-(2 rows)
-
-/*+SeqScan("Set")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set" WHERE "Set".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(Set)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------
- Seq Scan on t1 "Set"
- Filter: (c1 = 1)
-(2 rows)
-
-/*+SeqScan("Set SeqScan Leading")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set SeqScan Leading" WHERE "Set SeqScan Leading".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan("Set SeqScan Leading")
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------
- Seq Scan on t1 "Set SeqScan Leading"
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-3-10
--- No. A-9-2-10
-/*+SeqScan(あ)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 あ WHERE あ.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(あ)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------
- Seq Scan on t1 "あ"
- Filter: (c1 = 1)
-(2 rows)
-
-/*+SeqScan(あいう)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 あいう WHERE あいう.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(あいう)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------
- Seq Scan on t1 "あいう"
- Filter: (c1 = 1)
-(2 rows)
-
-/*+SeqScan("あ")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 あ WHERE あ.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(あ)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------
- Seq Scan on t1 "あ"
- Filter: (c1 = 1)
-(2 rows)
-
-/*+SeqScan("あいう")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 あいう WHERE あいう.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(あいう)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------
- Seq Scan on t1 "あいう"
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-7-3-11
--- No. A-9-2-11
-/*+SeqScan(/**/)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**/" WHERE "/**/".c1 = 1;
-INFO: hint syntax error at or near "/**/)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**/" WHERE "/**/".c1 = 1;"
-DETAIL: Nested block comments are not supported.
- QUERY PLAN
--------------------------------------
- Index Scan using t1_i1 on t1 "/**/"
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+SeqScan(/**//**//**/)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**//**//**/" WHERE "/**//**//**/".c1 = 1;
-INFO: hint syntax error at or near "/**//**//**/)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**//**//**/" WHERE "/**//**//**/".c1 = 1;"
-DETAIL: Nested block comments are not supported.
- QUERY PLAN
----------------------------------------------
- Index Scan using t1_i1 on t1 "/**//**//**/"
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. A-7-3-12
--- No. A-9-2-12
-/*+SeqScan("tT()""
-Set/**/あ")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""
-Set/**/あ" WHERE "tT()""
-Set/**/あ".c1 = 1;
-INFO: hint syntax error at or near "/**/あ")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""
-Set/**/あ" WHERE "tT()""
-Set/**/あ".c1 = 1;"
-DETAIL: Nested block comments are not supported.
- QUERY PLAN
-------------------------------------------
- Index Scan using t1_i1 on t1 "tT()""
- Set/**/あ"
- Index Cond: (c1 = 1)
-(3 rows)
-
---"
-/*+SeqScan("tT()""
-Setあ")*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""
-Setあ" WHERE "tT()""
-Setあ".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan("tT()""
-Setあ")
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------
- Seq Scan on t1 "tT()""
- Setあ"
- Filter: (c1 = 1)
-(3 rows)
-
--- No. A-7-3-13
--- No. A-9-2-13
-/*+SeqScan(a123456789b123456789c123456789d123456789e123456789f123)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 "123456789012345678901234567890123456789012345678901234" WHERE "123456789012345678901234567890123456789012345678901234".c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(a123456789b123456789c123456789d123456789e123456789f123)
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------------------------
- Index Scan using t1_i1 on t1 "123456789012345678901234567890123456789012345678901234"
- Index Cond: (c1 = 1)
-(2 rows)
-
-----
----- No. A-7-4 hint parse error
-----
--- No. A-7-4-1
-/*+Set(enable_indexscan off)Set enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO: hint syntax error at or near "enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
-DETAIL: Opening parenthesis is necessary.
-LOG: pg_hint_plan:
-used hint:
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
-(4 rows)
-
--- No. A-7-4-2
-/*+Set(enable_indexscan off)Set(enable_tidscan off Set(enable_bitmapscan off)SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO: hint syntax error at or near "(enable_bitmapscan off)SeqScan(t1)"
-DETAIL: Zero-length delimited string.
-LOG: pg_hint_plan:
-used hint:
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
-(4 rows)
-
--- No. A-7-4-3
-/*+Set(enable_indexscan off)Set(enable_tidscan "off)Set(enable_bitmapscan off)SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO: hint syntax error at or near ""
-DETAIL: Unterminated quoted string.
-LOG: pg_hint_plan:
-used hint:
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
-(4 rows)
-
--- No. A-7-4-4
-/*+Set(enable_indexscan off)SeqScan("")Set(enable_bitmapscan off)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO: hint syntax error at or near ")Set(enable_bitmapscan off)"
-DETAIL: Zero-length delimited string.
-LOG: pg_hint_plan:
-used hint:
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
-(4 rows)
-
--- No. A-7-4-5
-/*+Set(enable_indexscan off)NoSet(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO: hint syntax error at or near "NoSet(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
-DETAIL: Unrecognized hint keyword "NoSet".
-LOG: pg_hint_plan:
-used hint:
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
-(4 rows)
-
--- No. A-7-4-6
-/*+Set(enable_indexscan off)"Set"(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO: hint syntax error at or near ""Set"(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
-DETAIL: Unrecognized hint keyword ""Set"".
-LOG: pg_hint_plan:
-used hint:
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
-(4 rows)
-
--- No. A-7-4-7
-/*+Set(enable_indexscan off)Set(enable_tidscan /* value */off)Set(enable_bitmapscan off)SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO: hint syntax error at or near "/* value */off)Set(enable_bitmapscan off)SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;"
-DETAIL: Nested block comments are not supported.
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-----
----- No. A-8-1 original GUC parameter
-----
--- No. A-8-1-1
-SET ROLE super_user;
-SET pg_hint_plan.debug_print TO off;
-SHOW pg_hint_plan.enable_hint;
- pg_hint_plan.enable_hint
---------------------------
- on
-(1 row)
-
-SHOW pg_hint_plan.debug_print;
- pg_hint_plan.debug_print
---------------------------
- off
-(1 row)
-
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- info
-(1 row)
-
-SET pg_hint_plan.enable_hint TO off;
-SET pg_hint_plan.debug_print TO on;
-SET pg_hint_plan.parse_messages TO error;
-SHOW pg_hint_plan.enable_hint;
- pg_hint_plan.enable_hint
---------------------------
- off
-(1 row)
-
-SHOW pg_hint_plan.debug_print;
- pg_hint_plan.debug_print
---------------------------
- on
-(1 row)
-
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- error
-(1 row)
-
-RESET pg_hint_plan.enable_hint;
-RESET pg_hint_plan.debug_print;
-RESET pg_hint_plan.parse_messages;
-SHOW pg_hint_plan.enable_hint;
- pg_hint_plan.enable_hint
---------------------------
- on
-(1 row)
-
-SHOW pg_hint_plan.debug_print;
- pg_hint_plan.debug_print
---------------------------
- off
-(1 row)
-
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- info
-(1 row)
-
--- No. A-8-1-2
-SET ROLE normal_user;
-SHOW pg_hint_plan.enable_hint;
- pg_hint_plan.enable_hint
---------------------------
- on
-(1 row)
-
-SHOW pg_hint_plan.debug_print;
- pg_hint_plan.debug_print
---------------------------
- off
-(1 row)
-
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- info
-(1 row)
-
-SET pg_hint_plan.enable_hint TO off;
-SET pg_hint_plan.debug_print TO on;
-SET pg_hint_plan.parse_messages TO error;
-SHOW pg_hint_plan.enable_hint;
- pg_hint_plan.enable_hint
---------------------------
- off
-(1 row)
-
-SHOW pg_hint_plan.debug_print;
- pg_hint_plan.debug_print
---------------------------
- on
-(1 row)
-
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- error
-(1 row)
-
-RESET pg_hint_plan.enable_hint;
-RESET pg_hint_plan.debug_print;
-RESET pg_hint_plan.parse_messages;
-SHOW pg_hint_plan.enable_hint;
- pg_hint_plan.enable_hint
---------------------------
- on
-(1 row)
-
-SHOW pg_hint_plan.debug_print;
- pg_hint_plan.debug_print
---------------------------
- off
-(1 row)
-
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- info
-(1 row)
-
-RESET ROLE;
-----
----- No. A-8-2 original GUC parameter pg_hint_plan.enable_hint
-----
--- No. A-8-2-1
-SET pg_hint_plan.enable_hint TO on;
-SHOW pg_hint_plan.enable_hint;
- pg_hint_plan.enable_hint
---------------------------
- on
-(1 row)
-
-/*+Set(enable_indexscan off)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
-(4 rows)
-
--- No. A-8-2-2
-SET pg_hint_plan.enable_hint TO off;
-SHOW pg_hint_plan.enable_hint;
- pg_hint_plan.enable_hint
---------------------------
- off
-(1 row)
-
-/*+Set(enable_indexscan off)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. A-8-2-3
-SET pg_hint_plan.enable_hint TO DEFAULT;
-SHOW pg_hint_plan.enable_hint;
- pg_hint_plan.enable_hint
---------------------------
- on
-(1 row)
-
-/*+Set(enable_indexscan off)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
-(4 rows)
-
--- No. A-8-2-4
-SET pg_hint_plan.enable_hint TO enable;
-ERROR: parameter "pg_hint_plan.enable_hint" requires a Boolean value
-SHOW pg_hint_plan.enable_hint;
- pg_hint_plan.enable_hint
---------------------------
- on
-(1 row)
-
-----
----- No. A-8-3 original GUC parameter pg_hint_plan.debug_print
-----
--- No. A-8-3-1
-SET pg_hint_plan.debug_print TO on;
-SHOW pg_hint_plan.debug_print;
- pg_hint_plan.debug_print
---------------------------
- on
-(1 row)
-
-/*+Set(enable_indexscan off)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
-(4 rows)
-
--- No. A-8-3-2
-SET pg_hint_plan.debug_print TO off;
-SHOW pg_hint_plan.debug_print;
- pg_hint_plan.debug_print
---------------------------
- off
-(1 row)
-
-/*+Set(enable_indexscan off)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
-(4 rows)
-
--- No. A-8-3-3
-SET pg_hint_plan.debug_print TO DEFAULT;
-SHOW pg_hint_plan.debug_print;
- pg_hint_plan.debug_print
---------------------------
- off
-(1 row)
-
-/*+Set(enable_indexscan off)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
-(4 rows)
-
--- No. A-8-3-4
-SET pg_hint_plan.debug_print TO enable;
-ERROR: parameter "pg_hint_plan.debug_print" requires a Boolean value
-SHOW pg_hint_plan.debug_print;
- pg_hint_plan.debug_print
---------------------------
- off
-(1 row)
-
-----
----- No. A-8-4 original GUC parameter pg_hint_plan.parse_messages
-----
-SET client_min_messages TO debug5;
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
--- No. A-8-4-1
-SET pg_hint_plan.parse_messages TO debug5;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-SHOW pg_hint_plan.parse_messages;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
- pg_hint_plan.parse_messages
------------------------------
- debug5
-(1 row)
-
-/*+Set*/SELECT 1;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: hint syntax error at or near ""
-DETAIL: Opening parenthesis is necessary.
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
- ?column?
-----------
- 1
-(1 row)
-
-SET client_min_messages TO debug4;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-/*+Set*/SELECT 1;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
- ?column?
-----------
- 1
-(1 row)
-
--- No. A-8-4-2
-SET pg_hint_plan.parse_messages TO debug4;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-SHOW pg_hint_plan.parse_messages;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
- pg_hint_plan.parse_messages
------------------------------
- debug4
-(1 row)
-
-/*+Set*/SELECT 1;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: hint syntax error at or near ""
-DETAIL: Opening parenthesis is necessary.
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
- ?column?
-----------
- 1
-(1 row)
-
-SET client_min_messages TO debug3;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-/*+Set*/SELECT 1;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
- ?column?
-----------
- 1
-(1 row)
-
--- No. A-8-4-3
-SET pg_hint_plan.parse_messages TO debug3;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-SHOW pg_hint_plan.parse_messages;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
- pg_hint_plan.parse_messages
------------------------------
- debug3
-(1 row)
-
-/*+Set*/SELECT 1;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: hint syntax error at or near ""
-DETAIL: Opening parenthesis is necessary.
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
- ?column?
-----------
- 1
-(1 row)
-
-SET client_min_messages TO debug2;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
-/*+Set*/SELECT 1;
- ?column?
-----------
- 1
-(1 row)
-
--- No. A-8-4-4
-SET pg_hint_plan.parse_messages TO debug2;
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- debug
-(1 row)
-
-/*+Set*/SELECT 1;
-DEBUG: hint syntax error at or near ""
-DETAIL: Opening parenthesis is necessary.
- ?column?
-----------
- 1
-(1 row)
-
-SET client_min_messages TO debug1;
-/*+Set*/SELECT 1;
- ?column?
-----------
- 1
-(1 row)
-
--- No. A-8-4-5
-SET pg_hint_plan.parse_messages TO debug1;
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- debug1
-(1 row)
-
-/*+Set*/SELECT 1;
-DEBUG: hint syntax error at or near ""
-DETAIL: Opening parenthesis is necessary.
- ?column?
-----------
- 1
-(1 row)
-
-SET client_min_messages TO log;
-/*+Set*/SELECT 1;
- ?column?
-----------
- 1
-(1 row)
-
--- No. A-8-4-6
-SET pg_hint_plan.parse_messages TO log;
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- log
-(1 row)
-
-/*+Set*/SELECT 1;
-LOG: hint syntax error at or near ""
-DETAIL: Opening parenthesis is necessary.
- ?column?
-----------
- 1
-(1 row)
-
-SET client_min_messages TO info;
-/*+Set*/SELECT 1;
- ?column?
-----------
- 1
-(1 row)
-
--- No. A-8-4-7
-SET pg_hint_plan.parse_messages TO info;
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- info
-(1 row)
-
-/*+Set*/SELECT 1;
-INFO: hint syntax error at or near ""
-DETAIL: Opening parenthesis is necessary.
- ?column?
-----------
- 1
-(1 row)
-
-SET client_min_messages TO notice;
-/*+Set*/SELECT 1;
-INFO: hint syntax error at or near ""
-DETAIL: Opening parenthesis is necessary.
- ?column?
-----------
- 1
-(1 row)
-
--- No. A-8-4-8
-SET pg_hint_plan.parse_messages TO notice;
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- notice
-(1 row)
-
-/*+Set*/SELECT 1;
-NOTICE: hint syntax error at or near ""
-DETAIL: Opening parenthesis is necessary.
- ?column?
-----------
- 1
-(1 row)
-
-SET client_min_messages TO warning;
-/*+Set*/SELECT 1;
- ?column?
-----------
- 1
-(1 row)
-
--- No. A-8-4-9
-SET pg_hint_plan.parse_messages TO warning;
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- warning
-(1 row)
-
-/*+Set*/SELECT 1;
-WARNING: hint syntax error at or near ""
-DETAIL: Opening parenthesis is necessary.
- ?column?
-----------
- 1
-(1 row)
-
-SET client_min_messages TO error;
-/*+Set*/SELECT 1;
- ?column?
-----------
- 1
-(1 row)
-
--- No. A-8-4-10
-SET pg_hint_plan.parse_messages TO error;
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- error
-(1 row)
-
-/*+Set*/SELECT 1;
-ERROR: hint syntax error at or near ""
-DETAIL: Opening parenthesis is necessary.
-SET client_min_messages TO fatal;
-/*+Set*/SELECT 1;
--- No. A-8-4-11
-RESET client_min_messages;
-SET pg_hint_plan.parse_messages TO DEFAULT;
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- info
-(1 row)
-
-/*+Set*/SELECT 1;
-INFO: hint syntax error at or near ""
-DETAIL: Opening parenthesis is necessary.
- ?column?
-----------
- 1
-(1 row)
-
--- No. A-8-4-12
-SET pg_hint_plan.parse_messages TO fatal;
-ERROR: invalid value for parameter "pg_hint_plan.parse_messages": "fatal"
-HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- info
-(1 row)
-
--- No. A-8-4-13
-SET pg_hint_plan.parse_messages TO panic;
-ERROR: invalid value for parameter "pg_hint_plan.parse_messages": "panic"
-HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- info
-(1 row)
-
--- No. A-8-4-14
-SET pg_hint_plan.parse_messages TO on;
-ERROR: invalid value for parameter "pg_hint_plan.parse_messages": "on"
-HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- info
-(1 row)
-
-----
----- No. A-8-5 original GUC parameter pg_hint_plan.enable_hint_table
-----
-INSERT INTO hint_plan.hints (norm_query_string, application_name, hints)
- VALUES (
- 'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ?;',
- '',
- 'SeqScan(t1)');
--- No. A-8-5-1
-SET pg_hint_plan.enable_hint_table TO on;
-SHOW pg_hint_plan.enable_hint_table;
- pg_hint_plan.enable_hint_table
---------------------------------
- on
-(1 row)
-
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-8-5-2
-SET pg_hint_plan.enable_hint_table TO off;
-SHOW pg_hint_plan.enable_hint_table;
- pg_hint_plan.enable_hint_table
---------------------------------
- off
-(1 row)
-
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. A-8-5-3
-SET pg_hint_plan.enable_hint_table TO DEFAULT;
-SHOW pg_hint_plan.enable_hint_table;
- pg_hint_plan.enable_hint_table
---------------------------------
- off
-(1 row)
-
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. A-8-5-4
-SET pg_hint_plan.enable_hint_table TO enable;
-ERROR: parameter "pg_hint_plan.enable_hint_table" requires a Boolean value
-SHOW pg_hint_plan.enable_hint_table;
- pg_hint_plan.enable_hint_table
---------------------------------
- off
-(1 row)
-
-TRUNCATE hint_plan.hints;
-----
----- No. A-9-1 parse error message output
-----
--- No. A-9-1-1
-/*+"Set"(enable_indexscan on)*/SELECT 1;
-INFO: hint syntax error at or near ""Set"(enable_indexscan on)"
-DETAIL: Unrecognized hint keyword ""Set"".
- ?column?
-----------
- 1
-(1 row)
-
-/*+Set()(enable_indexscan on)*/SELECT 1;
-INFO: hint syntax error at or near "Set()(enable_indexscan on)"
-DETAIL: Set hint requires name and value of GUC parameter.
-INFO: hint syntax error at or near "(enable_indexscan on)"
-DETAIL: Unrecognized hint keyword "".
- ?column?
-----------
- 1
-(1 row)
-
-/*+Set(enable_indexscan on*/SELECT 1;
-INFO: hint syntax error at or near ""
-DETAIL: Closing parenthesis is necessary.
- ?column?
-----------
- 1
-(1 row)
-
-----
----- No. A-9-3 hint state output
-----
-SET pg_hint_plan.debug_print TO on;
-SET client_min_messages TO LOG;
--- No. A-9-3-1
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. A-9-3-2
-/*+SeqScan(no_table)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(no_table)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. A-9-3-3
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
- QUERY PLAN
------------------------------------
- Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
-/*+TidScan(t1)BitmapScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
-INFO: hint syntax error at or near "TidScan(t1)BitmapScan(t1)"
-DETAIL: Conflict scan method hint.
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-TidScan(t1)
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
-(5 rows)
-
-/*+TidScan(t1)BitmapScan(t1)IndexScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
-INFO: hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)"
-DETAIL: Conflict scan method hint.
-INFO: hint syntax error at or near "BitmapScan(t1)IndexScan(t1)"
-DETAIL: Conflict scan method hint.
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t1)
-not used hint:
-duplication hint:
-TidScan(t1)
-BitmapScan(t1)
-error hint:
-
- QUERY PLAN
----------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
- Filter: (ctid = '(1,1)'::tid)
-(3 rows)
-
-/*+TidScan(t1)BitmapScan(t1)IndexScan(t1)SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
-INFO: hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
-DETAIL: Conflict scan method hint.
-INFO: hint syntax error at or near "BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
-DETAIL: Conflict scan method hint.
-INFO: hint syntax error at or near "IndexScan(t1)SeqScan(t1)"
-DETAIL: Conflict scan method hint.
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-TidScan(t1)
-BitmapScan(t1)
-IndexScan(t1)
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Seq Scan on t1
- Filter: ((c1 = 1) AND (ctid = '(1,1)'::tid))
-(2 rows)
-
--- No. A-9-3-4
-/*+Set(enable_indexscan enable)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO: parameter "enable_indexscan" requires a Boolean value
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Set(enable_indexscan enable)
-
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-----
----- No. A-10-1 hint state output
-----
-PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-EXPLAIN (COSTS false) EXECUTE p1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-DEALLOCATE p1;
-PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
------------------------
- Seq Scan on t1
- Filter: (c1 < 1000)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
------------------------
- Seq Scan on t1
- Filter: (c1 < 1000)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
------------------------
- Seq Scan on t1
- Filter: (c1 < 1000)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
------------------------
- Seq Scan on t1
- Filter: (c1 < 1000)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
------------------------
- Seq Scan on t1
- Filter: (c1 < 1000)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 < $1)
-(2 rows)
-
-DEALLOCATE p1;
--- No. A-10-1-1
--- No. A-10-1-2
-/*+SeqScan(t1)*/
-PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
-UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
-DEALLOCATE p1;
-/*+BitmapScan(t1)*/
-PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-DEALLOCATE p1;
--- No. A-10-1-3
--- No. A-10-1-4
-/*+SeqScan(t1)*/
-PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-EXPLAIN (COSTS false) EXECUTE p1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
-UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
-EXPLAIN (COSTS false) EXECUTE p1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
-DEALLOCATE p1;
-/*+BitmapScan(t1)*/
-PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-DEALLOCATE p1;
--- No. A-10-1-5
--- No. A-10-1-6
-PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-DEALLOCATE p1;
-PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
------------------------
- Seq Scan on t1
- Filter: (c1 < 1000)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
------------------------
- Seq Scan on t1
- Filter: (c1 < 1000)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
------------------------
- Seq Scan on t1
- Filter: (c1 < 1000)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
------------------------
- Seq Scan on t1
- Filter: (c1 < 1000)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
------------------------
- Seq Scan on t1
- Filter: (c1 < 1000)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 < $1)
-(2 rows)
-
-UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 < $1)
-(2 rows)
-
-DEALLOCATE p1;
--- No. A-10-1-9
--- No. A-10-1-10
-/*+SeqScan(t1)*/
-PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
-UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
-DEALLOCATE p1;
-/*+BitmapScan(t1)*/
-PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-DEALLOCATE p1;
--- No. A-10-1-11
--- No. A-10-1-12
-/*+SeqScan(t1)*/
-PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
-UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
-DEALLOCATE p1;
-/*+BitmapScan(t1)*/
-PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < 1000)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < 1000)
-(4 rows)
-
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-DEALLOCATE p1;
--- No. A-10-1-13
--- No. A-10-1-14
-PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-DEALLOCATE p1;
-PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
------------------------
- Seq Scan on t1
- Filter: (c1 < 1000)
-(2 rows)
-
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
------------------------
- Seq Scan on t1
- Filter: (c1 < 1000)
-(2 rows)
-
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
------------------------
- Seq Scan on t1
- Filter: (c1 < 1000)
-(2 rows)
-
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
------------------------
- Seq Scan on t1
- Filter: (c1 < 1000)
-(2 rows)
-
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
------------------------
- Seq Scan on t1
- Filter: (c1 < 1000)
-(2 rows)
-
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 < $1)
-(2 rows)
-
-UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 < $1)
-(2 rows)
-
-DEALLOCATE p1;
-----
----- No. A-10-4 EXECUTE statement name error
-----
--- No. A-10-4-1
-EXECUTE p1;
-ERROR: prepared statement "p1" does not exist
-SHOW pg_hint_plan.debug_print;
- pg_hint_plan.debug_print
---------------------------
- on
-(1 row)
-
-----
----- No. A-11-5 EXECUTE statement name error
-----
--- No. A-11-5-1
-SELECT pg_stat_statements_reset();
- pg_stat_statements_reset
---------------------------
-
-(1 row)
-
-SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- c1 | c2 | c3 | c4
-----+----+----+----
- 1 | 1 | 1 | 1
-(1 row)
-
-/*+Set(enable_seqscan off)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-Set(enable_seqscan off)
-not used hint:
-duplication hint:
-error hint:
-
- c1 | c2 | c3 | c4
-----+----+----+----
- 1 | 1 | 1 | 1
-(1 row)
-
-/*+SeqScan(t1)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- c1 | c2 | c3 | c4
-----+----+----+----
- 1 | 1 | 1 | 1
-(1 row)
-
-SELECT s.query, s.calls
- FROM public.pg_stat_statements s
- JOIN pg_catalog.pg_database d
- ON (s.dbid = d.oid)
- ORDER BY 1;
- query | calls
---------------------------------------+-------
- SELECT * FROM s1.t1 WHERE t1.c1 = ?; | 3
- SELECT pg_stat_statements_reset(); | 1
-(2 rows)
-
-----
----- No. A-12-1 reset of global variable of core at the error
----- No. A-12-2 reset of global variable of original at the error
-----
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(6 rows)
-
-/*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
-PREPARE p1 AS SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-EXPLAIN (COSTS false) EXECUTE p1;
-INFO: hint syntax error at or near "NestLoop(t1 t1)"
-DETAIL: Relation name "t1" is duplicated.
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-MergeJoin(t1 t2)
-Set(enable_seqscan off)
-Set(geqo_threshold 100)
-not used hint:
-duplication hint:
-error hint:
-NestLoop(t1 t1)
-
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Sort
- Sort Key: t1.c1
- -> Seq Scan on t1
- -> Index Scan using t2_i1 on t2
-(6 rows)
-
--- No. A-12-1-1
--- No. A-12-2-1
-SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
-
-SET pg_hint_plan.parse_messages TO error;
-/*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-ERROR: hint syntax error at or near "NestLoop(t1 t1)"
-DETAIL: Relation name "t1" is duplicated.
-SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
-
-/*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-MergeJoin(t1 t2)
-Set(enable_seqscan off)
-Set(geqo_threshold 100)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Sort
- Sort Key: t1.c1
- -> Seq Scan on t1
- -> Index Scan using t2_i1 on t2
-(6 rows)
-
--- No. A-12-1-2
--- No. A-12-2-2
-SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
-
-SET pg_hint_plan.parse_messages TO error;
-/*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-ERROR: hint syntax error at or near "NestLoop(t1 t1)"
-DETAIL: Relation name "t1" is duplicated.
-SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1;
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Sort
- Sort Key: t1.c1
- -> Seq Scan on t1
- -> Index Scan using t2_i1 on t2
-(6 rows)
-
--- No. A-12-1-3
--- No. A-12-2-3
-SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
-
-SET pg_hint_plan.parse_messages TO error;
-EXPLAIN (COSTS false) EXECUTE p2;
-ERROR: prepared statement "p2" does not exist
-/*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-MergeJoin(t1 t2)
-Set(enable_seqscan off)
-Set(geqo_threshold 100)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Sort
- Sort Key: t1.c1
- -> Seq Scan on t1
- -> Index Scan using t2_i1 on t2
-(6 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1;
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Sort
- Sort Key: t1.c1
- -> Seq Scan on t1
- -> Index Scan using t2_i1 on t2
-(6 rows)
-
-SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
-
--- No. A-12-1-4
--- No. A-12-2-4
-SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
-
-SET pg_hint_plan.parse_messages TO error;
-EXPLAIN (COSTS false) EXECUTE p2;
-ERROR: prepared statement "p2" does not exist
-EXPLAIN (COSTS false) EXECUTE p1;
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Sort
- Sort Key: t1.c1
- -> Seq Scan on t1
- -> Index Scan using t2_i1 on t2
-(6 rows)
-
-SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
-
-DEALLOCATE p1;
-SET pg_hint_plan.parse_messages TO LOG;
-----
----- No. A-12-3 effective range of the hint
-----
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(6 rows)
-
--- No. A-12-3-1
-SET enable_indexscan TO off;
-SET enable_mergejoin TO off;
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
-
-/*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t2)
-MergeJoin(t1 t2)
-Leading(t2 t1)
-Set(enable_indexscan on)
-Set(geqo_threshold 100)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t2_i1 on t2
-(4 rows)
-
-SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
--- No. A-12-3-2
-SET enable_indexscan TO off;
-SET enable_mergejoin TO off;
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
-
-BEGIN;
-/*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t2)
-MergeJoin(t1 t2)
-Leading(t2 t1)
-Set(enable_indexscan on)
-Set(geqo_threshold 100)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t2_i1 on t2
-(4 rows)
-
-COMMIT;
-BEGIN;
-SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-COMMIT;
--- No. A-12-3-3
-SET enable_indexscan TO off;
-SET enable_mergejoin TO off;
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
-
-/*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t2)
-MergeJoin(t1 t2)
-Leading(t2 t1)
-Set(enable_indexscan on)
-Set(geqo_threshold 100)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t2_i1 on t2
-(4 rows)
-
-\connect
-SET enable_indexscan TO off;
-SET enable_mergejoin TO off;
-LOAD 'pg_hint_plan';
-SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | notice
-(30 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-SET pg_hint_plan.enable_hint TO on;
-SET pg_hint_plan.debug_print TO on;
-SET client_min_messages TO LOG;
-SET search_path TO public;
-RESET enable_indexscan;
-RESET enable_mergejoin;
-----
----- No. A-13 call planner recursively
-----
-CREATE OR REPLACE FUNCTION nested_planner(cnt int) RETURNS int AS $$
-DECLARE
- new_cnt int;
-BEGIN
- RAISE NOTICE 'nested_planner(%)', cnt;
-
- /* 再帰終了の判断 */
- IF cnt <= 1 THEN
- RETURN 0;
- END IF;
-
- SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) INTO new_cnt
- FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1;
-
- RETURN new_cnt;
-END;
-$$ LANGUAGE plpgsql IMMUTABLE;
-----
----- No. A-13-2 use hint of main query
-----
---No.13-2-1
-EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
-NOTICE: nested_planner(1)
- QUERY PLAN
----------------------------------------
- Index Only Scan using t1_i1 on t1 t_1
-(1 row)
-
-/*+SeqScan(t_1)*/
-EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
-NOTICE: nested_planner(1)
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t_1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------
- Sort
- Sort Key: c1
- -> Seq Scan on t1 t_1
-(3 rows)
-
-----
----- No. A-13-3 output number of times of debugging log
-----
---No.13-3-1
-EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
-NOTICE: nested_planner(1)
- QUERY PLAN
----------------------------------------
- Index Only Scan using t1_i1 on t1 t_1
-(1 row)
-
-/*+SeqScan(t_2)*/
-EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
-NOTICE: nested_planner(1)
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(t_2)
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Index Only Scan using t1_i1 on t1 t_1
-(1 row)
-
---No.13-3-2
-EXPLAIN (COSTS false) SELECT nested_planner(2) FROM s1.t1 t_1 ORDER BY t_1.c1;
-NOTICE: nested_planner(2)
-NOTICE: nested_planner(1)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t_1)
-not used hint:
-duplication hint:
-error hint:
-
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
- QUERY PLAN
----------------------------------------
- Index Only Scan using t1_i1 on t1 t_1
-(1 row)
-
-/*+SeqScan(t_2)*/
-EXPLAIN (COSTS false) SELECT nested_planner(2) FROM s1.t1 t_1 ORDER BY t_1.c1;
-NOTICE: nested_planner(2)
-NOTICE: nested_planner(1)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t_1)
-not used hint:
-duplication hint:
-error hint:
-
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(t_2)
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Index Only Scan using t1_i1 on t1 t_1
-(1 row)
-
---No.13-3-3
-EXPLAIN (COSTS false) SELECT nested_planner(5) FROM s1.t1 t_1 ORDER BY t_1.c1;
-NOTICE: nested_planner(5)
-NOTICE: nested_planner(4)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-NOTICE: nested_planner(3)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-NOTICE: nested_planner(2)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-NOTICE: nested_planner(1)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t_1)
-not used hint:
-duplication hint:
-error hint:
-
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t_1)
-not used hint:
-duplication hint:
-error hint:
-
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t_1)
-not used hint:
-duplication hint:
-error hint:
-
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t_1)
-not used hint:
-duplication hint:
-error hint:
-
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
- QUERY PLAN
----------------------------------------
- Index Only Scan using t1_i1 on t1 t_1
-(1 row)
-
-/*+SeqScan(t_2)*/
-EXPLAIN (COSTS false) SELECT nested_planner(5) FROM s1.t1 t_1 ORDER BY t_1.c1;
-NOTICE: nested_planner(5)
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t_1)
-not used hint:
-duplication hint:
-error hint:
-
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-NOTICE: nested_planner(4)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-NOTICE: nested_planner(3)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-NOTICE: nested_planner(2)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-NOTICE: nested_planner(1)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t_1)
-not used hint:
-duplication hint:
-error hint:
-
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t_1)
-not used hint:
-duplication hint:
-error hint:
-
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t_1)
-not used hint:
-duplication hint:
-error hint:
-
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t_1)
-not used hint:
-duplication hint:
-error hint:
-
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(t_2)
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Index Only Scan using t1_i1 on t1 t_1
-(1 row)
-
-----
----- No. A-13-4 output of debugging log on hint status
-----
-CREATE OR REPLACE FUNCTION recall_planner() RETURNS int AS $$
- SELECT /*+ IndexScan(t_1) */t_1.c1
- FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1;
-$$ LANGUAGE SQL IMMUTABLE;
---No.13-4-1
-/*+HashJoin(t_1 t_2)*/
-EXPLAIN (COSTS false)
- SELECT recall_planner() FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t_1 t_2)
-not used hint:
-duplication hint:
-error hint:
-
-CONTEXT: SQL function "recall_planner" during startup
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t_1 t_2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------
- Sort
- Sort Key: t_1.c1
- -> Hash Join
- Hash Cond: (t_1.c1 = t_2.c1)
- -> Seq Scan on t1 t_1
- -> Hash
- -> Seq Scan on t2 t_2
-(7 rows)
-
---No.13-4-2
-/*+HashJoin(st_1 st_2)*/
-EXPLAIN (COSTS false)
- SELECT recall_planner() FROM s1.t1 st_1
- JOIN s1.t2 st_2 ON (st_1.c1 = st_2.c1)
- ORDER BY st_1.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-HashJoin(st_1 st_2)
-duplication hint:
-error hint:
-
-CONTEXT: SQL function "recall_planner" during startup
-LOG: pg_hint_plan:
-used hint:
-HashJoin(st_1 st_2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------
- Sort
- Sort Key: st_1.c1
- -> Hash Join
- Hash Cond: (st_1.c1 = st_2.c1)
- -> Seq Scan on t1 st_1
- -> Hash
- -> Seq Scan on t2 st_2
-(7 rows)
-
---No.13-4-3
-/*+HashJoin(t_1 t_2)*/
-EXPLAIN (COSTS false)
- SELECT recall_planner() FROM s1.t1 st_1
- JOIN s1.t2 st_2 ON (st_1.c1 = st_2.c1)
- ORDER BY st_1.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t_1 t_2)
-not used hint:
-duplication hint:
-error hint:
-
-CONTEXT: SQL function "recall_planner" during startup
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-HashJoin(t_1 t_2)
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------
- Merge Join
- Merge Cond: (st_1.c1 = st_2.c1)
- -> Index Only Scan using t1_i1 on t1 st_1
- -> Sort
- Sort Key: st_2.c1
- -> Seq Scan on t2 st_2
-(6 rows)
-
---No.13-4-4
-/*+HashJoin(st_1 st_2)*/
-EXPLAIN (COSTS false)
- SELECT recall_planner() FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-HashJoin(st_1 st_2)
-duplication hint:
-error hint:
-
-CONTEXT: SQL function "recall_planner" during startup
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-HashJoin(st_1 st_2)
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------
- Merge Join
- Merge Cond: (t_1.c1 = t_2.c1)
- -> Index Only Scan using t1_i1 on t1 t_1
- -> Sort
- Sort Key: t_2.c1
- -> Seq Scan on t2 t_2
-(6 rows)
-
---No.13-4-5
-/*+HashJoin(t_1 t_1)*/
-EXPLAIN (COSTS false)
- SELECT recall_planner() FROM s1.t1 t_1
- ORDER BY t_1.c1;
-INFO: hint syntax error at or near "HashJoin(t_1 t_1)"
-DETAIL: Relation name "t_1" is duplicated.
-CONTEXT: SQL function "recall_planner" during startup
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-HashJoin(t_1 t_1)
-
-CONTEXT: SQL function "recall_planner" during startup
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-HashJoin(t_1 t_1)
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Index Only Scan using t1_i1 on t1 t_1
-(1 row)
-
---No.13-4-6
-CREATE OR REPLACE FUNCTION recall_planner_one_t() RETURNS int AS $$
- SELECT /*+ IndexScan(t_1) */t_1.c1
- FROM s1.t1 t_1
- ORDER BY t_1.c1 LIMIT 1;
-$$ LANGUAGE SQL IMMUTABLE;
-EXPLAIN (COSTS false)
- SELECT recall_planner_one_t() FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1;
- QUERY PLAN
----------------------------------------------
- Merge Join
- Merge Cond: (t_1.c1 = t_2.c1)
- -> Index Only Scan using t1_i1 on t1 t_1
- -> Sort
- Sort Key: t_2.c1
- -> Seq Scan on t2 t_2
-(6 rows)
-
-/*+HashJoin(t_1 t_1)*/
-EXPLAIN (COSTS false)
- SELECT recall_planner_one_t() FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-HashJoin(t_1 t_1)
-duplication hint:
-error hint:
-
-CONTEXT: SQL function "recall_planner_one_t" during startup
-INFO: hint syntax error at or near "HashJoin(t_1 t_1)"
-DETAIL: Relation name "t_1" is duplicated.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-HashJoin(t_1 t_1)
-
- QUERY PLAN
----------------------------------------------
- Merge Join
- Merge Cond: (t_1.c1 = t_2.c1)
- -> Index Only Scan using t1_i1 on t1 t_1
- -> Sort
- Sort Key: t_2.c1
- -> Seq Scan on t2 t_2
-(6 rows)
-
-DROP FUNCTION recall_planner_one_t(int);
-ERROR: function recall_planner_one_t(integer) does not exist
---No.13-4-7
-/*+HashJoin(t_1 t_1)*/
-EXPLAIN (COSTS false)
- SELECT recall_planner() FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1;
-INFO: hint syntax error at or near "HashJoin(t_1 t_1)"
-DETAIL: Relation name "t_1" is duplicated.
-CONTEXT: SQL function "recall_planner" during startup
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-HashJoin(t_1 t_1)
-
-CONTEXT: SQL function "recall_planner" during startup
-INFO: hint syntax error at or near "HashJoin(t_1 t_1)"
-DETAIL: Relation name "t_1" is duplicated.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-HashJoin(t_1 t_1)
-
- QUERY PLAN
----------------------------------------------
- Merge Join
- Merge Cond: (t_1.c1 = t_2.c1)
- -> Index Only Scan using t1_i1 on t1 t_1
- -> Sort
- Sort Key: t_2.c1
- -> Seq Scan on t2 t_2
-(6 rows)
-
---No.13-4-8
-/*+MergeJoin(t_1 t_2)HashJoin(t_1 t_2)*/
-EXPLAIN (COSTS false)
- SELECT recall_planner() FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1;
-INFO: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
-DETAIL: Conflict join method hint.
-INFO: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
-DETAIL: Conflict join method hint.
-CONTEXT: SQL function "recall_planner" during startup
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t_1 t_2)
-not used hint:
-duplication hint:
-MergeJoin(t_1 t_2)
-error hint:
-
-CONTEXT: SQL function "recall_planner" during startup
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t_1 t_2)
-not used hint:
-duplication hint:
-MergeJoin(t_1 t_2)
-error hint:
-
- QUERY PLAN
---------------------------------------
- Sort
- Sort Key: t_1.c1
- -> Hash Join
- Hash Cond: (t_1.c1 = t_2.c1)
- -> Seq Scan on t1 t_1
- -> Hash
- -> Seq Scan on t2 t_2
-(7 rows)
-
+++ /dev/null
-LOAD 'pg_hint_plan';
-SET pg_hint_plan.enable_hint TO on;
-SET pg_hint_plan.debug_print TO on;
-SET client_min_messages TO LOG;
-SET search_path TO public;
-----
----- No. G-1-1 RULE definition table
-----
--- No. G-1-1-1
-EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-(19 rows)
-
-/*+
-Set(enable_tidscan off)Set(enable_nestloop off)
-*/
-EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-Set(enable_nestloop off)
-Set(enable_tidscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t1.c1 = t4.c1)
- -> Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t1.c1)
- -> Seq Scan on t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t4
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r1
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
-(21 rows)
-
-EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Tid Scan on r1_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
-(19 rows)
-
-/*+
-Set(enable_tidscan off)Set(enable_nestloop off)
-*/
-EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-Set(enable_nestloop off)
-Set(enable_tidscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (b1t1.c1 = b1t4.c1)
- -> Hash Join
- Hash Cond: (b1t1.c1 = b1t2.c1)
- -> Hash Join
- Hash Cond: (b1t3.c1 = b1t1.c1)
- -> Seq Scan on t3 b1t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1 b1t1
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t4 b1t4
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r1_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
-(21 rows)
-
--- No. G-1-1-2
-EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-(39 rows)
-
-/*+
-Set(enable_tidscan off)Set(enable_nestloop off)
-*/
-EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-Set(enable_nestloop off)
-Set(enable_tidscan off)
-not used hint:
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-Set(enable_nestloop off)
-Set(enable_tidscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t1.c1 = t4.c1)
- -> Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t1.c1)
- -> Seq Scan on t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t4
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r2
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
-
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t1.c1 = t4.c1)
- -> Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t1.c1)
- -> Seq Scan on t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t4
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r2
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
-(43 rows)
-
-EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Nested Loop
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
-(39 rows)
-
-/*+
-Set(enable_tidscan off)Set(enable_nestloop off)
-*/
-EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-Set(enable_nestloop off)
-Set(enable_tidscan off)
-not used hint:
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-Set(enable_nestloop off)
-Set(enable_tidscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (b1t1.c1 = b1t4.c1)
- -> Hash Join
- Hash Cond: (b1t1.c1 = b1t2.c1)
- -> Hash Join
- Hash Cond: (b1t3.c1 = b1t1.c1)
- -> Seq Scan on t3 b1t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1 b1t1
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t4 b1t4
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r2_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
-
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (b2t1.c1 = b2t4.c1)
- -> Hash Join
- Hash Cond: (b2t1.c1 = b2t2.c1)
- -> Hash Join
- Hash Cond: (b2t3.c1 = b2t1.c1)
- -> Seq Scan on t3 b2t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1 b2t1
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t4 b2t4
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r2_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
-(43 rows)
-
--- No. G-1-1-3
-EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-(59 rows)
-
-/*+
-Set(enable_tidscan off)Set(enable_nestloop off)
-*/
-EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-Set(enable_nestloop off)
-Set(enable_tidscan off)
-not used hint:
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-Set(enable_nestloop off)
-Set(enable_tidscan off)
-not used hint:
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-Set(enable_nestloop off)
-Set(enable_tidscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t1.c1 = t4.c1)
- -> Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t1.c1)
- -> Seq Scan on t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t4
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
-
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t1.c1 = t4.c1)
- -> Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t1.c1)
- -> Seq Scan on t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t4
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
-
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t1.c1 = t4.c1)
- -> Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t1.c1)
- -> Seq Scan on t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t4
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
-(65 rows)
-
-EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
-(59 rows)
-
-/*+
-Set(enable_tidscan off)Set(enable_nestloop off)
-*/
-EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-Set(enable_nestloop off)
-Set(enable_tidscan off)
-not used hint:
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-Set(enable_nestloop off)
-Set(enable_tidscan off)
-not used hint:
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-Set(enable_nestloop off)
-Set(enable_tidscan off)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (b1t1.c1 = b1t4.c1)
- -> Hash Join
- Hash Cond: (b1t1.c1 = b1t2.c1)
- -> Hash Join
- Hash Cond: (b1t3.c1 = b1t1.c1)
- -> Seq Scan on t3 b1t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1 b1t1
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t4 b1t4
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
-
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (b2t1.c1 = b2t4.c1)
- -> Hash Join
- Hash Cond: (b2t1.c1 = b2t2.c1)
- -> Hash Join
- Hash Cond: (b2t3.c1 = b2t1.c1)
- -> Seq Scan on t3 b2t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1 b2t1
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t4 b2t4
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
-
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (b3t1.c1 = b3t4.c1)
- -> Hash Join
- Hash Cond: (b3t1.c1 = b3t2.c1)
- -> Hash Join
- Hash Cond: (b3t3.c1 = b3t1.c1)
- -> Seq Scan on t3 b3t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1 b3t1
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t4 b3t4
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
-(65 rows)
-
-RESET client_min_messages;
-----
----- No. G-2-1 GUC parameter
-----
--- No. G-2-1-3
-/*+Set(1234567890123456789012345678901234567890123456789012345678901234 1)*/
-SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-NOTICE: identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
-INFO: unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
- c1 | c2 | c3 | c4
-----+----+----+----
- 1 | 1 | 1 | 1
-(1 row)
-
--- No. G-2-1-4
-/*+Set(constraint_exclusion 1234567890123456789012345678901234567890123456789012345678901234)*/
-SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO: invalid value for parameter "constraint_exclusion": "1234567890123456789012345678901234567890123456789012345678901234"
-HINT: Available values: partition, on, off.
- c1 | c2 | c3 | c4
-----+----+----+----
- 1 | 1 | 1 | 1
-(1 row)
-
-----
----- No. G-2-2 category of GUC parameter and role
-----
--- No. G-2-2-1
-SET ROLE super_user;
-/*+Set(block_size 16384)*/
-SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO: parameter "block_size" cannot be changed
- c1 | c2 | c3 | c4
-----+----+----+----
- 1 | 1 | 1 | 1
-(1 row)
-
--- No. G-2-2-2
-/*+Set(archive_mode off)*/
-SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO: parameter "archive_mode" cannot be changed without restarting the server
- c1 | c2 | c3 | c4
-----+----+----+----
- 1 | 1 | 1 | 1
-(1 row)
-
--- No. G-2-2-3
-/*+Set(archive_timeout 0)*/
-SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO: parameter "archive_timeout" cannot be changed now
- c1 | c2 | c3 | c4
-----+----+----+----
- 1 | 1 | 1 | 1
-(1 row)
-
--- No. G-2-2-4
-/*+Set(log_connections off)*/
-SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO: parameter "log_connections" cannot be set after connection start
- c1 | c2 | c3 | c4
-----+----+----+----
- 1 | 1 | 1 | 1
-(1 row)
-
--- No. G-2-2-5
-/*+Set(log_min_messages WARNING)*/
-SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- c1 | c2 | c3 | c4
-----+----+----+----
- 1 | 1 | 1 | 1
-(1 row)
-
-RESET ROLE;
--- No. G-2-2-6
-GRANT ALL ON SCHEMA s1 TO PUBLIC;
-GRANT SELECT ON ALL TABLES IN SCHEMA s1 TO normal_user;
-SET ROLE normal_user;
-/*+Set(log_min_messages WARNING)*/
-SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO: permission denied to set parameter "log_min_messages"
- c1 | c2 | c3 | c4
-----+----+----+----
- 1 | 1 | 1 | 1
-(1 row)
-
--- No. G-2-2-7
-/*+Set(enable_seqscan on)*/
-SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- c1 | c2 | c3 | c4
-----+----+----+----
- 1 | 1 | 1 | 1
-(1 row)
-
-RESET ROLE;
-REVOKE SELECT ON ALL TABLES IN SCHEMA s1 FROM normal_user;
-REVOKE ALL ON SCHEMA s1 FROM PUBLIC;
-----
----- No. G-2-3 conflict set hint
-----
-SET client_min_messages TO LOG;
--- No. G-2-3-1
-/*+Set(enable_indexscan on)Set(enable_indexscan off)*/
-SELECT * FROM s1.t1 WHERE false;
-INFO: hint syntax error at or near "Set(enable_indexscan on)Set(enable_indexscan off)"
-DETAIL: Conflict set hint.
-LOG: pg_hint_plan:
-used hint:
-Set(enable_indexscan off)
-not used hint:
-duplication hint:
-Set(enable_indexscan on)
-error hint:
-
- c1 | c2 | c3 | c4
-----+----+----+----
-(0 rows)
-
--- No. G-2-3-2
-/*+Set(client_min_messages DEBUG5)Set(client_min_messages WARNING)Set(client_min_messages DEBUG2)*/
-SELECT * FROM s1.t1 WHERE false;
-INFO: hint syntax error at or near "Set(client_min_messages DEBUG5)Set(client_min_messages WARNING)Set(client_min_messages DEBUG2)"
-DETAIL: Conflict set hint.
-INFO: hint syntax error at or near "Set(client_min_messages WARNING)Set(client_min_messages DEBUG2)"
-DETAIL: Conflict set hint.
-LOG: pg_hint_plan:
-used hint:
-Set(client_min_messages DEBUG2)
-not used hint:
-duplication hint:
-Set(client_min_messages DEBUG5)
-Set(client_min_messages WARNING)
-error hint:
-
- c1 | c2 | c3 | c4
-----+----+----+----
-(0 rows)
-
--- No. G-2-3-3
-/*+Set(enable_indexscan on)Set(enable_indexscan o)*/
-SELECT * FROM s1.t1 WHERE false;
-INFO: hint syntax error at or near "Set(enable_indexscan on)Set(enable_indexscan o)"
-DETAIL: Conflict set hint.
-INFO: parameter "enable_indexscan" requires a Boolean value
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-Set(enable_indexscan on)
-error hint:
-Set(enable_indexscan o)
-
- c1 | c2 | c3 | c4
-----+----+----+----
-(0 rows)
-
--- No. G-2-3-4
-/*+Set(client_min_messages DEBUG5)Set(client_min_messages WARNING)Set(client_min_messages DEBU)*/
-SELECT * FROM s1.t1 WHERE false;
-INFO: hint syntax error at or near "Set(client_min_messages DEBUG5)Set(client_min_messages WARNING)Set(client_min_messages DEBU)"
-DETAIL: Conflict set hint.
-INFO: hint syntax error at or near "Set(client_min_messages WARNING)Set(client_min_messages DEBU)"
-DETAIL: Conflict set hint.
-INFO: invalid value for parameter "client_min_messages": "DEBU"
-HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, notice, warning, error.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-Set(client_min_messages DEBUG5)
-Set(client_min_messages WARNING)
-error hint:
-Set(client_min_messages DEBU)
-
- c1 | c2 | c3 | c4
-----+----+----+----
-(0 rows)
-
-----
----- No. G-2-4 debug message
-----
--- No. G-2-4-1
-/*+SeqScan(a)IndexScan(a)SeqScan(c)NestLoop(a) */
-SELECT * FROM s1.t1 a, s1.t2 b WHERE false;
-INFO: hint syntax error at or near " "
-DETAIL: NestLoop hint requires at least two relations.
-INFO: hint syntax error at or near "SeqScan(a)IndexScan(a)SeqScan(c)NestLoop(a) "
-DETAIL: Conflict scan method hint.
-LOG: pg_hint_plan:
-used hint:
-IndexScan(a)
-not used hint:
-SeqScan(c)
-duplication hint:
-SeqScan(a)
-error hint:
-NestLoop(a)
-
- c1 | c2 | c3 | c4 | c1 | c2 | c3 | c4
-----+----+----+----+----+----+----+----
-(0 rows)
-
+++ /dev/null
-LOAD 'pg_hint_plan';
-SET pg_hint_plan.enable_hint TO on;
-SET pg_hint_plan.debug_print TO on;
-SET client_min_messages TO LOG;
-SET search_path TO public;
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(6 rows)
-
-----
----- No. J-1-1 specified pattern of the object name
-----
--- No. J-1-1-1
-/*+HashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
--- No. J-1-1-2
-/*+HashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 t_1, s1.t2 t_2 WHERE t_1.c1 = t_2.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-HashJoin(t1 t2)
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------
- Merge Join
- Merge Cond: (t_1.c1 = t_2.c1)
- -> Index Scan using t1_i1 on t1 t_1
- -> Sort
- Sort Key: t_2.c1
- -> Seq Scan on t2 t_2
-(6 rows)
-
--- No. J-1-1-3
-/*+HashJoin(t_1 t_2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 t_1, s1.t2 t_2 WHERE t_1.c1 = t_2.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t_1 t_2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------
- Hash Join
- Hash Cond: (t_1.c1 = t_2.c1)
- -> Seq Scan on t1 t_1
- -> Hash
- -> Seq Scan on t2 t_2
-(5 rows)
-
-----
----- No. J-1-2 specified schema name in the hint option
-----
--- No. J-1-2-1
-/*+HashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
--- No. J-1-2-2
-/*+HashJoin(s1.t1 s1.t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-HashJoin(s1.t1 s1.t2)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(6 rows)
-
-----
----- No. J-1-3 table doesn't exist in the hint option
-----
--- No. J-1-3-1
-/*+HashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
--- No. J-1-3-2
-/*+HashJoin(t3 t4)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-HashJoin(t3 t4)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(6 rows)
-
-----
----- No. J-1-4 conflict table name
-----
--- No. J-1-4-1
-/*+HashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
--- No. J-1-4-2
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
- QUERY PLAN
--------------------------------------
- Merge Join
- Merge Cond: (s1.t1.c1 = s2.t1.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: s2.t1.c1
- -> Seq Scan on t1
-(6 rows)
-
-/*+HashJoin(t1 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
-INFO: hint syntax error at or near "HashJoin(t1 t1)"
-DETAIL: Relation name "t1" is ambiguous.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-HashJoin(t1 t1)
-
- QUERY PLAN
--------------------------------------
- Merge Join
- Merge Cond: (s1.t1.c1 = s2.t1.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: s2.t1.c1
- -> Seq Scan on t1
-(6 rows)
-
-/*+HashJoin(s1.t1 s2.t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-HashJoin(s1.t1 s2.t1)
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Merge Join
- Merge Cond: (s1.t1.c1 = s2.t1.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: s2.t1.c1
- -> Seq Scan on t1
-(6 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = s2t1.c1;
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = s2t1.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: s2t1.c1
- -> Seq Scan on t1 s2t1
-(6 rows)
-
-/*+HashJoin(t1 s2t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = s2t1.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(s2t1 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------
- Hash Join
- Hash Cond: (t1.c1 = s2t1.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t1 s2t1
-(5 rows)
-
--- No. J-1-4-3
-EXPLAIN (COSTS false) SELECT *, (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
--------------------------------------------------------
- Merge Join
- Merge Cond: (s1.t1.c1 = s1.t2.c1)
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Merge Join
- Merge Cond: (s1.t1.c1 = s1.t2.c1)
- -> Index Only Scan using t1_i1 on t1
- -> Sort
- Sort Key: s1.t2.c1
- -> Seq Scan on t2
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: s1.t2.c1
- -> Seq Scan on t2
-(14 rows)
-
-/*+HashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT *, (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------
- Hash Join
- Hash Cond: (s1.t1.c1 = s1.t2.c1)
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Hash Join
- Hash Cond: (s1.t1.c1 = s1.t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(12 rows)
-
-/*+NestLoop(st1 st2)HashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT *, (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(st1 st2)
-HashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- InitPlan 1 (returns $1)
- -> Aggregate
- -> Nested Loop
- -> Seq Scan on t2 st2
- -> Index Only Scan using t1_i1 on t1 st1
- Index Cond: (c1 = st2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(11 rows)
-
-----
----- No. J-1-5 conflict table name
-----
--- No. J-1-5-1
-/*+HashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
--- No. J-1-5-2
-/*+HashJoin(t1 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO: hint syntax error at or near "HashJoin(t1 t1)"
-DETAIL: Relation name "t1" is duplicated.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-HashJoin(t1 t1)
-
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(6 rows)
-
--- No. J-1-5-3
-/*+HashJoin(t1 t1)HashJoin(t2 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO: hint syntax error at or near "HashJoin(t1 t1)HashJoin(t2 t2)"
-DETAIL: Relation name "t1" is duplicated.
-INFO: hint syntax error at or near "HashJoin(t2 t2)"
-DETAIL: Relation name "t2" is duplicated.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-HashJoin(t1 t1)
-HashJoin(t2 t2)
-
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(6 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
- QUERY PLAN
-------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(9 rows)
-
-/*+HashJoin(t1 t2 t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near "HashJoin(t1 t2 t1 t2)"
-DETAIL: Relation name "t1" is duplicated.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-HashJoin(t1 t1 t2 t2)
-
- QUERY PLAN
-------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t4.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Scan using t4_i1 on t4
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(12 rows)
-
-----
----- No. J-1-6 object type for the hint
-----
--- No. J-1-6-1
-/*+HashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
--- No. J-1-6-2
-EXPLAIN (COSTS false) SELECT * FROM s1.p1 t1, s1.p1 t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
----------------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Append
- -> Seq Scan on p1 t1
- -> Seq Scan on p1c1 t1
- -> Seq Scan on p1c2 t1
- -> Seq Scan on p1c3 t1
- -> Hash
- -> Append
- -> Seq Scan on p1 t2
- -> Seq Scan on p1c1 t2
- -> Seq Scan on p1c2 t2
- -> Seq Scan on p1c3 t2
-(13 rows)
-
-/*+NestLoop(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.p1 t1, s1.p1 t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Nested Loop
- -> Append
- -> Seq Scan on p1 t1
- -> Seq Scan on p1c1 t1
- -> Seq Scan on p1c2 t1
- -> Seq Scan on p1c3 t1
- -> Append
- -> Seq Scan on p1 t2
- Filter: (t1.c1 = c1)
- -> Index Scan using p1c1_i on p1c1 t2
- Index Cond: (c1 = t1.c1)
- -> Index Scan using p1c2_i on p1c2 t2
- Index Cond: (c1 = t1.c1)
- -> Index Scan using p1c3_i on p1c3 t2
- Index Cond: (c1 = t1.c1)
-(15 rows)
-
--- No. J-1-6-3
-EXPLAIN (COSTS false) SELECT * FROM s1.ul1 t1, s1.ul1 t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
---------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on ul1 t1
- -> Hash
- -> Seq Scan on ul1 t2
-(5 rows)
-
-/*+NestLoop(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ul1 t1, s1.ul1 t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------
- Nested Loop
- -> Seq Scan on ul1 t1
- -> Index Scan using ul1_pkey on ul1 t2
- Index Cond: (c1 = t1.c1)
-(4 rows)
-
--- No. J-1-6-4
-CREATE TEMP TABLE tm1 (LIKE s1.t1 INCLUDING ALL);
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "tm1_pkey" for table "tm1"
-EXPLAIN (COSTS false) SELECT * FROM tm1 t1, tm1 t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
---------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on tm1 t1
- -> Hash
- -> Seq Scan on tm1 t2
-(5 rows)
-
-/*+NestLoop(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM tm1 t1, tm1 t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------
- Nested Loop
- -> Seq Scan on tm1 t1
- -> Index Scan using tm1_pkey on tm1 t2
- Index Cond: (c1 = t1.c1)
-(4 rows)
-
--- No. J-1-6-5
-EXPLAIN (COSTS false) SELECT * FROM pg_catalog.pg_class t1, pg_catalog.pg_class t2 WHERE t1.oid = t2.oid;
- QUERY PLAN
--------------------------------------
- Hash Join
- Hash Cond: (t1.oid = t2.oid)
- -> Seq Scan on pg_class t1
- -> Hash
- -> Seq Scan on pg_class t2
-(5 rows)
-
-/*+NestLoop(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM pg_catalog.pg_class t1, pg_catalog.pg_class t2 WHERE t1.oid = t2.oid;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------
- Nested Loop
- -> Seq Scan on pg_class t1
- -> Index Scan using pg_class_oid_index on pg_class t2
- Index Cond: (oid = t1.oid)
-(4 rows)
-
--- No. J-1-6-6
--- refer ut-fdw.sql
--- No. J-1-6-7
-EXPLAIN (COSTS false) SELECT * FROM s1.f1() t1, s1.f1() t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
---------------------------------
- Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Function Scan on f1 t1
- -> Function Scan on f1 t2
-(4 rows)
-
-/*+HashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.f1() t1, s1.f1() t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Function Scan on f1 t1
- -> Hash
- -> Function Scan on f1 t2
-(5 rows)
-
--- No. J-1-6-8
-EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t1 (c1, c2, c3, c4), s1.t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
--------------------------------------------
- Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
-(5 rows)
-
-/*+NestLoop(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t1 (c1, c2, c3, c4), s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-NestLoop(t1 t2)
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------
- Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
-(5 rows)
-
-/*+NestLoop(*VALUES* t2)*/
-EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t1 (c1, c2, c3, c4), s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(*VALUES* t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------
- Nested Loop
- Join Filter: ("*VALUES*".column1 = t2.c1)
- -> Seq Scan on t2
- -> Materialize
- -> Values Scan on "*VALUES*"
-(5 rows)
-
--- No. J-1-6-9
-EXPLAIN (COSTS false) WITH c1(c1) AS (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) SELECT * FROM s1.t1, c1 WHERE t1.c1 = c1.c1;
- QUERY PLAN
--------------------------------------------------------
- Nested Loop
- CTE c1
- -> Aggregate
- -> Merge Join
- Merge Cond: (s1.t1.c1 = t2.c1)
- -> Index Only Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
- -> CTE Scan on c1
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = c1.c1)
-(12 rows)
-
-/*+NestLoop(t1 t2)HashJoin(t1 c1)*/
-EXPLAIN (COSTS false) WITH c1(c1) AS (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) SELECT * FROM s1.t1, c1 WHERE t1.c1 = c1.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(c1 t1)
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------
- Hash Join
- Hash Cond: (s1.t1.c1 = c1.c1)
- CTE c1
- -> Aggregate
- -> Nested Loop
- -> Seq Scan on t2
- -> Index Only Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> CTE Scan on c1
-(11 rows)
-
--- No. J-1-6-10
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 t1, s1.v1 t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-----------------------------------
- Hash Join
- Hash Cond: (v1t1.c1 = v1t1.c1)
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1
-(5 rows)
-
-/*+NestLoop(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 t1, s1.v1 t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-NestLoop(t1 t2)
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Hash Join
- Hash Cond: (v1t1.c1 = v1t1.c1)
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1
-(5 rows)
-
-/*+NestLoop(v1t1 v1t1_)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 t1, s1.v1_ t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(v1t1 v1t1_)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Seq Scan on t1 v1t1
- -> Index Scan using t1_i1 on t1 v1t1_
- Index Cond: (c1 = v1t1.c1)
-(4 rows)
-
--- No. J-1-6-11
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.c1 = (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1);
- QUERY PLAN
------------------------------------------------------------
- Nested Loop
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Merge Join
- Merge Cond: (st1.c1 = st2.c1)
- -> Index Only Scan using t1_i1 on t1 st1
- -> Sort
- Sort Key: st2.c1
- -> Seq Scan on t2 st2
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = $0)
- -> Seq Scan on t2
- Filter: (c1 = $0)
-(13 rows)
-
-/*+MergeJoin(t1 t2)NestLoop(st1 st2)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.c1 = (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1);
-LOG: pg_hint_plan:
-used hint:
-NestLoop(st1 st2)
-MergeJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------------------------------
- Nested Loop (cost=10000000074.46..10000000084.99 rows=1 width=29)
- InitPlan 1 (returns $1)
- -> Aggregate (cost=74.45..74.46 rows=1 width=4)
- -> Nested Loop (cost=0.00..74.20 rows=100 width=4)
- -> Seq Scan on t2 st2 (cost=0.00..2.00 rows=100 width=4)
- -> Index Only Scan using t1_i1 on t1 st1 (cost=0.00..0.71 rows=1 width=4)
- Index Cond: (c1 = st2.c1)
- -> Index Scan using t1_i1 on t1 (cost=0.00..8.27 rows=1 width=15)
- Index Cond: (c1 = $1)
- -> Seq Scan on t2 (cost=0.00..2.25 rows=1 width=14)
- Filter: (c1 = $1)
-(11 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, (SELECT t2.c1 FROM s1.t2) st2 WHERE t1.c1 = st2.c1;
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(6 rows)
-
-/*+HashJoin(t1 st2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, (SELECT t2.c1 FROM s1.t2) st2 WHERE t1.c1 = st2.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-HashJoin(st2 t1)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(6 rows)
-
-/*+HashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, (SELECT t2.c1 FROM s1.t2) st2 WHERE t1.c1 = st2.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-----
----- No. J-2-1 some complexity query blocks
-----
--- No. J-2-1-1
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1), (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
-;
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(47 rows)
-
-/*+
-Leading(bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-MergeJoin(bmt1 bmt2)HashJoin(bmt1 bmt2 bmt3)NestLoop(bmt1 bmt2 bmt3 bmt4)
-MergeJoin(b1t2 b1t3)HashJoin(b1t2 b1t3 b1t4)NestLoop(b1t2 b1t3 b1t4 b1t1)
-MergeJoin(b2t3 b2t4)HashJoin(b2t3 b2t4 b2t1)NestLoop(b2t3 b2t4 b2t1 b2t2)
-*/
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1), (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
-;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(b1t2 b1t3)
-MergeJoin(b2t3 b2t4)
-MergeJoin(bmt1 bmt2)
-HashJoin(b1t2 b1t3 b1t4)
-HashJoin(b2t1 b2t3 b2t4)
-HashJoin(bmt1 bmt2 bmt3)
-NestLoop(b1t1 b1t2 b1t3 b1t4)
-NestLoop(b2t1 b2t2 b2t3 b2t4)
-NestLoop(bmt1 bmt2 bmt3 bmt4)
-Leading(bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b1t2.c1 = b1t3.c1)
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b1t3.c1
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Hash Join
- Hash Cond: (b2t1.c1 = b2t3.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Sort
- Sort Key: b2t3.c1
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b2t4.c1
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Hash Join
- Hash Cond: (bmt3.c1 = bmt1.c1)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Sort
- Sort Key: bmt1.c1
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(62 rows)
-
--- No. J-2-1-2
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1), (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-), (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
-;
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(63 rows)
-
-/*+
-Leading(bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-Leading(b3t4 b3t1 b3t2 b3t3)
-MergeJoin(bmt1 bmt2)HashJoin(bmt1 bmt2 bmt3)NestLoop(bmt1 bmt2 bmt3 bmt4)
-MergeJoin(b1t2 b1t3)HashJoin(b1t2 b1t3 b1t4)NestLoop(b1t2 b1t3 b1t4 b1t1)
-MergeJoin(b2t3 b2t4)HashJoin(b2t3 b2t4 b2t1)NestLoop(b2t3 b2t4 b2t1 b2t2)
-MergeJoin(b3t4 b3t1)HashJoin(b3t4 b3t1 b3t2)NestLoop(b3t1 b3t2 b3t3 b3t4)
-*/
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1), (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-), (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
-;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(b1t2 b1t3)
-MergeJoin(b2t3 b2t4)
-MergeJoin(b3t1 b3t4)
-MergeJoin(bmt1 bmt2)
-HashJoin(b1t2 b1t3 b1t4)
-HashJoin(b2t1 b2t3 b2t4)
-HashJoin(b3t1 b3t2 b3t4)
-HashJoin(bmt1 bmt2 bmt3)
-NestLoop(b1t1 b1t2 b1t3 b1t4)
-NestLoop(b2t1 b2t2 b2t3 b2t4)
-NestLoop(b3t1 b3t2 b3t3 b3t4)
-NestLoop(bmt1 bmt2 bmt3 bmt4)
-Leading(bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-Leading(b3t4 b3t1 b3t2 b3t3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b1t2.c1 = b1t3.c1)
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b1t3.c1
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Hash Join
- Hash Cond: (b2t1.c1 = b2t3.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Sort
- Sort Key: b2t3.c1
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b2t4.c1
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Hash Join
- Hash Cond: (b3t2.c1 = b3t1.c1)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b3t1.c1 = b3t4.c1)
- -> Sort
- Sort Key: b3t1.c1
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b3t4.c1
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Hash Join
- Hash Cond: (bmt3.c1 = bmt1.c1)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Sort
- Sort Key: bmt1.c1
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(83 rows)
-
--- No. J-2-1-3
-EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = sbmt3.c1 AND sbmt3.ctid = '(1,1)' AND bmt1.c1 = sbmt4.c1 AND sbmt4.ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(15 rows)
-
-/*+
-Leading(bmt4 bmt3 bmt2 bmt1)
-MergeJoin(bmt4 bmt3)HashJoin(bmt4 bmt3 bmt2)NestLoop(bmt1 bmt2 bmt3 bmt4)
-*/
-EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = sbmt3.c1 AND sbmt3.ctid = '(1,1)' AND bmt1.c1 = sbmt4.c1 AND sbmt4.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(bmt3 bmt4)
-HashJoin(bmt2 bmt3 bmt4)
-NestLoop(bmt1 bmt2 bmt3 bmt4)
-Leading(bmt4 bmt3 bmt2 bmt1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (bmt2.c1 = bmt1.c1)
- -> Hash Join
- Hash Cond: (bmt2.c1 = bmt3.c1)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (bmt3.c1 = bmt4.c1)
- -> Sort
- Sort Key: bmt3.c1
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: bmt4.c1
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
-(20 rows)
-
--- No. J-2-1-4
-EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = sbmt2.c1 AND sbmt2.ctid = '(1,1)' AND bmt1.c1 = sbmt3.c1 AND sbmt3.ctid = '(1,1)' AND bmt1.c1 = sbmt4.c1 AND sbmt4.ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(15 rows)
-
-/*+
-Leading(bmt4 bmt3 bmt2 bmt1)
-MergeJoin(bmt4 bmt3)HashJoin(bmt4 bmt3 bmt2)NestLoop(bmt1 bmt2 bmt3 bmt4)
-*/
-EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = sbmt2.c1 AND sbmt2.ctid = '(1,1)' AND bmt1.c1 = sbmt3.c1 AND sbmt3.ctid = '(1,1)' AND bmt1.c1 = sbmt4.c1 AND sbmt4.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(bmt3 bmt4)
-HashJoin(bmt2 bmt3 bmt4)
-NestLoop(bmt1 bmt2 bmt3 bmt4)
-Leading(bmt4 bmt3 bmt2 bmt1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (bmt2.c1 = bmt1.c1)
- -> Hash Join
- Hash Cond: (bmt2.c1 = bmt3.c1)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (bmt3.c1 = bmt4.c1)
- -> Sort
- Sort Key: bmt3.c1
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: bmt4.c1
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
-(20 rows)
-
--- No. J-2-1-5
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
- AND bmt1.c1 <> (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-) AND bmt1.c1 <> (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
-;
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 <> $0) AND (c1 <> $1))
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(48 rows)
-
-/*+
-Leading(bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-MergeJoin(bmt1 bmt2)HashJoin(bmt1 bmt2 bmt3)NestLoop(bmt1 bmt2 bmt3 bmt4)
-MergeJoin(b1t2 b1t3)HashJoin(b1t2 b1t3 b1t4)NestLoop(b1t2 b1t3 b1t4 b1t1)
-MergeJoin(b2t3 b2t4)HashJoin(b2t3 b2t4 b2t1)NestLoop(b2t3 b2t4 b2t1 b2t2)
-*/
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
- AND bmt1.c1 <> (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-) AND bmt1.c1 <> (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
-;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(b1t2 b1t3)
-MergeJoin(b2t3 b2t4)
-MergeJoin(bmt1 bmt2)
-HashJoin(b1t2 b1t3 b1t4)
-HashJoin(b2t1 b2t3 b2t4)
-HashJoin(bmt1 bmt2 bmt3)
-NestLoop(b1t1 b1t2 b1t3 b1t4)
-NestLoop(b2t1 b2t2 b2t3 b2t4)
-NestLoop(bmt1 bmt2 bmt3 bmt4)
-Leading(bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b1t2.c1 = b1t3.c1)
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b1t3.c1
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Hash Join
- Hash Cond: (b2t1.c1 = b2t3.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Sort
- Sort Key: b2t3.c1
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b2t4.c1
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Hash Join
- Hash Cond: (bmt3.c1 = bmt1.c1)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Sort
- Sort Key: bmt1.c1
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 <> $0) AND (c1 <> $1))
- -> Sort
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(63 rows)
-
--- No. J-2-1-6
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
- AND bmt1.c1 <> (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-) AND bmt1.c1 <> (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-) AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
-;
- QUERY PLAN
-------------------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 <> $0) AND (c1 <> $1) AND (c1 <> $2))
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(64 rows)
-
-/*+
-Leading(bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-Leading(b3t4 b3t1 b3t2 b3t3)
-MergeJoin(bmt1 bmt2)HashJoin(bmt1 bmt2 bmt3)NestLoop(bmt1 bmt2 bmt3 bmt4)
-MergeJoin(b1t2 b1t3)HashJoin(b1t2 b1t3 b1t4)NestLoop(b1t2 b1t3 b1t4 b1t1)
-MergeJoin(b2t3 b2t4)HashJoin(b2t3 b2t4 b2t1)NestLoop(b2t3 b2t4 b2t1 b2t2)
-MergeJoin(b3t4 b3t1)HashJoin(b3t4 b3t1 b3t2)NestLoop(b3t1 b3t2 b3t3 b3t4)
-*/
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
- AND bmt1.c1 <> (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-) AND bmt1.c1 <> (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-) AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
-;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(b1t2 b1t3)
-MergeJoin(b2t3 b2t4)
-MergeJoin(b3t1 b3t4)
-MergeJoin(bmt1 bmt2)
-HashJoin(b1t2 b1t3 b1t4)
-HashJoin(b2t1 b2t3 b2t4)
-HashJoin(b3t1 b3t2 b3t4)
-HashJoin(bmt1 bmt2 bmt3)
-NestLoop(b1t1 b1t2 b1t3 b1t4)
-NestLoop(b2t1 b2t2 b2t3 b2t4)
-NestLoop(b3t1 b3t2 b3t3 b3t4)
-NestLoop(bmt1 bmt2 bmt3 bmt4)
-Leading(bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-Leading(b3t4 b3t1 b3t2 b3t3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b1t2.c1 = b1t3.c1)
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b1t3.c1
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Hash Join
- Hash Cond: (b2t1.c1 = b2t3.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Sort
- Sort Key: b2t3.c1
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b2t4.c1
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Hash Join
- Hash Cond: (b3t2.c1 = b3t1.c1)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b3t1.c1 = b3t4.c1)
- -> Sort
- Sort Key: b3t1.c1
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b3t4.c1
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Hash Join
- Hash Cond: (bmt3.c1 = bmt1.c1)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Sort
- Sort Key: bmt1.c1
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 <> $0) AND (c1 <> $1) AND (c1 <> $2))
- -> Sort
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(84 rows)
-
--- No. J-2-1-7
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-, c2 (c1) AS (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
-, c1, c2
- WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
-AND bmt1.c1 = c1.c1
-AND bmt1.c1 = c2.c1
-;
- QUERY PLAN
------------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- CTE c2
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c2.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c1.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
- -> CTE Scan on c2
-(53 rows)
-
-/*+
-Leading(c2 c1 bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-MergeJoin(c2 c1)HashJoin(c2 c1 bmt1)NestLoop(c2 c1 bmt1 bmt2)MergeJoin(c2 c1 bmt1 bmt2 bmt3)HashJoin(c2 c1 bmt1 bmt2 bmt3 bmt4)
-MergeJoin(b1t2 b1t3)HashJoin(b1t2 b1t3 b1t4)NestLoop(b1t2 b1t3 b1t4 b1t1)
-MergeJoin(b2t3 b2t4)HashJoin(b2t3 b2t4 b2t1)NestLoop(b2t3 b2t4 b2t1 b2t2)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-, c2 (c1) AS (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
-, c1, c2
- WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
-AND bmt1.c1 = c1.c1
-AND bmt1.c1 = c2.c1
-;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(b1t2 b1t3)
-MergeJoin(b2t3 b2t4)
-MergeJoin(c1 c2)
-HashJoin(b1t2 b1t3 b1t4)
-HashJoin(b2t1 b2t3 b2t4)
-HashJoin(bmt1 c1 c2)
-NestLoop(b1t1 b1t2 b1t3 b1t4)
-NestLoop(b2t1 b2t2 b2t3 b2t4)
-NestLoop(bmt1 bmt2 c1 c2)
-MergeJoin(bmt1 bmt2 bmt3 c1 c2)
-HashJoin(bmt1 bmt2 bmt3 bmt4 c1 c2)
-Leading(c2 c1 bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b1t2.c1 = b1t3.c1)
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b1t3.c1
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- CTE c2
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Hash Join
- Hash Cond: (b2t1.c1 = b2t3.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Sort
- Sort Key: b2t3.c1
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b2t4.c1
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash Join
- Hash Cond: (bmt4.c1 = bmt1.c1)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt3.c1)
- -> Sort
- Sort Key: bmt1.c1
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Hash Join
- Hash Cond: (bmt1.c1 = c1.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (c1.c1 = c2.c1)
- -> Sort
- Sort Key: c1.c1
- -> CTE Scan on c1
- -> Sort
- Sort Key: c2.c1
- -> CTE Scan on c2
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: bmt3.c1
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
-(73 rows)
-
--- No. J-2-1-8
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-, c2 (c1) AS (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
-, c3 (c1) AS (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
-, c1, c2, c3
- WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
-AND bmt1.c1 = c1.c1
-AND bmt1.c1 = c2.c1
-AND bmt1.c1 = c3.c1
-;
- QUERY PLAN
------------------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- CTE c2
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- CTE c3
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c2.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c1.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
- -> CTE Scan on c2
- -> CTE Scan on c3
-(72 rows)
-
-/*+
-Leading(c3 c2 c1 bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-Leading(b3t4 b3t1 b3t2 b3t3)
-MergeJoin(c3 c2)HashJoin(c3 c2 c1)NestLoop(c3 c2 c1 bmt1)MergeJoin(c3 c2 c1 bmt1 bmt2)HashJoin(c3 c2 c1 bmt1 bmt2 bmt3)NestLoop(c3 c2 c1 bmt1 bmt2 bmt3 bmt4)
-MergeJoin(b1t2 b1t3)HashJoin(b1t2 b1t3 b1t4)NestLoop(b1t2 b1t3 b1t4 b1t1)
-MergeJoin(b2t3 b2t4)HashJoin(b2t3 b2t4 b2t1)NestLoop(b2t3 b2t4 b2t1 b2t2)
-MergeJoin(b3t4 b3t1)HashJoin(b3t4 b3t1 b3t2)NestLoop(b3t1 b3t2 b3t3 b3t4)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-, c2 (c1) AS (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
-, c3 (c1) AS (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
-, c1, c2, c3
- WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
-AND bmt1.c1 = c1.c1
-AND bmt1.c1 = c2.c1
-AND bmt1.c1 = c3.c1
-;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(b1t2 b1t3)
-MergeJoin(b2t3 b2t4)
-MergeJoin(b3t1 b3t4)
-MergeJoin(c2 c3)
-HashJoin(b1t2 b1t3 b1t4)
-HashJoin(b2t1 b2t3 b2t4)
-HashJoin(b3t1 b3t2 b3t4)
-HashJoin(c1 c2 c3)
-NestLoop(b1t1 b1t2 b1t3 b1t4)
-NestLoop(b2t1 b2t2 b2t3 b2t4)
-NestLoop(b3t1 b3t2 b3t3 b3t4)
-NestLoop(bmt1 c1 c2 c3)
-MergeJoin(bmt1 bmt2 c1 c2 c3)
-HashJoin(bmt1 bmt2 bmt3 c1 c2 c3)
-NestLoop(bmt1 bmt2 bmt3 bmt4 c1 c2 c3)
-Leading(c3 c2 c1 bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-Leading(b3t4 b3t1 b3t2 b3t3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b1t2.c1 = b1t3.c1)
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b1t3.c1
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- CTE c2
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Hash Join
- Hash Cond: (b2t1.c1 = b2t3.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Sort
- Sort Key: b2t3.c1
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b2t4.c1
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- CTE c3
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Hash Join
- Hash Cond: (b3t2.c1 = b3t1.c1)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b3t1.c1 = b3t4.c1)
- -> Sort
- Sort Key: b3t1.c1
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b3t4.c1
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Hash Join
- Hash Cond: (bmt3.c1 = bmt1.c1)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Sort
- Sort Key: bmt1.c1
- -> Nested Loop
- Join Filter: (c1.c1 = bmt1.c1)
- -> Hash Join
- Hash Cond: (c2.c1 = c1.c1)
- -> Merge Join
- Merge Cond: (c2.c1 = c3.c1)
- -> Sort
- Sort Key: c2.c1
- -> CTE Scan on c2
- -> Sort
- Sort Key: c3.c1
- -> CTE Scan on c3
- -> Hash
- -> CTE Scan on c1
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(97 rows)
-
-----
----- No. J-2-2 the number of the tables per quiry block
-----
--- No. J-2-2-1
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = 1
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
-)
- FROM s1.t1 bmt1, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = 1
-AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = 1
-)
-;
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 4 (returns $3)
- -> Result
- InitPlan 3 (returns $2)
- -> Limit
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 6 (returns $5)
- -> Result
- InitPlan 5 (returns $4)
- -> Limit
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- -> Nested Loop
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 <> $5) AND (c1 = 1))
- -> CTE Scan on c1
- Filter: (c1 = 1)
-(28 rows)
-
-/*+
-Leading(c1 bmt1)
-HashJoin(bmt1 c1)
-HashJoin(b1t1 c1)
-HashJoin(b2t1 c1)
-HashJoin(b3t1 c1)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = 1
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
-)
- FROM s1.t1 bmt1, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = 1
-AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = 1
-)
-;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(bmt1 c1)
-Leading(c1 bmt1)
-not used hint:
-HashJoin(b1t1 c1)
-HashJoin(b2t1 c1)
-HashJoin(b3t1 c1)
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 4 (returns $3)
- -> Result
- InitPlan 3 (returns $2)
- -> Limit
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 6 (returns $5)
- -> Result
- InitPlan 5 (returns $4)
- -> Limit
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- -> Nested Loop
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 <> $5) AND (c1 = 1))
- -> CTE Scan on c1
- Filter: (c1 = 1)
-(28 rows)
-
--- No. J-2-2-2
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)'
-AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)'
-)
-;
- QUERY PLAN
--------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c1.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $2)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
-(35 rows)
-
-/*+
-Leading(c1 bmt2 bmt1)
-Leading(b1t2 b1t1)
-Leading(b2t2 b2t1)
-Leading(b3t2 b3t1)
-MergeJoin(c1 bmt2)
-HashJoin(c1 bmt1 bmt2)
-MergeJoin(b1t1 b1t2)
-MergeJoin(b2t1 b2t2)
-MergeJoin(b3t1 b3t2)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)'
-AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)'
-)
-;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(b1t1 b1t2)
-MergeJoin(b2t1 b2t2)
-MergeJoin(b3t1 b3t2)
-MergeJoin(bmt2 c1)
-HashJoin(bmt1 bmt2 c1)
-Leading(c1 bmt2 bmt1)
-Leading(b1t2 b1t1)
-Leading(b2t2 b2t1)
-Leading(b3t2 b3t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Sort
- Sort Key: b1t1.c1
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Merge Join
- Merge Cond: (b2t1.c1 = b2t2.c1)
- -> Sort
- Sort Key: b2t1.c1
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b2t2.c1
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Merge Join
- Merge Cond: (b3t1.c1 = b3t2.c1)
- -> Sort
- Sort Key: b3t1.c1
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b3t2.c1
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash Join
- Hash Cond: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $2)
- -> Hash
- -> Merge Join
- Merge Cond: (bmt2.c1 = c1.c1)
- -> Sort
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: c1.c1
- -> CTE Scan on c1
-(52 rows)
-
--- No. J-2-2-3
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
-;
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c1.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $2)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
-(67 rows)
-
-/*+
-Leading(c1 bmt4 bmt3 bmt2 bmt1)
-Leading(b1t4 b1t3 b1t2 b1t1)
-Leading(b2t4 b2t3 b2t2 b2t1)
-Leading(b3t4 b3t3 b3t2 b3t1)
-MergeJoin(c1 bmt4)
-HashJoin(c1 bmt4 bmt3)
-NestLoop(c1 bmt4 bmt3 bmt2)
-MergeJoin(c1 bmt4 bmt3 bmt2 bmt1)
-HashJoin(b1t4 b1t3)
-NestLoop(b1t4 b1t3 b1t2)
-MergeJoin(b1t4 b1t3 b1t2 b1t1)
-HashJoin(b2t4 b2t3)
-NestLoop(b2t4 b2t3 b2t2)
-MergeJoin(b2t4 b2t3 b2t2 b2t1)
-HashJoin(b3t4 b3t3)
-NestLoop(b3t4 b3t3 b3t2)
-MergeJoin(b3t4 b3t3 b3t2 b3t1)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
-;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(b1t3 b1t4)
-HashJoin(b2t3 b2t4)
-HashJoin(b3t3 b3t4)
-MergeJoin(bmt4 c1)
-NestLoop(b1t2 b1t3 b1t4)
-NestLoop(b2t2 b2t3 b2t4)
-NestLoop(b3t2 b3t3 b3t4)
-HashJoin(bmt3 bmt4 c1)
-MergeJoin(b1t1 b1t2 b1t3 b1t4)
-MergeJoin(b2t1 b2t2 b2t3 b2t4)
-MergeJoin(b3t1 b3t2 b3t3 b3t4)
-NestLoop(bmt2 bmt3 bmt4 c1)
-MergeJoin(bmt1 bmt2 bmt3 bmt4 c1)
-Leading(c1 bmt4 bmt3 bmt2 bmt1)
-Leading(b1t4 b1t3 b1t2 b1t1)
-Leading(b2t4 b2t3 b2t2 b2t1)
-Leading(b3t4 b3t3 b3t2 b3t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Merge Join
- Merge Cond: (b1t2.c1 = b1t1.c1)
- -> Sort
- Sort Key: b1t2.c1
- -> Nested Loop
- Join Filter: (b1t3.c1 = b1t2.c1)
- -> Hash Join
- Hash Cond: (b1t3.c1 = b1t4.c1)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b1t1.c1
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Merge Join
- Merge Cond: (b2t2.c1 = b2t1.c1)
- -> Sort
- Sort Key: b2t2.c1
- -> Nested Loop
- Join Filter: (b2t3.c1 = b2t2.c1)
- -> Hash Join
- Hash Cond: (b2t3.c1 = b2t4.c1)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b2t1.c1
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Merge Join
- Merge Cond: (b3t2.c1 = b3t1.c1)
- -> Sort
- Sort Key: b3t2.c1
- -> Nested Loop
- Join Filter: (b3t3.c1 = b3t2.c1)
- -> Hash Join
- Hash Cond: (b3t3.c1 = b3t4.c1)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b3t1.c1
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Merge Join
- Merge Cond: (bmt2.c1 = bmt1.c1)
- -> Sort
- Sort Key: bmt2.c1
- -> Nested Loop
- Join Filter: (bmt3.c1 = bmt2.c1)
- -> Hash Join
- Hash Cond: (bmt3.c1 = bmt4.c1)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (bmt4.c1 = c1.c1)
- -> Sort
- Sort Key: bmt4.c1
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: c1.c1
- -> CTE Scan on c1
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: bmt1.c1
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $2)
-(91 rows)
-
--- No. J-2-2-4
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
-)
-;
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Result
- InitPlan 2 (returns $1)
- -> Limit
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 4 (returns $3)
- -> Aggregate
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c1.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $3)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
-(46 rows)
-
-/*+
-Leading(c1 bmt4 bmt3 bmt2 bmt1)
-Leading(b1t4 b1t3 b1t2 b1t1)
-MergeJoin(c1 bmt4)
-HashJoin(c1 bmt4 bmt3)
-NestLoop(c1 bmt4 bmt3 bmt2)
-MergeJoin(c1 bmt4 bmt3 bmt2 bmt1)
-MergeJoin(b1t4 b1t3)
-HashJoin(b1t4 b1t3 b1t2)
-NestLoop(b1t4 b1t3 b1t2 b1t1)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
-)
-;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(b1t3 b1t4)
-MergeJoin(bmt4 c1)
-HashJoin(b1t2 b1t3 b1t4)
-HashJoin(bmt3 bmt4 c1)
-NestLoop(b1t1 b1t2 b1t3 b1t4)
-NestLoop(bmt2 bmt3 bmt4 c1)
-MergeJoin(bmt1 bmt2 bmt3 bmt4 c1)
-Leading(c1 bmt4 bmt3 bmt2 bmt1)
-Leading(b1t4 b1t3 b1t2 b1t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join
- Hash Cond: (b1t2.c1 = b1t3.c1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b1t3.c1 = b1t4.c1)
- -> Sort
- Sort Key: b1t3.c1
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b1t4.c1
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Result
- InitPlan 2 (returns $1)
- -> Limit
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 4 (returns $3)
- -> Aggregate
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Merge Join
- Merge Cond: (bmt2.c1 = bmt1.c1)
- -> Sort
- Sort Key: bmt2.c1
- -> Nested Loop
- Join Filter: (bmt3.c1 = bmt2.c1)
- -> Hash Join
- Hash Cond: (bmt3.c1 = bmt4.c1)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (bmt4.c1 = c1.c1)
- -> Sort
- Sort Key: bmt4.c1
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: c1.c1
- -> CTE Scan on c1
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: bmt1.c1
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $3)
-(60 rows)
-
-----
----- No. J-2-3 RULE or VIEW
-----
--- No. J-2-3-1
-EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-(19 rows)
-
-/*+
-Leading(t4 t3 t2 t1 r1)
-MergeJoin(t4 t3 t2 t1 r1)
-HashJoin(t4 t3 t2 t1)
-NestLoop(t4 t3 t2)
-MergeJoin(t4 t3)
-*/
-EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(t3 t4)
-NestLoop(t2 t3 t4)
-HashJoin(t1 t2 t3 t4)
-MergeJoin(r1 t1 t2 t3 t4)
-Leading(t4 t3 t2 t1 r1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Nested Loop
- Join Filter: (t3.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t3.c1 = t4.c1)
- -> Sort
- Sort Key: t3.c1
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: t4.c1
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on r1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(24 rows)
-
-EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Tid Scan on r1_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
-(19 rows)
-
-/*+
-Leading(b1t4 b1t3 b1t2 b1t1 r1_)
-MergeJoin(b1t4 b1t3 b1t2 b1t1 r1_)
-HashJoin(b1t4 b1t3 b1t2 b1t1)
-NestLoop(b1t4 b1t3 b1t2)
-MergeJoin(b1t4 b1t3)
-*/
-EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(b1t3 b1t4)
-NestLoop(b1t2 b1t3 b1t4)
-HashJoin(b1t1 b1t2 b1t3 b1t4)
-MergeJoin(b1t1 b1t2 b1t3 b1t4 r1_)
-Leading(b1t4 b1t3 b1t2 b1t1 r1_)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Nested Loop
- Join Filter: (b1t3.c1 = b1t2.c1)
- -> Merge Join
- Merge Cond: (b1t3.c1 = b1t4.c1)
- -> Sort
- Sort Key: b1t3.c1
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b1t4.c1
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on r1_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(24 rows)
-
--- No. J-2-3-2
-EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-(39 rows)
-
-/*+
-Leading(t4 t3 t2 t1 r2)
-MergeJoin(t4 t3 t2 t1 r2)
-HashJoin(t4 t3 t2 t1)
-NestLoop(t4 t3 t2)
-MergeJoin(t4 t3)
-*/
-EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(t3 t4)
-NestLoop(t2 t3 t4)
-HashJoin(t1 t2 t3 t4)
-MergeJoin(r2 t1 t2 t3 t4)
-Leading(t4 t3 t2 t1 r2)
-not used hint:
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(t3 t4)
-NestLoop(t2 t3 t4)
-HashJoin(t1 t2 t3 t4)
-MergeJoin(r2 t1 t2 t3 t4)
-Leading(t4 t3 t2 t1 r2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Nested Loop
- Join Filter: (t3.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t3.c1 = t4.c1)
- -> Sort
- Sort Key: t3.c1
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: t4.c1
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Nested Loop
- Join Filter: (t3.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t3.c1 = t4.c1)
- -> Sort
- Sort Key: t3.c1
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: t4.c1
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(49 rows)
-
-EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Nested Loop
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
-(39 rows)
-
-/*+
-Leading(b1t1 b1t2 b1t3 b1t4 r2_)
-Leading(b2t1 b2t2 b2t3 b2t4 r2_)
-MergeJoin(b1t1 b1t2)
-HashJoin(b1t1 b1t2 b1t3)
-NestLoop(b1t1 b1t2 b1t3 b1t4)
-MergeJoin(b1t1 b1t2 b1t3 b1t4 r2_)
-MergeJoin(b2t1 b2t2)
-HashJoin(b2t1 b2t2 b2t3)
-NestLoop(b2t1 b2t2 b2t3 b2t4)
-MergeJoin(b2t1 b2t2 b2t3 b2t4 r2_)
-*/
-EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(b1t1 b1t2)
-HashJoin(b1t1 b1t2 b1t3)
-NestLoop(b1t1 b1t2 b1t3 b1t4)
-MergeJoin(b1t1 b1t2 b1t3 b1t4 r2_)
-Leading(b1t1 b1t2 b1t3 b1t4 r2_)
-not used hint:
-MergeJoin(b2t1 b2t2)
-HashJoin(b2t1 b2t2 b2t3)
-NestLoop(b2t1 b2t2 b2t3 b2t4)
-MergeJoin(b2t1 b2t2 b2t3 b2t4 r2_)
-Leading(b2t1 b2t2 b2t3 b2t4 r2_)
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(b2t1 b2t2)
-HashJoin(b2t1 b2t2 b2t3)
-NestLoop(b2t1 b2t2 b2t3 b2t4)
-MergeJoin(b2t1 b2t2 b2t3 b2t4 r2_)
-Leading(b2t1 b2t2 b2t3 b2t4 r2_)
-not used hint:
-MergeJoin(b1t1 b1t2)
-HashJoin(b1t1 b1t2 b1t3)
-NestLoop(b1t1 b1t2 b1t3 b1t4)
-MergeJoin(b1t1 b1t2 b1t3 b1t4 r2_)
-Leading(b1t1 b1t2 b1t3 b1t4 r2_)
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Hash Join
- Hash Cond: (b1t3.c1 = b1t1.c1)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Sort
- Sort Key: b1t1.c1
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Hash Join
- Hash Cond: (b2t3.c1 = b2t1.c1)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b2t1.c1 = b2t2.c1)
- -> Sort
- Sort Key: b2t1.c1
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b2t2.c1
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(49 rows)
-
--- No. J-2-3-3
-EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-(59 rows)
-
-/*+
-Leading(t4 t3 t2 t1 r3)
-MergeJoin(t4 t3 t2 t1 r3)
-HashJoin(t4 t3 t2 t1)
-NestLoop(t4 t3 t2)
-MergeJoin(t4 t3)
-*/
-EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(t3 t4)
-NestLoop(t2 t3 t4)
-HashJoin(t1 t2 t3 t4)
-MergeJoin(r3 t1 t2 t3 t4)
-Leading(t4 t3 t2 t1 r3)
-not used hint:
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(t3 t4)
-NestLoop(t2 t3 t4)
-HashJoin(t1 t2 t3 t4)
-MergeJoin(r3 t1 t2 t3 t4)
-Leading(t4 t3 t2 t1 r3)
-not used hint:
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(t3 t4)
-NestLoop(t2 t3 t4)
-HashJoin(t1 t2 t3 t4)
-MergeJoin(r3 t1 t2 t3 t4)
-Leading(t4 t3 t2 t1 r3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Nested Loop
- Join Filter: (t3.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t3.c1 = t4.c1)
- -> Sort
- Sort Key: t3.c1
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: t4.c1
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Nested Loop
- Join Filter: (t3.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t3.c1 = t4.c1)
- -> Sort
- Sort Key: t3.c1
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: t4.c1
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-
- Aggregate
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Nested Loop
- Join Filter: (t3.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t3.c1 = t4.c1)
- -> Sort
- Sort Key: t3.c1
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: t4.c1
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(74 rows)
-
-EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
-(59 rows)
-
-/*+
-Leading(b1t1 b1t2 b1t3 b1t4 r3_)
-Leading(b2t1 b2t2 b2t3 b2t4 r3_)
-Leading(b3t1 b3t2 b3t3 b3t4 r3_)
-MergeJoin(b1t1 b1t2)
-HashJoin(b1t1 b1t2 b1t3)
-NestLoop(b1t1 b1t2 b1t3 b1t4)
-MergeJoin(b1t1 b1t2 b1t3 b1t4 r3_)
-MergeJoin(b2t1 b2t2)
-HashJoin(b2t1 b2t2 b2t3)
-NestLoop(b2t1 b2t2 b2t3 b2t4)
-MergeJoin(b2t1 b2t2 b2t3 b2t4 r3_)
-MergeJoin(b3t1 b3t2)
-HashJoin(b3t1 b3t2 b3t3)
-NestLoop(b3t1 b3t2 b3t3 b3t4)
-MergeJoin(b3t1 b3t2 b3t3 b3t4 r3_)
-*/
-EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(b1t1 b1t2)
-HashJoin(b1t1 b1t2 b1t3)
-NestLoop(b1t1 b1t2 b1t3 b1t4)
-MergeJoin(b1t1 b1t2 b1t3 b1t4 r3_)
-Leading(b1t1 b1t2 b1t3 b1t4 r3_)
-not used hint:
-MergeJoin(b2t1 b2t2)
-MergeJoin(b3t1 b3t2)
-HashJoin(b2t1 b2t2 b2t3)
-HashJoin(b3t1 b3t2 b3t3)
-NestLoop(b2t1 b2t2 b2t3 b2t4)
-NestLoop(b3t1 b3t2 b3t3 b3t4)
-MergeJoin(b2t1 b2t2 b2t3 b2t4 r3_)
-MergeJoin(b3t1 b3t2 b3t3 b3t4 r3_)
-Leading(b2t1 b2t2 b2t3 b2t4 r3_)
-Leading(b3t1 b3t2 b3t3 b3t4 r3_)
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(b2t1 b2t2)
-HashJoin(b2t1 b2t2 b2t3)
-NestLoop(b2t1 b2t2 b2t3 b2t4)
-MergeJoin(b2t1 b2t2 b2t3 b2t4 r3_)
-Leading(b2t1 b2t2 b2t3 b2t4 r3_)
-not used hint:
-MergeJoin(b1t1 b1t2)
-MergeJoin(b3t1 b3t2)
-HashJoin(b1t1 b1t2 b1t3)
-HashJoin(b3t1 b3t2 b3t3)
-NestLoop(b1t1 b1t2 b1t3 b1t4)
-NestLoop(b3t1 b3t2 b3t3 b3t4)
-MergeJoin(b1t1 b1t2 b1t3 b1t4 r3_)
-MergeJoin(b3t1 b3t2 b3t3 b3t4 r3_)
-Leading(b1t1 b1t2 b1t3 b1t4 r3_)
-Leading(b3t1 b3t2 b3t3 b3t4 r3_)
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(b3t1 b3t2)
-HashJoin(b3t1 b3t2 b3t3)
-NestLoop(b3t1 b3t2 b3t3 b3t4)
-MergeJoin(b3t1 b3t2 b3t3 b3t4 r3_)
-Leading(b3t1 b3t2 b3t3 b3t4 r3_)
-not used hint:
-MergeJoin(b1t1 b1t2)
-MergeJoin(b2t1 b2t2)
-HashJoin(b1t1 b1t2 b1t3)
-HashJoin(b2t1 b2t2 b2t3)
-NestLoop(b1t1 b1t2 b1t3 b1t4)
-NestLoop(b2t1 b2t2 b2t3 b2t4)
-MergeJoin(b1t1 b1t2 b1t3 b1t4 r3_)
-MergeJoin(b2t1 b2t2 b2t3 b2t4 r3_)
-Leading(b1t1 b1t2 b1t3 b1t4 r3_)
-Leading(b2t1 b2t2 b2t3 b2t4 r3_)
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Hash Join
- Hash Cond: (b1t3.c1 = b1t1.c1)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Sort
- Sort Key: b1t1.c1
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Hash Join
- Hash Cond: (b2t3.c1 = b2t1.c1)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b2t1.c1 = b2t2.c1)
- -> Sort
- Sort Key: b2t1.c1
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b2t2.c1
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Hash Join
- Hash Cond: (b3t3.c1 = b3t1.c1)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Hash
- -> Merge Join
- Merge Cond: (b3t1.c1 = b3t2.c1)
- -> Sort
- Sort Key: b3t1.c1
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: b3t2.c1
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(74 rows)
-
--- No. J-2-3-4
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
- QUERY PLAN
-----------------------------------
- Hash Join
- Hash Cond: (v1t1.c1 = v1t1.c1)
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1
-(5 rows)
-
-/*+HashJoin(v1t1 v1t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
-INFO: hint syntax error at or near "HashJoin(v1t1 v1t1)"
-DETAIL: Relation name "v1t1" is ambiguous.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-HashJoin(v1t1 v1t1)
-
- QUERY PLAN
-----------------------------------
- Hash Join
- Hash Cond: (v1t1.c1 = v1t1.c1)
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1
-(5 rows)
-
--- No. J-2-3-5
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
- QUERY PLAN
------------------------------------
- Hash Join
- Hash Cond: (v1t1.c1 = v1t1_.c1)
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1_
-(5 rows)
-
-/*+NestLoop(v1t1 v1t1_)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(v1t1 v1t1_)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Seq Scan on t1 v1t1
- -> Index Scan using t1_i1 on t1 v1t1_
- Index Cond: (c1 = v1t1.c1)
-(4 rows)
-
--- No. J-2-3-6
-EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-----------------------------------
- Hash Join
- Hash Cond: (r4t1.c1 = r4t1.c1)
- -> Seq Scan on t1 r4t1
- -> Hash
- -> Seq Scan on t1 r4t1
-(5 rows)
-
-/*+HashJoin(r4t1 r4t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
-INFO: hint syntax error at or near "HashJoin(r4t1 r4t1)"
-DETAIL: Relation name "r4t1" is ambiguous.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-HashJoin(r4t1 r4t1)
-
- QUERY PLAN
-----------------------------------
- Hash Join
- Hash Cond: (r4t1.c1 = r4t1.c1)
- -> Seq Scan on t1 r4t1
- -> Hash
- -> Seq Scan on t1 r4t1
-(5 rows)
-
--- No. J-2-3-7
-EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-----------------------------------
- Hash Join
- Hash Cond: (r4t1.c1 = r5t1.c1)
- -> Seq Scan on t1 r4t1
- -> Hash
- -> Seq Scan on t1 r5t1
-(5 rows)
-
-/*+NestLoop(r4t1 r5t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(r4t1 r5t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Nested Loop
- -> Seq Scan on t1 r4t1
- -> Index Scan using t1_i1 on t1 r5t1
- Index Cond: (c1 = r4t1.c1)
-(4 rows)
-
-----
----- No. J-2-4 VALUES clause
-----
--- No. J-2-4-1
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
- QUERY PLAN
--------------------------------------------------
- Nested Loop
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
-(8 rows)
-
-/*+ Leading(t3 t1 t2) HashJoin(t3 t1)NestLoop(t3 t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-HashJoin(t1 t3)
-NestLoop(t1 t2 t3)
-Leading(t3 t1 t2)
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------
- Nested Loop
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
-(8 rows)
-
-/*+ Leading(*VALUES* t1 t2) HashJoin(*VALUES* t1)NestLoop(*VALUES* t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(*VALUES* t1)
-NestLoop(*VALUES* t1 t2)
-Leading(*VALUES* t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------
- Nested Loop
- -> Hash Join
- Hash Cond: (t1.c1 = "*VALUES*".column1)
- -> Seq Scan on t1
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Index Scan using t2_i1 on t2
- Index Cond: (c1 = t1.c1)
-(8 rows)
-
--- No. J-2-4-2
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
- QUERY PLAN
--------------------------------------------------------
- Nested Loop
- Join Filter: (t1.c1 = "*VALUES*".column1)
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
- -> Values Scan on "*VALUES*"
-(11 rows)
-
-/*+ Leading(t4 t3 t2 t1) NestLoop(t4 t3)HashJoin(t4 t3 t2)MergeJoin(t4 t3 t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-NestLoop(t3 t4)
-HashJoin(t2 t3 t4)
-MergeJoin(t1 t2 t3 t4)
-Leading(t4 t3 t2 t1)
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------
- Nested Loop
- Join Filter: (t1.c1 = "*VALUES*".column1)
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
- -> Values Scan on "*VALUES*"
-(11 rows)
-
-/*+ Leading(*VALUES* t3 t2 t1) NestLoop(t4 t3)HashJoin(*VALUES* t3 t2)MergeJoin(*VALUES* t3 t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near "HashJoin(*VALUES* t3 t2)MergeJoin(*VALUES* t3 t2 t1)"
-DETAIL: Relation name "*VALUES*" is ambiguous.
-INFO: hint syntax error at or near "MergeJoin(*VALUES* t3 t2 t1)"
-DETAIL: Relation name "*VALUES*" is ambiguous.
-INFO: hint syntax error at or near "Leading(*VALUES* t3 t2 t1) NestLoop(t4 t3)HashJoin(*VALUES* t3 t2)MergeJoin(*VALUES* t3 t2 t1)"
-DETAIL: Relation name "*VALUES*" is ambiguous.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-NestLoop(t3 t4)
-duplication hint:
-error hint:
-HashJoin(*VALUES* t2 t3)
-MergeJoin(*VALUES* t1 t2 t3)
-Leading(*VALUES* t3 t2 t1)
-
- QUERY PLAN
--------------------------------------------------------
- Nested Loop
- Join Filter: (t1.c1 = "*VALUES*".column1)
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
- -> Values Scan on "*VALUES*"
-(11 rows)
-
-----
----- No. J-3-1 join method hint
-----
--- No. J-3-1-1~6
-SET enable_nestloop TO on;
-SET enable_mergejoin TO off;
-SET enable_hashjoin TO off;
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-------------------------------------
- Nested Loop
- -> Seq Scan on t2
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
-(4 rows)
-
-/*+NestLoop(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Nested Loop
- -> Seq Scan on t2
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
-(4 rows)
-
-/*+HashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-/*+MergeJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(6 rows)
-
-SET enable_mergejoin TO on;
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';;
- QUERY PLAN
------------------------------------------
- Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
-(5 rows)
-
-/*+NoNestLoop(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';;
-LOG: pg_hint_plan:
-used hint:
-NoNestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Sort
- Sort Key: t1.c1
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(9 rows)
-
-SET enable_mergejoin TO off;
-/*+NoHashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NoHashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Nested Loop
- -> Seq Scan on t2
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
-(4 rows)
-
-/*+NoMergeJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NoMergeJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Nested Loop
- -> Seq Scan on t2
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
-(4 rows)
-
--- No. J-3-1-7~12
-SET enable_nestloop TO off;
-SET enable_mergejoin TO off;
-SET enable_hashjoin TO on;
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-/*+NestLoop(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Nested Loop
- -> Seq Scan on t2
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
-(4 rows)
-
-/*+HashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-/*+MergeJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(6 rows)
-
-/*+NoNestLoop(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NoNestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-/*+NoHashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NoHashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Nested Loop
- -> Seq Scan on t2
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
-(4 rows)
-
-/*+NoMergeJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NoMergeJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
--- No. J-3-1-13~18
-SET enable_nestloop TO off;
-SET enable_mergejoin TO on;
-SET enable_hashjoin TO off;
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(6 rows)
-
-/*+NestLoop(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Nested Loop
- -> Seq Scan on t2
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
-(4 rows)
-
-/*+HashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-/*+MergeJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(6 rows)
-
-/*+NoNestLoop(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NoNestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(6 rows)
-
-/*+NoHashJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NoHashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(6 rows)
-
-/*+NoMergeJoin(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-NoMergeJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Nested Loop
- -> Seq Scan on t2
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
-(4 rows)
-
-SET enable_nestloop TO on;
-SET enable_mergejoin TO on;
-SET enable_hashjoin TO on;
-----
----- No. J-3-2 join inherit tables
-----
-EXPLAIN (COSTS false) SELECT * FROM s1.p1, s1.p2 WHERE p1.c1 = p2.c1;
- QUERY PLAN
----------------------------------------
- Hash Join
- Hash Cond: (s1.p2.c1 = s1.p1.c1)
- -> Append
- -> Seq Scan on p2
- -> Seq Scan on p2c1 p2
- -> Seq Scan on p2c2 p2
- -> Seq Scan on p2c3 p2
- -> Seq Scan on p2c1c1 p2
- -> Seq Scan on p2c1c2 p2
- -> Seq Scan on p2c2c1 p2
- -> Seq Scan on p2c2c2 p2
- -> Seq Scan on p2c3c1 p2
- -> Seq Scan on p2c3c2 p2
- -> Hash
- -> Append
- -> Seq Scan on p1
- -> Seq Scan on p1c1 p1
- -> Seq Scan on p1c2 p1
- -> Seq Scan on p1c3 p1
-(19 rows)
-
--- No. J-3-2-1
-/*+MergeJoin(p1 p2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.p1, s1.p2 WHERE p1.c1 = p2.c1;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(p1 p2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Merge Join
- Merge Cond: (s1.p1.c1 = s1.p2.c1)
- -> Sort
- Sort Key: s1.p1.c1
- -> Append
- -> Seq Scan on p1
- -> Seq Scan on p1c1 p1
- -> Seq Scan on p1c2 p1
- -> Seq Scan on p1c3 p1
- -> Sort
- Sort Key: s1.p2.c1
- -> Append
- -> Seq Scan on p2
- -> Seq Scan on p2c1 p2
- -> Seq Scan on p2c2 p2
- -> Seq Scan on p2c3 p2
- -> Seq Scan on p2c1c1 p2
- -> Seq Scan on p2c1c2 p2
- -> Seq Scan on p2c2c1 p2
- -> Seq Scan on p2c2c2 p2
- -> Seq Scan on p2c3c1 p2
- -> Seq Scan on p2c3c2 p2
-(22 rows)
-
--- No. J-3-2-2
-/*+MergeJoin(p1c1 p2c1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.p1, s1.p2 WHERE p1.c1 = p2.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-MergeJoin(p1c1 p2c1)
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Hash Join
- Hash Cond: (s1.p2.c1 = s1.p1.c1)
- -> Append
- -> Seq Scan on p2
- -> Seq Scan on p2c1 p2
- -> Seq Scan on p2c2 p2
- -> Seq Scan on p2c3 p2
- -> Seq Scan on p2c1c1 p2
- -> Seq Scan on p2c1c2 p2
- -> Seq Scan on p2c2c1 p2
- -> Seq Scan on p2c2c2 p2
- -> Seq Scan on p2c3c1 p2
- -> Seq Scan on p2c3c2 p2
- -> Hash
- -> Append
- -> Seq Scan on p1
- -> Seq Scan on p1c1 p1
- -> Seq Scan on p1c2 p1
- -> Seq Scan on p1c3 p1
-(19 rows)
-
-----
----- No. J-3-3 conflict join method hint
-----
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(6 rows)
-
--- No. J-3-3-1
-/*+HashJoin(t1 t2)NestLoop(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO: hint syntax error at or near "HashJoin(t1 t2)NestLoop(t1 t2)"
-DETAIL: Conflict join method hint.
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-HashJoin(t1 t2)
-error hint:
-
- QUERY PLAN
-------------------------------------
- Nested Loop
- -> Seq Scan on t2
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
-(4 rows)
-
--- No. J-3-3-2
-/*+MergeJoin(t1 t2)HashJoin(t1 t2)NestLoop(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO: hint syntax error at or near "MergeJoin(t1 t2)HashJoin(t1 t2)NestLoop(t1 t2)"
-DETAIL: Conflict join method hint.
-INFO: hint syntax error at or near "HashJoin(t1 t2)NestLoop(t1 t2)"
-DETAIL: Conflict join method hint.
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-MergeJoin(t1 t2)
-HashJoin(t1 t2)
-error hint:
-
- QUERY PLAN
-------------------------------------
- Nested Loop
- -> Seq Scan on t2
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
-(4 rows)
-
--- No. J-3-3-3
-/*+HashJoin(t1 t2)NestLoop(t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO: hint syntax error at or near "HashJoin(t1 t2)NestLoop(t2 t1)"
-DETAIL: Conflict join method hint.
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-HashJoin(t1 t2)
-error hint:
-
- QUERY PLAN
-------------------------------------
- Nested Loop
- -> Seq Scan on t2
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
-(4 rows)
-
--- No. J-3-3-4
-/*+MergeJoin(t2 t1)HashJoin(t1 t2)NestLoop(t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO: hint syntax error at or near "MergeJoin(t2 t1)HashJoin(t1 t2)NestLoop(t2 t1)"
-DETAIL: Conflict join method hint.
-INFO: hint syntax error at or near "HashJoin(t1 t2)NestLoop(t2 t1)"
-DETAIL: Conflict join method hint.
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-MergeJoin(t1 t2)
-HashJoin(t1 t2)
-error hint:
-
- QUERY PLAN
-------------------------------------
- Nested Loop
- -> Seq Scan on t2
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
-(4 rows)
-
-----
----- No. J-3-4 hint state output
-----
--- No. J-3-4-1
-/*+NestLoop(t1 t2)*/
-SELECT * FROM s1.t1, s1.t2 WHERE false;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- c1 | c2 | c3 | c4 | c1 | c2 | c3 | c4
-----+----+----+----+----+----+----+----
-(0 rows)
-
--- No. J-3-4-2
-/*+HashJoin(t1 t2)*/
-SELECT * FROM s1.t1, s1.t2 WHERE false;
-LOG: pg_hint_plan:
-used hint:
-HashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- c1 | c2 | c3 | c4 | c1 | c2 | c3 | c4
-----+----+----+----+----+----+----+----
-(0 rows)
-
--- No. J-3-4-3
-/*+MergeJoin(t1 t2)*/
-SELECT * FROM s1.t1, s1.t2 WHERE false;
-LOG: pg_hint_plan:
-used hint:
-MergeJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- c1 | c2 | c3 | c4 | c1 | c2 | c3 | c4
-----+----+----+----+----+----+----+----
-(0 rows)
-
--- No. J-3-4-4
-/*+NoNestLoop(t1 t2)*/
-SELECT * FROM s1.t1, s1.t2 WHERE false;
-LOG: pg_hint_plan:
-used hint:
-NoNestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- c1 | c2 | c3 | c4 | c1 | c2 | c3 | c4
-----+----+----+----+----+----+----+----
-(0 rows)
-
--- No. J-3-4-5
-/*+NoHashJoin(t1 t2)*/
-SELECT * FROM s1.t1, s1.t2 WHERE false;
-LOG: pg_hint_plan:
-used hint:
-NoHashJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- c1 | c2 | c3 | c4 | c1 | c2 | c3 | c4
-----+----+----+----+----+----+----+----
-(0 rows)
-
--- No. J-3-4-6
-/*+NoMergeJoin(t1 t2)*/
-SELECT * FROM s1.t1, s1.t2 WHERE false;
-LOG: pg_hint_plan:
-used hint:
-NoMergeJoin(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- c1 | c2 | c3 | c4 | c1 | c2 | c3 | c4
-----+----+----+----+----+----+----+----
-(0 rows)
-
--- No. J-3-4-7
-/*+NestLoop()*/
-SELECT * FROM s1.t1 WHERE false;
-INFO: hint syntax error at or near ""
-DETAIL: NestLoop hint requires at least two relations.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-NestLoop()
-
- c1 | c2 | c3 | c4
-----+----+----+----
-(0 rows)
-
--- No. J-3-4-8
-/*+NestLoop(t1)*/
-SELECT * FROM s1.t1 WHERE false;
-INFO: hint syntax error at or near ""
-DETAIL: NestLoop hint requires at least two relations.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-NestLoop(t1)
-
- c1 | c2 | c3 | c4
-----+----+----+----
-(0 rows)
-
--- No. J-3-4-9
-/*+NestLoop(t1 t2)*/
-SELECT * FROM s1.t1, s1.t2 WHERE false;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- c1 | c2 | c3 | c4 | c1 | c2 | c3 | c4
-----+----+----+----+----+----+----+----
-(0 rows)
-
--- No. J-3-4-10
-/*+NestLoop(t1 t2 t3)*/
-SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE false;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2 t3)
-not used hint:
-duplication hint:
-error hint:
-
- c1 | c2 | c3 | c4 | c1 | c2 | c3 | c4 | c1 | c2 | c3 | c4
-----+----+----+----+----+----+----+----+----+----+----+----
-(0 rows)
-
-----
----- No. J-3-5 not used hint
-----
--- No. J-3-5-1
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 FULL OUTER JOIN s1.t2 ON (t1.c1 = t2.c1);
- QUERY PLAN
-------------------------------
- Hash Full Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 rows)
-
-/*+NestLoop(t1 t2)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.t1 FULL OUTER JOIN s1.t2 ON (t1.c1 = t2.c1);
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------------------------
- Hash Full Join (cost=10000000003.25..10000000024.00 rows=1000 width=29)
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1 (cost=0.00..16.00 rows=1000 width=15)
- -> Hash (cost=2.00..2.00 rows=100 width=14)
- -> Seq Scan on t2 (cost=0.00..2.00 rows=100 width=14)
-(5 rows)
-
+++ /dev/null
-LOAD 'pg_hint_plan';
-SET pg_hint_plan.enable_hint TO on;
-SET pg_hint_plan.debug_print TO on;
-SET client_min_messages TO LOG;
-SET search_path TO public;
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
- QUERY PLAN
-------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t4.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Scan using t4_i1 on t4
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(12 rows)
-
-----
----- No. L-1-1 specified pattern of the object name
-----
--- No. L-1-1-1
-/*+Leading(t4 t2 t3 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t2 t3 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (t4.c1 = t2.c1)
- -> Seq Scan on t4
- -> Hash
- -> Seq Scan on t2
-(14 rows)
-
--- No. L-1-1-2
-/*+Leading(t4 t2 t3 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 t_1, s1.t2 t_2, s1.t3 t_3, s1.t4 t_4 WHERE t_1.c1 = t_2.c1 AND t_1.c1 = t_3.c1 AND t_1.c1 = t_4.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-Leading(t4 t2 t3 t1)
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------
- Merge Join
- Merge Cond: (t_1.c1 = t_2.c1)
- -> Merge Join
- Merge Cond: (t_1.c1 = t_4.c1)
- -> Merge Join
- Merge Cond: (t_1.c1 = t_3.c1)
- -> Index Scan using t1_i1 on t1 t_1
- -> Index Scan using t3_i1 on t3 t_3
- -> Index Scan using t4_i1 on t4 t_4
- -> Sort
- Sort Key: t_2.c1
- -> Seq Scan on t2 t_2
-(12 rows)
-
--- No. L-1-1-3
-/*+Leading(t_4 t_2 t_3 t_1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 t_1, s1.t2 t_2, s1.t3 t_3, s1.t4 t_4 WHERE t_1.c1 = t_2.c1 AND t_1.c1 = t_3.c1 AND t_1.c1 = t_4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t_4 t_2 t_3 t_1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------
- Merge Join
- Merge Cond: (t_1.c1 = t_2.c1)
- -> Index Scan using t1_i1 on t1 t_1
- -> Sort
- Sort Key: t_2.c1
- -> Hash Join
- Hash Cond: (t_3.c1 = t_2.c1)
- -> Seq Scan on t3 t_3
- -> Hash
- -> Hash Join
- Hash Cond: (t_4.c1 = t_2.c1)
- -> Seq Scan on t4 t_4
- -> Hash
- -> Seq Scan on t2 t_2
-(14 rows)
-
-----
----- No. L-1-2 specified schema name in the hint option
-----
--- No. L-1-2-1
-/*+Leading(t4 t2 t3 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t2 t3 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (t4.c1 = t2.c1)
- -> Seq Scan on t4
- -> Hash
- -> Seq Scan on t2
-(14 rows)
-
--- No. L-1-2-2
-/*+Leading(s1.t4 s1.t2 s1.t3 s1.t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-Leading(s1.t4 s1.t2 s1.t3 s1.t1)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t4.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Scan using t4_i1 on t4
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(12 rows)
-
-----
----- No. L-1-3 table doesn't exist in the hint option
-----
--- No. L-1-3-1
-/*+Leading(t4 t2 t3 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t2 t3 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (t4.c1 = t2.c1)
- -> Seq Scan on t4
- -> Hash
- -> Seq Scan on t2
-(14 rows)
-
--- No. L-1-3-2
-/*+Leading(t5 t2 t3 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-Leading(t5 t2 t3 t1)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t4.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Scan using t4_i1 on t4
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(12 rows)
-
-----
----- No. L-1-4 conflict table name
-----
--- No. L-1-4-1
-/*+Leading(t4 t2 t3 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t2 t3 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (t4.c1 = t2.c1)
- -> Seq Scan on t4
- -> Hash
- -> Seq Scan on t2
-(14 rows)
-
--- No. L-1-4-2
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s2.t1 WHERE s1.t1.c1 = t2.c1 AND s1.t1.c1 = t3.c1 AND s1.t1.c1 = s2.t1.c1;
- QUERY PLAN
-------------------------------------------------
- Merge Join
- Merge Cond: (s1.t1.c1 = s2.t1.c1)
- -> Merge Join
- Merge Cond: (s1.t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (s1.t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Scan using t2_i1 on t2
- -> Sort
- Sort Key: s2.t1.c1
- -> Seq Scan on t1
-(12 rows)
-
-/*+Leading(t1 t2 t3 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s2.t1 WHERE s1.t1.c1 = t2.c1 AND s1.t1.c1 = t3.c1 AND s1.t1.c1 = s2.t1.c1;
-INFO: hint syntax error at or near "Leading(t1 t2 t3 t1)"
-DETAIL: Relation name "t1" is ambiguous.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading(t1 t2 t3 t1)
-
- QUERY PLAN
-------------------------------------------------
- Merge Join
- Merge Cond: (s1.t1.c1 = s2.t1.c1)
- -> Merge Join
- Merge Cond: (s1.t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (s1.t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Scan using t2_i1 on t2
- -> Sort
- Sort Key: s2.t1.c1
- -> Seq Scan on t1
-(12 rows)
-
-/*+Leading(s1.t1 t2 t3 s2.t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s2.t1 WHERE s1.t1.c1 = t2.c1 AND s1.t1.c1 = t3.c1 AND s1.t1.c1 = s2.t1.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-Leading(s1.t1 t2 t3 s2.t1)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Merge Join
- Merge Cond: (s1.t1.c1 = s2.t1.c1)
- -> Merge Join
- Merge Cond: (s1.t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (s1.t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Scan using t2_i1 on t2
- -> Sort
- Sort Key: s2.t1.c1
- -> Seq Scan on t1
-(12 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s2.t1 s2t1 WHERE s1.t1.c1 = t2.c1 AND s1.t1.c1 = t3.c1 AND s1.t1.c1 = s2t1.c1;
- QUERY PLAN
-------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = s2t1.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Scan using t2_i1 on t2
- -> Sort
- Sort Key: s2t1.c1
- -> Seq Scan on t1 s2t1
-(12 rows)
-
-/*+Leading(s2t1 t1 t3 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s2.t1 s2t1 WHERE s1.t1.c1 = t2.c1 AND s1.t1.c1 = t3.c1 AND s1.t1.c1 = s2t1.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(s2t1 t1 t3 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Merge Join
- Merge Cond: (t1.c1 = s2t1.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t1_pkey on t1 s2t1
- -> Index Scan using t3_i1 on t3
- Index Cond: (c1 = t1.c1)
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(12 rows)
-
--- No. L-1-4-3
-EXPLAIN (COSTS false) SELECT *, (SELECT max(t1.c1) FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1) FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
- QUERY PLAN
--------------------------------------------------------------------
- Merge Join
- Merge Cond: (s1.t1.c1 = s1.t2.c1)
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Merge Join
- Merge Cond: (s1.t1.c1 = s1.t2.c1)
- -> Merge Join
- Merge Cond: (s1.t1.c1 = s1.t4.c1)
- -> Merge Join
- Merge Cond: (s1.t1.c1 = s1.t3.c1)
- -> Index Only Scan using t1_i1 on t1
- -> Index Only Scan using t3_i1 on t3
- -> Index Only Scan using t4_i1 on t4
- -> Sort
- Sort Key: s1.t2.c1
- -> Seq Scan on t2
- -> Merge Join
- Merge Cond: (s1.t1.c1 = s1.t4.c1)
- -> Merge Join
- Merge Cond: (s1.t1.c1 = s1.t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Scan using t4_i1 on t4
- -> Sort
- Sort Key: s1.t2.c1
- -> Seq Scan on t2
-(26 rows)
-
-/*+Leading(t4 t2 t3 t1)*/
-EXPLAIN (COSTS false) SELECT *, (SELECT max(t1.c1) FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1) FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t2 t3 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------------------------
- Merge Join
- Merge Cond: (s1.t1.c1 = s1.t2.c1)
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Merge Join
- Merge Cond: (s1.t1.c1 = s1.t2.c1)
- -> Index Only Scan using t1_i1 on t1
- -> Sort
- Sort Key: s1.t2.c1
- -> Hash Join
- Hash Cond: (s1.t3.c1 = s1.t2.c1)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (s1.t4.c1 = s1.t2.c1)
- -> Seq Scan on t4
- -> Hash
- -> Seq Scan on t2
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: s1.t2.c1
- -> Hash Join
- Hash Cond: (s1.t3.c1 = s1.t2.c1)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (s1.t4.c1 = s1.t2.c1)
- -> Seq Scan on t4
- -> Hash
- -> Seq Scan on t2
-(30 rows)
-
-/*+Leading(st1 st2 st3 st4)Leading(t4 t2 t3 t1)*/
-EXPLAIN (COSTS false) SELECT *, (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2, s1.t3 st3, s1.t4 st4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1) FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(st1 st2 st3 st4)
-Leading(t4 t2 t3 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (t4.c1 = t2.c1)
- -> Seq Scan on t4
- -> Hash
- -> Seq Scan on t2
- SubPlan 1
- -> Aggregate
- -> Result
- One-Time Filter: ((t1.c1 = t2.c1) AND (t1.c1 = t3.c1) AND (t1.c1 = t4.c1))
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Seq Scan on t1 st1
- -> Materialize
- -> Seq Scan on t2 st2
- -> Materialize
- -> Seq Scan on t3 st3
- -> Materialize
- -> Seq Scan on t4 st4
-(28 rows)
-
-----
----- No. L-1-5 conflict table name
-----
--- No. L-1-5-1
-/*+Leading(t4 t2 t3 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t2 t3 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (t4.c1 = t2.c1)
- -> Seq Scan on t4
- -> Hash
- -> Seq Scan on t2
-(14 rows)
-
--- No. L-1-5-2
-/*+Leading(t4 t2 t3 t1 t4)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near "Leading(t4 t2 t3 t1 t4)"
-DETAIL: Relation name "t4" is duplicated.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading(t4 t2 t3 t1 t4)
-
- QUERY PLAN
-------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t4.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Scan using t4_i1 on t4
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(12 rows)
-
-/*+Leading(t4 t2 t3 t4)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near "Leading(t4 t2 t3 t4)"
-DETAIL: Relation name "t4" is duplicated.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading(t4 t2 t3 t4)
-
- QUERY PLAN
-------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t4.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Scan using t4_i1 on t4
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(12 rows)
-
--- No. L-1-5-3
-/*+Leading(t4 t2 t3 t1 t4 t2 t3 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near "Leading(t4 t2 t3 t1 t4 t2 t3 t1)"
-DETAIL: Relation name "t4" is duplicated.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading(t4 t2 t3 t1 t4 t2 t3 t1)
-
- QUERY PLAN
-------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t4.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Scan using t4_i1 on t4
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(12 rows)
-
-/*+Leading(t4 t2 t2 t4)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near "Leading(t4 t2 t2 t4)"
-DETAIL: Relation name "t2" is duplicated.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading(t4 t2 t2 t4)
-
- QUERY PLAN
-------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t4.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Scan using t4_i1 on t4
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(12 rows)
-
-----
----- No. L-1-6 object type for the hint
-----
--- No. L-1-6-1
-/*+Leading(t4 t2 t3 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t2 t3 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (t4.c1 = t2.c1)
- -> Seq Scan on t4
- -> Hash
- -> Seq Scan on t2
-(14 rows)
-
--- No. L-1-6-2
-EXPLAIN (COSTS false) SELECT * FROM s1.p1 t1, s1.p1 t2, s1.p1 t3, s1.p1 t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
- QUERY PLAN
----------------------------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t4.c1)
- -> Hash Join
- Hash Cond: (t1.c1 = t3.c1)
- -> Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Append
- -> Seq Scan on p1 t1
- -> Seq Scan on p1c1 t1
- -> Seq Scan on p1c2 t1
- -> Seq Scan on p1c3 t1
- -> Hash
- -> Append
- -> Seq Scan on p1 t2
- -> Seq Scan on p1c1 t2
- -> Seq Scan on p1c2 t2
- -> Seq Scan on p1c3 t2
- -> Hash
- -> Append
- -> Seq Scan on p1 t3
- -> Seq Scan on p1c1 t3
- -> Seq Scan on p1c2 t3
- -> Seq Scan on p1c3 t3
- -> Hash
- -> Append
- -> Seq Scan on p1 t4
- -> Seq Scan on p1c1 t4
- -> Seq Scan on p1c2 t4
- -> Seq Scan on p1c3 t4
-(29 rows)
-
-/*+Leading(t4 t3 t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.p1 t1, s1.p1 t2, s1.p1 t3, s1.p1 t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t3 t2 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------
- Hash Join
- Hash Cond: (t2.c1 = t1.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t4.c1)
- -> Append
- -> Seq Scan on p1 t3
- -> Seq Scan on p1c1 t3
- -> Seq Scan on p1c2 t3
- -> Seq Scan on p1c3 t3
- -> Hash
- -> Append
- -> Seq Scan on p1 t4
- -> Seq Scan on p1c1 t4
- -> Seq Scan on p1c2 t4
- -> Seq Scan on p1c3 t4
- -> Hash
- -> Append
- -> Seq Scan on p1 t2
- -> Seq Scan on p1c1 t2
- -> Seq Scan on p1c2 t2
- -> Seq Scan on p1c3 t2
- -> Hash
- -> Append
- -> Seq Scan on p1 t1
- -> Seq Scan on p1c1 t1
- -> Seq Scan on p1c2 t1
- -> Seq Scan on p1c3 t1
-(29 rows)
-
--- No. L-1-6-3
-EXPLAIN (COSTS false) SELECT * FROM s1.ul1 t1, s1.ul1 t2, s1.ul1 t3, s1.ul1 t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
- QUERY PLAN
---------------------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t4.c1)
- -> Hash Join
- Hash Cond: (t1.c1 = t3.c1)
- -> Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on ul1 t1
- -> Hash
- -> Seq Scan on ul1 t2
- -> Hash
- -> Seq Scan on ul1 t3
- -> Hash
- -> Seq Scan on ul1 t4
-(13 rows)
-
-/*+Leading(t4 t3 t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ul1 t1, s1.ul1 t2, s1.ul1 t3, s1.ul1 t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t3 t2 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------
- Hash Join
- Hash Cond: (t2.c1 = t1.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t4.c1)
- -> Seq Scan on ul1 t3
- -> Hash
- -> Seq Scan on ul1 t4
- -> Hash
- -> Seq Scan on ul1 t2
- -> Hash
- -> Seq Scan on ul1 t1
-(13 rows)
-
--- No. L-1-6-4
-CREATE TEMP TABLE tm1 (LIKE s1.t1 INCLUDING ALL);
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "tm1_pkey" for table "tm1"
-EXPLAIN (COSTS false) SELECT * FROM tm1 t1, tm1 t2, tm1 t3, tm1 t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
- QUERY PLAN
---------------------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t4.c1)
- -> Hash Join
- Hash Cond: (t1.c1 = t3.c1)
- -> Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on tm1 t1
- -> Hash
- -> Seq Scan on tm1 t2
- -> Hash
- -> Seq Scan on tm1 t3
- -> Hash
- -> Seq Scan on tm1 t4
-(13 rows)
-
-/*+Leading(t4 t3 t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM tm1 t1, tm1 t2, tm1 t3, tm1 t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t3 t2 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------
- Hash Join
- Hash Cond: (t2.c1 = t1.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t4.c1)
- -> Seq Scan on tm1 t3
- -> Hash
- -> Seq Scan on tm1 t4
- -> Hash
- -> Seq Scan on tm1 t2
- -> Hash
- -> Seq Scan on tm1 t1
-(13 rows)
-
--- No. L-1-6-5
-EXPLAIN (COSTS false) SELECT * FROM pg_catalog.pg_class t1, pg_catalog.pg_class t2, pg_catalog.pg_class t3, pg_catalog.pg_class t4 WHERE t1.oid = t2.oid AND t1.oid = t3.oid AND t1.oid = t4.oid;
- QUERY PLAN
--------------------------------------------------
- Hash Join
- Hash Cond: (t1.oid = t4.oid)
- -> Hash Join
- Hash Cond: (t1.oid = t3.oid)
- -> Hash Join
- Hash Cond: (t1.oid = t2.oid)
- -> Seq Scan on pg_class t1
- -> Hash
- -> Seq Scan on pg_class t2
- -> Hash
- -> Seq Scan on pg_class t3
- -> Hash
- -> Seq Scan on pg_class t4
-(13 rows)
-
-/*+Leading(t4 t3 t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM pg_catalog.pg_class t1, pg_catalog.pg_class t2, pg_catalog.pg_class t3, pg_catalog.pg_class t4 WHERE t1.oid = t2.oid AND t1.oid = t3.oid AND t1.oid = t4.oid;
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t3 t2 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------
- Hash Join
- Hash Cond: (t2.oid = t1.oid)
- -> Hash Join
- Hash Cond: (t3.oid = t2.oid)
- -> Hash Join
- Hash Cond: (t3.oid = t4.oid)
- -> Seq Scan on pg_class t3
- -> Hash
- -> Seq Scan on pg_class t4
- -> Hash
- -> Seq Scan on pg_class t2
- -> Hash
- -> Seq Scan on pg_class t1
-(13 rows)
-
--- No. L-1-6-6
--- refer ut-fdw.sql
--- No. L-1-6-7
-EXPLAIN (COSTS false) SELECT * FROM s1.f1() t1, s1.f1() t2, s1.f1() t3, s1.f1() t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
- QUERY PLAN
---------------------------------------------
- Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Function Scan on f1 t1
- -> Function Scan on f1 t2
- -> Function Scan on f1 t3
- -> Function Scan on f1 t4
-(10 rows)
-
-/*+Leading(t4 t3 t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.f1() t1, s1.f1() t2, s1.f1() t3, s1.f1() t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t3 t2 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------
- Nested Loop
- Join Filter: (t2.c1 = t1.c1)
- -> Nested Loop
- Join Filter: (t3.c1 = t2.c1)
- -> Nested Loop
- Join Filter: (t3.c1 = t4.c1)
- -> Function Scan on f1 t3
- -> Function Scan on f1 t4
- -> Function Scan on f1 t2
- -> Function Scan on f1 t1
-(10 rows)
-
--- No. L-1-6-8
-EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1, c2, c3, c4), s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
- QUERY PLAN
--------------------------------------------------------
- Nested Loop
- Join Filter: ("*VALUES*".column1 = t4.c1)
- -> Nested Loop
- Join Filter: ("*VALUES*".column1 = t3.c1)
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Index Scan using t3_i1 on t3
- Index Cond: (c1 = t2.c1)
- -> Index Scan using t4_i1 on t4
- Index Cond: (c1 = t3.c1)
-(13 rows)
-
-/*+Leading(t4 t3 t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1, c2, c3, c4), s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-Leading(t4 t3 t2 t1)
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------
- Nested Loop
- Join Filter: ("*VALUES*".column1 = t4.c1)
- -> Nested Loop
- Join Filter: ("*VALUES*".column1 = t3.c1)
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Index Scan using t3_i1 on t3
- Index Cond: (c1 = t2.c1)
- -> Index Scan using t4_i1 on t4
- Index Cond: (c1 = t3.c1)
-(13 rows)
-
--- No. L-1-6-9
-EXPLAIN (COSTS false) WITH c1(c1) AS (SELECT st1.c1 FROM s1.t1 st1, s1.t1 st2, s1.t1 st3, s1.t1 st4 WHERE st1.c1 = st2.c1 AND st1.c1 = st3.c1 AND st1.c1 = st4.c1) SELECT * FROM c1 ct1, c1 ct2, c1 ct3, c1 ct4 WHERE ct1.c1 = ct2.c1 AND ct1.c1 = ct3.c1 AND ct1.c1 = ct4.c1;
- QUERY PLAN
-----------------------------------------------------
- Merge Join
- Merge Cond: (ct1.c1 = ct3.c1)
- CTE c1
- -> Hash Join
- Hash Cond: (st1.c1 = st4.c1)
- -> Hash Join
- Hash Cond: (st1.c1 = st3.c1)
- -> Hash Join
- Hash Cond: (st1.c1 = st2.c1)
- -> Seq Scan on t1 st1
- -> Hash
- -> Seq Scan on t1 st2
- -> Hash
- -> Seq Scan on t1 st3
- -> Hash
- -> Seq Scan on t1 st4
- -> Merge Join
- Merge Cond: (ct1.c1 = ct2.c1)
- -> Sort
- Sort Key: ct1.c1
- -> CTE Scan on c1 ct1
- -> Sort
- Sort Key: ct2.c1
- -> CTE Scan on c1 ct2
- -> Materialize
- -> Merge Join
- Merge Cond: (ct3.c1 = ct4.c1)
- -> Sort
- Sort Key: ct3.c1
- -> CTE Scan on c1 ct3
- -> Sort
- Sort Key: ct4.c1
- -> CTE Scan on c1 ct4
-(33 rows)
-
-/*+Leading(ct4 ct3 ct2 ct1)Leading(st4 st3 st2 st1)*/
-EXPLAIN (COSTS false) WITH c1(c1) AS (SELECT st1.c1 FROM s1.t1 st1, s1.t1 st2, s1.t1 st3, s1.t1 st4 WHERE st1.c1 = st2.c1 AND st1.c1 = st3.c1 AND st1.c1 = st4.c1) SELECT * FROM c1 ct1, c1 ct2, c1 ct3, c1 ct4 WHERE ct1.c1 = ct2.c1 AND ct1.c1 = ct3.c1 AND ct1.c1 = ct4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(ct4 ct3 ct2 ct1)
-Leading(st4 st3 st2 st1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------
- Merge Join
- Merge Cond: (ct1.c1 = ct2.c1)
- CTE c1
- -> Hash Join
- Hash Cond: (st2.c1 = st1.c1)
- -> Hash Join
- Hash Cond: (st3.c1 = st2.c1)
- -> Hash Join
- Hash Cond: (st3.c1 = st4.c1)
- -> Seq Scan on t1 st3
- -> Hash
- -> Seq Scan on t1 st4
- -> Hash
- -> Seq Scan on t1 st2
- -> Hash
- -> Seq Scan on t1 st1
- -> Sort
- Sort Key: ct1.c1
- -> CTE Scan on c1 ct1
- -> Materialize
- -> Merge Join
- Merge Cond: (ct2.c1 = ct3.c1)
- -> Sort
- Sort Key: ct2.c1
- -> CTE Scan on c1 ct2
- -> Materialize
- -> Merge Join
- Merge Cond: (ct3.c1 = ct4.c1)
- -> Sort
- Sort Key: ct3.c1
- -> CTE Scan on c1 ct3
- -> Sort
- Sort Key: ct4.c1
- -> CTE Scan on c1 ct4
-(34 rows)
-
--- No. L-1-6-10
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 t1, s1.v1 t2, s1.v1 t3, s1.v1 t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
- QUERY PLAN
-----------------------------------------------
- Hash Join
- Hash Cond: (v1t1.c1 = v1t1.c1)
- -> Hash Join
- Hash Cond: (v1t1.c1 = v1t1.c1)
- -> Hash Join
- Hash Cond: (v1t1.c1 = v1t1.c1)
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1
-(13 rows)
-
-/*+Leading(t4 t3 t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 t1, s1.v1 t2, s1.v1 t3, s1.v1 t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-Leading(t4 t3 t2 t1)
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------
- Hash Join
- Hash Cond: (v1t1.c1 = v1t1.c1)
- -> Hash Join
- Hash Cond: (v1t1.c1 = v1t1.c1)
- -> Hash Join
- Hash Cond: (v1t1.c1 = v1t1.c1)
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1
-(13 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 t1, s1.v1_ t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
- QUERY PLAN
----------------------------------------------
- Hash Join
- Hash Cond: (v1t1.c1 = t4.c1)
- -> Hash Join
- Hash Cond: (v1t1.c1 = v1t1_.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = v1t1.c1)
- -> Seq Scan on t3
- -> Hash
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1_
- -> Hash
- -> Seq Scan on t4
-(13 rows)
-
-/*+Leading(t4 v1t1_ v1t1 t3)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 t1, s1.v1_ t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 v1t1_ v1t1 t3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------
- Hash Join
- Hash Cond: (v1t1.c1 = t3.c1)
- -> Hash Join
- Hash Cond: (v1t1_.c1 = v1t1.c1)
- -> Hash Join
- Hash Cond: (t4.c1 = v1t1_.c1)
- -> Seq Scan on t4
- -> Hash
- -> Seq Scan on t1 v1t1_
- -> Hash
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t3
-(13 rows)
-
--- No. L-1-6-11
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, (SELECT t4.c1 FROM s1.t4) st4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = st4.c1;
- QUERY PLAN
-------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t4.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Only Scan using t4_i1 on t4
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(12 rows)
-
-/*+Leading(st4 t2 t3 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, (SELECT t4.c1 FROM s1.t4) st4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = st4.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-Leading(st4 t2 t3 t1)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t4.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Only Scan using t4_i1 on t4
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(12 rows)
-
-/*+Leading(t4 t2 t3 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, (SELECT t4.c1 FROM s1.t4) st4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = st4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t2 t3 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (t4.c1 = t2.c1)
- -> Seq Scan on t4
- -> Hash
- -> Seq Scan on t2
-(14 rows)
-
-----
----- No. L-2-1 some complexity query blocks
-----
--- No. L-2-1-1
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1), (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
-;
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(47 rows)
-
-/*+
-Leading(bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-*/
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1), (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
-;
-LOG: pg_hint_plan:
-used hint:
-Leading(bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t3.c1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Nested Loop
- Join Filter: (b2t3.c1 = b2t1.c1)
- -> Nested Loop
- Join Filter: (b2t3.c1 = b2t4.c1)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(47 rows)
-
--- No. L-2-1-2
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1), (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-), (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
-;
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(63 rows)
-
-/*+
-Leading(bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-Leading(b3t4 b3t1 b3t2 b3t3)
-*/
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1), (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-), (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
-;
-LOG: pg_hint_plan:
-used hint:
-Leading(bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-Leading(b3t4 b3t1 b3t2 b3t3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t3.c1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Nested Loop
- Join Filter: (b2t3.c1 = b2t1.c1)
- -> Nested Loop
- Join Filter: (b2t3.c1 = b2t4.c1)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(63 rows)
-
--- No. L-2-1-3
-EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = sbmt3.c1 AND sbmt3.ctid = '(1,1)' AND bmt1.c1 = sbmt4.c1 AND sbmt4.ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(15 rows)
-
-/*+
-Leading(bmt4 bmt3 bmt2 bmt1)
-*/
-EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = sbmt3.c1 AND sbmt3.ctid = '(1,1)' AND bmt1.c1 = sbmt4.c1 AND sbmt4.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-Leading(bmt4 bmt3 bmt2 bmt1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (bmt2.c1 = bmt1.c1)
- -> Nested Loop
- Join Filter: (bmt3.c1 = bmt2.c1)
- -> Nested Loop
- Join Filter: (bmt3.c1 = bmt4.c1)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
-(15 rows)
-
--- No. L-2-1-4
-EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = sbmt2.c1 AND sbmt2.ctid = '(1,1)' AND bmt1.c1 = sbmt3.c1 AND sbmt3.ctid = '(1,1)' AND bmt1.c1 = sbmt4.c1 AND sbmt4.ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(15 rows)
-
-/*+
-Leading(bmt4 bmt3 bmt2 bmt1)
-*/
-EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = sbmt2.c1 AND sbmt2.ctid = '(1,1)' AND bmt1.c1 = sbmt3.c1 AND sbmt3.ctid = '(1,1)' AND bmt1.c1 = sbmt4.c1 AND sbmt4.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-Leading(bmt4 bmt3 bmt2 bmt1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (bmt2.c1 = bmt1.c1)
- -> Nested Loop
- Join Filter: (bmt3.c1 = bmt2.c1)
- -> Nested Loop
- Join Filter: (bmt3.c1 = bmt4.c1)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
-(15 rows)
-
--- No. L-2-1-5
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
- AND bmt1.c1 <> (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-) AND bmt1.c1 <> (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
-;
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 <> $0) AND (c1 <> $1))
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(48 rows)
-
-/*+
-Leading(bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-*/
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
- AND bmt1.c1 <> (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-) AND bmt1.c1 <> (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
-;
-LOG: pg_hint_plan:
-used hint:
-Leading(bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t3.c1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Nested Loop
- Join Filter: (b2t3.c1 = b2t1.c1)
- -> Nested Loop
- Join Filter: (b2t3.c1 = b2t4.c1)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 <> $0) AND (c1 <> $1))
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(48 rows)
-
--- No. L-2-1-6
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
- AND bmt1.c1 <> (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-) AND bmt1.c1 <> (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-) AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
-;
- QUERY PLAN
-------------------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 <> $0) AND (c1 <> $1) AND (c1 <> $2))
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(64 rows)
-
-/*+
-Leading(bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-Leading(b3t4 b3t1 b3t2 b3t3)
-*/
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
- AND bmt1.c1 <> (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-) AND bmt1.c1 <> (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-) AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
-;
-LOG: pg_hint_plan:
-used hint:
-Leading(bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-Leading(b3t4 b3t1 b3t2 b3t3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t3.c1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Nested Loop
- Join Filter: (b2t3.c1 = b2t1.c1)
- -> Nested Loop
- Join Filter: (b2t3.c1 = b2t4.c1)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 <> $0) AND (c1 <> $1) AND (c1 <> $2))
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(64 rows)
-
--- No. L-2-1-7
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-, c2 (c1) AS (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
-, c1, c2
- WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
-AND bmt1.c1 = c1.c1
-AND bmt1.c1 = c2.c1
-;
- QUERY PLAN
------------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- CTE c2
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c2.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c1.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
- -> CTE Scan on c2
-(53 rows)
-
-/*+
-Leading(c2 c1 bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-, c2 (c1) AS (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
-, c1, c2
- WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
-AND bmt1.c1 = c1.c1
-AND bmt1.c1 = c2.c1
-;
-LOG: pg_hint_plan:
-used hint:
-Leading(c2 c1 bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t3.c1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- CTE c2
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Nested Loop
- Join Filter: (b2t3.c1 = b2t1.c1)
- -> Nested Loop
- Join Filter: (b2t3.c1 = b2t4.c1)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Nested Loop
- Join Filter: (c1.c1 = bmt1.c1)
- -> Nested Loop
- Join Filter: (c1.c1 = c2.c1)
- -> CTE Scan on c1
- -> CTE Scan on c2
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(53 rows)
-
--- No. L-2-1-8
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-, c2 (c1) AS (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
-, c3 (c1) AS (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
-, c1, c2, c3
- WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
-AND bmt1.c1 = c1.c1
-AND bmt1.c1 = c2.c1
-AND bmt1.c1 = c3.c1
-;
- QUERY PLAN
------------------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- CTE c2
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- CTE c3
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c2.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c1.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
- -> CTE Scan on c2
- -> CTE Scan on c3
-(72 rows)
-
-/*+
-Leading(c3 c2 c1 bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-Leading(b3t4 b3t1 b3t2 b3t3)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-, c2 (c1) AS (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
-, c3 (c1) AS (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
-, c1, c2, c3
- WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
-AND bmt1.c1 = c1.c1
-AND bmt1.c1 = c2.c1
-AND bmt1.c1 = c3.c1
-;
-LOG: pg_hint_plan:
-used hint:
-Leading(c3 c2 c1 bmt1 bmt2 bmt3 bmt4)
-Leading(b1t2 b1t3 b1t4 b1t1)
-Leading(b2t3 b2t4 b2t1 b2t2)
-Leading(b3t4 b3t1 b3t2 b3t3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t3.c1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- CTE c2
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Nested Loop
- Join Filter: (b2t3.c1 = b2t1.c1)
- -> Nested Loop
- Join Filter: (b2t3.c1 = b2t4.c1)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- CTE c3
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Nested Loop
- Join Filter: (c1.c1 = bmt1.c1)
- -> Nested Loop
- Join Filter: (c2.c1 = c1.c1)
- -> Nested Loop
- Join Filter: (c2.c1 = c3.c1)
- -> CTE Scan on c2
- -> CTE Scan on c3
- -> CTE Scan on c1
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
-(72 rows)
-
-----
----- No. L-2-2 the number of the tables per quiry block
-----
--- No. L-2-2-1
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = 1
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
-)
- FROM s1.t1 bmt1, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = 1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = 1
-)
-;
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 4 (returns $3)
- -> Result
- InitPlan 3 (returns $2)
- -> Limit
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 6 (returns $5)
- -> Result
- InitPlan 5 (returns $4)
- -> Limit
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- -> Nested Loop
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 <> $5) AND (c1 = 1))
- -> CTE Scan on c1
-(27 rows)
-
-/*+
-Leading(c1 bmt1)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = 1
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
-)
- FROM s1.t1 bmt1, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = 1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = 1
-)
-;
-LOG: pg_hint_plan:
-used hint:
-Leading(c1 bmt1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 4 (returns $3)
- -> Result
- InitPlan 3 (returns $2)
- -> Limit
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 6 (returns $5)
- -> Result
- InitPlan 5 (returns $4)
- -> Limit
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- -> Nested Loop
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 <> $5) AND (c1 = 1))
- -> CTE Scan on c1
-(27 rows)
-
--- No. L-2-2-2
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)'
-AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)'
-)
-;
- QUERY PLAN
--------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c1.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $2)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
-(35 rows)
-
-/*+
-Leading(c1 bmt2 bmt1)
-Leading(b1t2 b1t1)
-Leading(b2t2 b2t1)
-Leading(b3t2 b3t1)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)'
-AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)'
-)
-;
-LOG: pg_hint_plan:
-used hint:
-Leading(c1 bmt2 bmt1)
-Leading(b1t2 b1t1)
-Leading(b2t2 b2t1)
-Leading(b3t2 b3t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt2.c1 = bmt1.c1)
- -> Nested Loop
- Join Filter: (bmt2.c1 = c1.c1)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $2)
-(35 rows)
-
--- No. L-2-2-3
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
-;
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c1.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $2)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
-(67 rows)
-
-/*+
-Leading(c1 bmt4 bmt3 bmt2 bmt1)
-Leading(b1t4 b1t3 b1t2 b1t1)
-Leading(b2t4 b2t3 b2t2 b2t1)
-Leading(b3t4 b3t3 b3t2 b3t1)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
-;
-LOG: pg_hint_plan:
-used hint:
-Leading(c1 bmt4 bmt3 bmt2 bmt1)
-Leading(b1t4 b1t3 b1t2 b1t1)
-Leading(b2t4 b2t3 b2t2 b2t1)
-Leading(b3t4 b3t3 b3t2 b3t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- Join Filter: (b1t3.c1 = b1t2.c1)
- -> Nested Loop
- Join Filter: (b1t3.c1 = b1t4.c1)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t2.c1 = b2t1.c1)
- -> Nested Loop
- Join Filter: (b2t3.c1 = b2t2.c1)
- -> Nested Loop
- Join Filter: (b2t3.c1 = b2t4.c1)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t2.c1 = b3t1.c1)
- -> Nested Loop
- Join Filter: (b3t3.c1 = b3t2.c1)
- -> Nested Loop
- Join Filter: (b3t3.c1 = b3t4.c1)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt2.c1 = bmt1.c1)
- -> Nested Loop
- Join Filter: (bmt3.c1 = bmt2.c1)
- -> Nested Loop
- Join Filter: (bmt4.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt4.c1 = c1.c1)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $2)
-(67 rows)
-
--- No. L-2-2-4
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
-)
-;
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Result
- InitPlan 2 (returns $1)
- -> Limit
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 4 (returns $3)
- -> Aggregate
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c1.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $3)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
-(46 rows)
-
-/*+
-Leading(c1 bmt4 bmt3 bmt2 bmt1)
-Leading(b1t4 b1t3 b1t2 b1t1)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
-)
-;
-LOG: pg_hint_plan:
-used hint:
-Leading(c1 bmt4 bmt3 bmt2 bmt1)
-Leading(b1t4 b1t3 b1t2 b1t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- Join Filter: (b1t3.c1 = b1t2.c1)
- -> Nested Loop
- Join Filter: (b1t3.c1 = b1t4.c1)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Result
- InitPlan 2 (returns $1)
- -> Limit
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 4 (returns $3)
- -> Aggregate
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt2.c1 = bmt1.c1)
- -> Nested Loop
- Join Filter: (bmt3.c1 = bmt2.c1)
- -> Nested Loop
- Join Filter: (bmt4.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt4.c1 = c1.c1)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $3)
-(46 rows)
-
-----
----- No. L-2-3 RULE or VIEW
-----
--- No. L-2-3-1
-EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-(19 rows)
-
-/*+ Leading(t4 t3 t2 t1 r1) */
-EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t3 t2 t1 r1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (t2.c1 = t1.c1)
- -> Nested Loop
- Join Filter: (t3.c1 = t2.c1)
- -> Nested Loop
- Join Filter: (t3.c1 = t4.c1)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on r1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(19 rows)
-
-EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Tid Scan on r1_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
-(19 rows)
-
-/*+ Leading(b1t1 b1t2 b1t3 b1t4 r1_) */
-EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-Leading(b1t1 b1t2 b1t3 b1t4 r1_)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on r1_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(19 rows)
-
--- No. L-2-3-2
-EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-(39 rows)
-
-/*+ Leading(t4 t3 t2 t1 r2) */
-EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t3 t2 t1 r2)
-not used hint:
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t3 t2 t1 r2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (t2.c1 = t1.c1)
- -> Nested Loop
- Join Filter: (t3.c1 = t2.c1)
- -> Nested Loop
- Join Filter: (t3.c1 = t4.c1)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (t2.c1 = t1.c1)
- -> Nested Loop
- Join Filter: (t3.c1 = t2.c1)
- -> Nested Loop
- Join Filter: (t3.c1 = t4.c1)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(39 rows)
-
-EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Nested Loop
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
-(39 rows)
-
-/*+
-Leading(b1t1 b1t2 b1t3 b1t4 r2_)
-Leading(b2t1 b2t2 b2t3 b2t4 r2_)
-*/
-EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-Leading(b1t1 b1t2 b1t3 b1t4 r2_)
-not used hint:
-Leading(b2t1 b2t2 b2t3 b2t4 r2_)
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-Leading(b2t1 b2t2 b2t3 b2t4 r2_)
-not used hint:
-Leading(b1t1 b1t2 b1t3 b1t4 r2_)
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(39 rows)
-
--- No. L-2-3-3
-EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-(59 rows)
-
-/*+ Leading(t4 t3 t2 t1 r3) */
-EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t3 t2 t1 r3)
-not used hint:
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t3 t2 t1 r3)
-not used hint:
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-Leading(t4 t3 t2 t1 r3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (t2.c1 = t1.c1)
- -> Nested Loop
- Join Filter: (t3.c1 = t2.c1)
- -> Nested Loop
- Join Filter: (t3.c1 = t4.c1)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (t2.c1 = t1.c1)
- -> Nested Loop
- Join Filter: (t3.c1 = t2.c1)
- -> Nested Loop
- Join Filter: (t3.c1 = t4.c1)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (t2.c1 = t1.c1)
- -> Nested Loop
- Join Filter: (t3.c1 = t2.c1)
- -> Nested Loop
- Join Filter: (t3.c1 = t4.c1)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(59 rows)
-
-EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
-(59 rows)
-
-/*+
-Leading(b1t1 b1t2 b1t3 b1t4 r3_)
-Leading(b2t1 b2t2 b2t3 b2t4 r3_)
-Leading(b3t1 b3t2 b3t3 b3t4 r3_)
-*/
-EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-Leading(b1t1 b1t2 b1t3 b1t4 r3_)
-not used hint:
-Leading(b2t1 b2t2 b2t3 b2t4 r3_)
-Leading(b3t1 b3t2 b3t3 b3t4 r3_)
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-Leading(b2t1 b2t2 b2t3 b2t4 r3_)
-not used hint:
-Leading(b1t1 b1t2 b1t3 b1t4 r3_)
-Leading(b3t1 b3t2 b3t3 b3t4 r3_)
-duplication hint:
-error hint:
-
-LOG: pg_hint_plan:
-used hint:
-Leading(b3t1 b3t2 b3t3 b3t4 r3_)
-not used hint:
-Leading(b1t1 b1t2 b1t3 b1t4 r3_)
-Leading(b2t1 b2t2 b2t3 b2t4 r3_)
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(59 rows)
-
--- No. L-2-3-4
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
- QUERY PLAN
-----------------------------------
- Hash Join
- Hash Cond: (v1t1.c1 = v1t1.c1)
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1
-(5 rows)
-
-/*+Leading(v1t1 v1t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
-INFO: hint syntax error at or near "Leading(v1t1 v1t1)"
-DETAIL: Relation name "v1t1" is ambiguous.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading(v1t1 v1t1)
-
- QUERY PLAN
-----------------------------------
- Hash Join
- Hash Cond: (v1t1.c1 = v1t1.c1)
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1
-(5 rows)
-
--- No. L-2-3-5
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
- QUERY PLAN
------------------------------------
- Hash Join
- Hash Cond: (v1t1.c1 = v1t1_.c1)
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1_
-(5 rows)
-
-/*+Leading(v1t1 v1t1_)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(v1t1 v1t1_)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Hash Join
- Hash Cond: (v1t1.c1 = v1t1_.c1)
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1_
-(5 rows)
-
--- No. L-2-3-6
-EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-----------------------------------
- Hash Join
- Hash Cond: (r4t1.c1 = r4t1.c1)
- -> Seq Scan on t1 r4t1
- -> Hash
- -> Seq Scan on t1 r4t1
-(5 rows)
-
-/*+Leading(r4t1 r4t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
-INFO: hint syntax error at or near "Leading(r4t1 r4t1)"
-DETAIL: Relation name "r4t1" is ambiguous.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading(r4t1 r4t1)
-
- QUERY PLAN
-----------------------------------
- Hash Join
- Hash Cond: (r4t1.c1 = r4t1.c1)
- -> Seq Scan on t1 r4t1
- -> Hash
- -> Seq Scan on t1 r4t1
-(5 rows)
-
--- No. L-2-3-7
-EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-----------------------------------
- Hash Join
- Hash Cond: (r4t1.c1 = r5t1.c1)
- -> Seq Scan on t1 r4t1
- -> Hash
- -> Seq Scan on t1 r5t1
-(5 rows)
-
-/*+Leading(r4t1 r5t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(r4t1 r5t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Hash Join
- Hash Cond: (r4t1.c1 = r5t1.c1)
- -> Seq Scan on t1 r4t1
- -> Hash
- -> Seq Scan on t1 r5t1
-(5 rows)
-
-----
----- No. L-2-4 VALUES clause
-----
--- No. L-2-4-1
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
- QUERY PLAN
--------------------------------------------------
- Nested Loop
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
-(8 rows)
-
-/*+ Leading(t3 t1 t2) */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-Leading(t3 t1 t2)
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------
- Nested Loop
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
-(8 rows)
-
-/*+ Leading(*VALUES* t1 t2) */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(*VALUES* t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------
- Nested Loop
- -> Nested Loop
- -> Values Scan on "*VALUES*"
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = "*VALUES*".column1)
- -> Index Scan using t2_i1 on t2
- Index Cond: (c1 = t1.c1)
-(7 rows)
-
--- No. L-2-4-2
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
- QUERY PLAN
--------------------------------------------------------
- Nested Loop
- Join Filter: (t1.c1 = "*VALUES*".column1)
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
- -> Values Scan on "*VALUES*"
-(11 rows)
-
-/*+ Leading(t4 t3 t2 t1) */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-Leading(t4 t3 t2 t1)
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------
- Nested Loop
- Join Filter: (t1.c1 = "*VALUES*".column1)
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
- -> Values Scan on "*VALUES*"
-(11 rows)
-
-/*+ Leading(*VALUES* t3 t2 t1) */
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near "Leading(*VALUES* t3 t2 t1) "
-DETAIL: Relation name "*VALUES*" is ambiguous.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading(*VALUES* t3 t2 t1)
-
- QUERY PLAN
--------------------------------------------------------
- Nested Loop
- Join Filter: (t1.c1 = "*VALUES*".column1)
- -> Nested Loop
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t2.c1)
- -> Values Scan on "*VALUES*"
-(11 rows)
-
-----
----- No. L-3-1 leading the order of table joins
-----
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
- QUERY PLAN
-------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(9 rows)
-
--- No. L-3-1-1
-/*+Leading(t3 t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t3 t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(9 rows)
-
--- No. L-3-1-2
-/*+Leading(t1 t2 t3)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t1 t2 t3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Hash Join
- Hash Cond: (t3.c1 = t1.c1)
- -> Seq Scan on t3
- -> Hash
- -> Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(10 rows)
-
-----
----- No. L-3-2 GUC parameter to disable hints
-----
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
- QUERY PLAN
-------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(9 rows)
-
--- No. L-3-2-1
-Set geqo_threshold = 3;
-Set geqo_seed = 0;
-/*+Leading(t1 t2 t3)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-Leading(t1 t2 t3)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(9 rows)
-
-Reset geqo_threshold;
--- No. L-3-2-2
-Set geqo_threshold = 4;
-Set geqo_seed = 0;
-/*+Leading(t1 t2 t3)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t1 t2 t3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Hash Join
- Hash Cond: (t3.c1 = t1.c1)
- -> Seq Scan on t3
- -> Hash
- -> Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(10 rows)
-
-Reset geqo_threshold;
--- No. L-3-2-3
-Set from_collapse_limit = 2;
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.v2 WHERE t1.c1 = v2.c1;
- QUERY PLAN
------------------------------------------------------
- Hash Join
- Hash Cond: (t1.c1 = v2t1.c1)
- -> Seq Scan on t1
- -> Hash
- -> Merge Join
- Merge Cond: (v2t1.c1 = v2t2.c1)
- -> Index Scan using t1_i1 on t1 v2t1
- -> Sort
- Sort Key: v2t2.c1
- -> Seq Scan on t2 v2t2
-(10 rows)
-
-/*+Leading(t1 v2t1 v2t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.v2 WHERE t1.c1 = v2.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(t1 v2t1 v2t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------
- Hash Join
- Hash Cond: (t1.c1 = v2t1.c1)
- -> Seq Scan on t1
- -> Hash
- -> Merge Join
- Merge Cond: (v2t1.c1 = v2t2.c1)
- -> Index Scan using t1_i1 on t1 v2t1
- -> Sort
- Sort Key: v2t2.c1
- -> Seq Scan on t2 v2t2
-(10 rows)
-
-Reset from_collapse_limit;
--- No. L-3-2-4
-Set from_collapse_limit = 3;
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.v2 WHERE t1.c1 = v2.c1;
- QUERY PLAN
------------------------------------------------
- Merge Join
- Merge Cond: (v2t1.c1 = v2t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = v2t1.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t1_i1 on t1 v2t1
- -> Sort
- Sort Key: v2t2.c1
- -> Seq Scan on t2 v2t2
-(9 rows)
-
-/*+Leading(v2t1 v2t2 t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.v2 WHERE t1.c1 = v2.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(v2t1 v2t2 t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------
- Hash Join
- Hash Cond: (t1.c1 = v2t1.c1)
- -> Seq Scan on t1
- -> Hash
- -> Merge Join
- Merge Cond: (v2t1.c1 = v2t2.c1)
- -> Index Scan using t1_i1 on t1 v2t1
- -> Sort
- Sort Key: v2t2.c1
- -> Seq Scan on t2 v2t2
-(10 rows)
-
-Reset from_collapse_limit;
--- No. L-3-2-5
-Set join_collapse_limit = 2;
-EXPLAIN (COSTS false) SELECT * FROM s1.t3
- JOIN s1.t2 ON (t3.c1 = t2.c1)
- JOIN s1.t1 ON (t1.c1 = t3.c1);
- QUERY PLAN
-------------------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t3.c1)
- -> Seq Scan on t1
- -> Hash
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- -> Hash
- -> Seq Scan on t2
-(9 rows)
-
-/*+Leading(t1 t2 t3)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t3
- JOIN s1.t2 ON (t3.c1 = t2.c1)
- JOIN s1.t1 ON (t1.c1 = t3.c1);
-LOG: pg_hint_plan:
-used hint:
-Leading(t1 t2 t3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t3.c1)
- -> Seq Scan on t1
- -> Hash
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- -> Hash
- -> Seq Scan on t2
-(9 rows)
-
-Reset join_collapse_limit;
--- No. L-3-2-6
-Set join_collapse_limit = 3;
-EXPLAIN (COSTS false) SELECT * FROM s1.t3
- JOIN s1.t2 ON (t3.c1 = t2.c1)
- JOIN s1.t1 ON (t1.c1 = t3.c1);
- QUERY PLAN
-------------------------------------------------
- Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- -> Hash
- -> Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(10 rows)
-
-/*+Leading(t1 t2 t3)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t3
- JOIN s1.t2 ON (t3.c1 = t2.c1)
- JOIN s1.t1 ON (t1.c1 = t3.c1);
-LOG: pg_hint_plan:
-used hint:
-Leading(t1 t2 t3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- -> Hash
- -> Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(10 rows)
-
-Reset join_collapse_limit;
-----
----- No. L-3-3 join between parents or between children
-----
--- No. L-3-3-1
-/*+Leading(t1 t2 t3)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.p2c1 t1
- JOIN s1.p2c2 t2 ON (t1.c1 = t2.c1)
- JOIN s1.p2c3 t3 ON (t1.c1 = t3.c1);
-LOG: pg_hint_plan:
-used hint:
-Leading(t1 t2 t3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t3.c1)
- -> Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Append
- -> Seq Scan on p2c1 t1
- -> Seq Scan on p2c1c1 t1
- -> Seq Scan on p2c1c2 t1
- -> Hash
- -> Append
- -> Seq Scan on p2c2 t2
- -> Seq Scan on p2c2c1 t2
- -> Seq Scan on p2c2c2 t2
- -> Hash
- -> Append
- -> Seq Scan on p2c3 t3
- -> Seq Scan on p2c3c1 t3
- -> Seq Scan on p2c3c2 t3
-(18 rows)
-
--- No. L-3-3-2
-/*+Leading(p2c1c1 p2c2c1 p2c3c1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.p2c1 t1
- JOIN s1.p2c2 t2 ON (t1.c1 = t2.c1)
- JOIN s1.p2c3 t3 ON (t1.c1 = t3.c1);
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-Leading(p2c1c1 p2c2c1 p2c3c1)
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t3.c1)
- -> Hash Join
- Hash Cond: (t1.c1 = t2.c1)
- -> Append
- -> Seq Scan on p2c1 t1
- -> Seq Scan on p2c1c1 t1
- -> Seq Scan on p2c1c2 t1
- -> Hash
- -> Append
- -> Seq Scan on p2c2 t2
- -> Seq Scan on p2c2c1 t2
- -> Seq Scan on p2c2c2 t2
- -> Hash
- -> Append
- -> Seq Scan on p2c3 t3
- -> Seq Scan on p2c3c1 t3
- -> Seq Scan on p2c3c2 t3
-(18 rows)
-
-----
----- No. L-3-4 conflict leading hint
-----
--- No. L-3-4-1
-EXPLAIN (COSTS false) SELECT * FROM s1.t1
- JOIN s1.t2 ON (t1.c1 = t2.c1)
- JOIN s1.t3 ON (t1.c1 = t3.c1);
- QUERY PLAN
-------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(9 rows)
-
-/*+Leading(t2 t3 t1)Leading(t1 t2 t3)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1
- JOIN s1.t2 ON (t1.c1 = t2.c1)
- JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO: hint syntax error at or near "Leading(t2 t3 t1)Leading(t1 t2 t3)"
-DETAIL: Conflict leading hint.
-LOG: pg_hint_plan:
-used hint:
-Leading(t1 t2 t3)
-not used hint:
-duplication hint:
-Leading(t2 t3 t1)
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Hash Join
- Hash Cond: (t3.c1 = t1.c1)
- -> Seq Scan on t3
- -> Hash
- -> Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(10 rows)
-
--- No. L-3-4-2
-/*+Leading(t3 t1 t2)Leading(t2 t3 t1)Leading(t1 t2 t3)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1
- JOIN s1.t2 ON (t1.c1 = t2.c1)
- JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO: hint syntax error at or near "Leading(t3 t1 t2)Leading(t2 t3 t1)Leading(t1 t2 t3)"
-DETAIL: Conflict leading hint.
-INFO: hint syntax error at or near "Leading(t2 t3 t1)Leading(t1 t2 t3)"
-DETAIL: Conflict leading hint.
-LOG: pg_hint_plan:
-used hint:
-Leading(t1 t2 t3)
-not used hint:
-duplication hint:
-Leading(t3 t1 t2)
-Leading(t2 t3 t1)
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Hash Join
- Hash Cond: (t3.c1 = t1.c1)
- -> Seq Scan on t3
- -> Hash
- -> Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(10 rows)
-
--- No. L-3-4-3
-/*+Leading(t2 t3 t1)Leading()*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1
- JOIN s1.t2 ON (t1.c1 = t2.c1)
- JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO: hint syntax error at or near "Leading()"
-DETAIL: Leading hint requires at least two relations.
-LOG: pg_hint_plan:
-used hint:
-Leading(t2 t3 t1)
-not used hint:
-duplication hint:
-error hint:
-Leading()
-
- QUERY PLAN
-------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- -> Hash
- -> Seq Scan on t2
-(10 rows)
-
--- No. L-3-4-4
-/*+Leading(t3 t1 t2)Leading(t2 t3 t1)Leading()*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1
- JOIN s1.t2 ON (t1.c1 = t2.c1)
- JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO: hint syntax error at or near "Leading()"
-DETAIL: Leading hint requires at least two relations.
-INFO: hint syntax error at or near "Leading(t3 t1 t2)Leading(t2 t3 t1)Leading()"
-DETAIL: Conflict leading hint.
-LOG: pg_hint_plan:
-used hint:
-Leading(t2 t3 t1)
-not used hint:
-duplication hint:
-Leading(t3 t1 t2)
-error hint:
-Leading()
-
- QUERY PLAN
-------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- -> Hash
- -> Seq Scan on t2
-(10 rows)
-
-----
----- No. L-3-5 hint state output
-----
--- No. L-3-5-1
-/*+Leading()*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1
- JOIN s1.t2 ON (t1.c1 = t2.c1)
- JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO: hint syntax error at or near "Leading()"
-DETAIL: Leading hint requires at least two relations.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading()
-
- QUERY PLAN
-------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(9 rows)
-
--- No. L-3-5-2
-/*+Leading(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1
- JOIN s1.t2 ON (t1.c1 = t2.c1)
- JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO: hint syntax error at or near "Leading(t1)"
-DETAIL: Leading hint requires at least two relations.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading(t1)
-
- QUERY PLAN
-------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(9 rows)
-
--- No. L-3-5-3
-/*+Leading(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1
- JOIN s1.t2 ON (t1.c1 = t2.c1)
- JOIN s1.t3 ON (t1.c1 = t3.c1);
-LOG: pg_hint_plan:
-used hint:
-Leading(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
- -> Index Scan using t3_i1 on t3
- Index Cond: (c1 = t1.c1)
-(9 rows)
-
--- No. L-3-5-4
-/*+Leading(t1 t2 t3)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1
- JOIN s1.t2 ON (t1.c1 = t2.c1)
- JOIN s1.t3 ON (t1.c1 = t3.c1);
-LOG: pg_hint_plan:
-used hint:
-Leading(t1 t2 t3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Hash Join
- Hash Cond: (t3.c1 = t1.c1)
- -> Seq Scan on t3
- -> Hash
- -> Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(10 rows)
-
-----
----- No. L-3-6 specified Inner/Outer side
-----
--- No. L-3-6-1
-/*+Leading((t2))*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near "Leading((t2))"
-DETAIL: Leading hint requires two sets of relations when parentheses nests.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading((t2))
-
- QUERY PLAN
-------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t4.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Scan using t4_i1 on t4
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(12 rows)
-
--- No. L-3-6-2
-/*+Leading((t2 t3))*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading((t2 t3))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t2.c1 = t1.c1)
- -> Merge Join
- Merge Cond: (t2.c1 = t3.c1)
- -> Index Scan using t2_i1 on t2
- -> Index Scan using t3_i1 on t3
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = t3.c1)
- -> Index Scan using t4_i1 on t4
- Index Cond: (c1 = t3.c1)
-(12 rows)
-
--- No. L-3-6-3
-/*+Leading((t2 t3 t4))*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near "Leading((t2 t3 t4))"
-DETAIL: Leading hint requires two sets of relations when parentheses nests.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-Leading((t2 t3 t4))
-
- QUERY PLAN
-------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t4.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Scan using t4_i1 on t4
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(12 rows)
-
--- No. L-3-6-4
-/*+Leading(((t1 t2) (t3 t4)))*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading(((t1 t2) (t3 t4)))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Hash Join
- Hash Cond: (t1.c1 = t3.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
- -> Hash
- -> Hash Join
- Hash Cond: (t3.c1 = t4.c1)
- -> Seq Scan on t3
- -> Hash
- -> Seq Scan on t4
-(14 rows)
-
--- No. L-3-6-5
-/*+Leading((((t1 t3) t4) t2)))*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO: hint syntax error at or near ")"
-DETAIL: Unrecognized hint keyword ")".
-LOG: pg_hint_plan:
-used hint:
-Leading((((t1 t3) t4) t2))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t4.c1)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1
- -> Index Scan using t3_i1 on t3
- -> Index Scan using t4_i1 on t4
- -> Sort
- Sort Key: t2.c1
- -> Seq Scan on t2
-(12 rows)
-
--- No. L-3-6-6
-/*+Leading((t1 (t3 (t4 t2))))*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-LOG: pg_hint_plan:
-used hint:
-Leading((t1 (t3 (t4 t2))))
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- -> Hash
- -> Hash Join
- Hash Cond: (t4.c1 = t2.c1)
- -> Seq Scan on t4
- -> Hash
- -> Seq Scan on t2
-(14 rows)
-
Filter: (ctid = '(1,1)'::tid)
-> Bitmap Index Scan on t4_pkey
Index Cond: (c1 = b1t1.c1)
- InitPlan 2 (returns $3)
+ InitPlan 2 (returns $4)
-> Aggregate
-> Nested Loop
-> Nested Loop
-> Index Scan using t4_pkey on t4 b2t4
Index Cond: (c1 = b2t1.c1)
Filter: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $5)
+ InitPlan 3 (returns $7)
-> Aggregate
-> Nested Loop
-> Nested Loop
Join Filter: (bmt1.c1 = bmt4.c1)
-> Nested Loop
-> Seq Scan on t1 bmt1
- Filter: ((c1 <> $5) AND (ctid = '(1,1)'::tid))
+ Filter: ((c1 <> $7) AND (ctid = '(1,1)'::tid))
-> Bitmap Heap Scan on t3 bmt3
Recheck Cond: (c1 = bmt1.c1)
Filter: (ctid = '(1,1)'::tid)
+++ /dev/null
-LOAD 'pg_hint_plan';
-SET pg_hint_plan.enable_hint TO on;
-SET pg_hint_plan.debug_print TO on;
-SET client_min_messages TO LOG;
-SET search_path TO public;
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 >= 1)
-(2 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
- QUERY PLAN
----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c3 < 10)
- -> Bitmap Index Scan on t1_i
- Index Cond: (c3 < 10)
-(4 rows)
-
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
- QUERY PLAN
------------------------------------
- Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
-----
----- No. S-1-1 specified pattern of the object name
-----
--- No. S-1-1-1
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. S-1-1-2
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 t_1 WHERE t_1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(t1)
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Index Scan using t1_i1 on t1 t_1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. S-1-1-3
-/*+SeqScan(t_1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 t_1 WHERE t_1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t_1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1 t_1
- Filter: (c1 = 1)
-(2 rows)
-
-----
----- No. S-1-2 specified schema name in the hint option
-----
--- No. S-1-2-1
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. S-1-2-2
-/*+SeqScan(s1.t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(s1.t1)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-----
----- No. S-1-3 table doesn't exist in the hint option
-----
--- No. S-1-3-1
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. S-1-3-2
-/*+SeqScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(t2)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-----
----- No. S-1-4 conflict table name
-----
--- No. S-1-4-1
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = 1 AND t1.c1 = t2.c1;
- QUERY PLAN
-------------------------------------
- Nested Loop
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
- -> Seq Scan on t2
- Filter: (c1 = 1)
-(5 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = 1 AND t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------
- Nested Loop
- -> Seq Scan on t1
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (c1 = 1)
-(5 rows)
-
--- No. S-1-4-2
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2.t1.c1;
- QUERY PLAN
-------------------------------------
- Nested Loop
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
- -> Seq Scan on t1
- Filter: (c1 = 1)
-(5 rows)
-
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2.t1.c1;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
- -> Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (c1 = 1)
-(9 rows)
-
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2t1.c1;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------
- Nested Loop
- -> Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
- -> Seq Scan on t1 s2t1
- Filter: (c1 = 1)
-(7 rows)
-
-/*+BitmapScan(s2t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2t1.c1;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(s2t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
- -> Bitmap Heap Scan on t1 s2t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (c1 = 1)
-(7 rows)
-
--- No. S-1-4-3
-EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 WHERE s1.t1.c1 = 1) FROM s1.t1 WHERE s1.t1.c1 = 1;
- QUERY PLAN
----------------------------------------------------------------------
- Index Only Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
- InitPlan 2 (returns $1)
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Index Only Scan using t1_i1 on t1
- Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
-(8 rows)
-
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 WHERE s1.t1.c1 = 1) FROM s1.t1 WHERE s1.t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- InitPlan 2 (returns $1)
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Bitmap Heap Scan on t1
- Recheck Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- -> Bitmap Index Scan on t1_i1
- Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
-(12 rows)
-
-/*+BitmapScan(t11)*/
-EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 t11 WHERE t11.c1 = 1) FROM s1.t1 t12 WHERE t12.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t11)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------------
- Index Only Scan using t1_i1 on t1 t12
- Index Cond: (c1 = 1)
- InitPlan 2 (returns $1)
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Bitmap Heap Scan on t1 t11
- Recheck Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- -> Bitmap Index Scan on t1_i1
- Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
-(10 rows)
-
-/*+BitmapScan(t12)*/
-EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 t11 WHERE t11.c1 = 1) FROM s1.t1 t12 WHERE t12.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t12)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------
- Bitmap Heap Scan on t1 t12
- Recheck Cond: (c1 = 1)
- InitPlan 2 (returns $1)
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Index Only Scan using t1_i1 on t1 t11
- Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
-(10 rows)
-
-----
----- No. S-1-5 object type for the hint
-----
--- No. S-1-5-1
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. S-1-5-2
-EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE p1.c1 = 1;
- QUERY PLAN
----------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: (c1 = 1)
- -> Seq Scan on p1c1 p1
- Filter: (c1 = 1)
-(6 rows)
-
-/*+IndexScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE p1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Result
- -> Append
- -> Index Scan using p1_i on p1
- Index Cond: (c1 = 1)
- -> Index Scan using p1c1_i on p1c1 p1
- Index Cond: (c1 = 1)
-(6 rows)
-
--- No. S-1-5-3
-EXPLAIN (COSTS false) SELECT * FROM s1.ul1 WHERE ul1.c1 = 1;
- QUERY PLAN
-----------------------------------
- Index Scan using ul1_pkey on ul1
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+SeqScan(ul1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ul1 WHERE ul1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(ul1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on ul1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. S-1-5-4
-CREATE TEMP TABLE tm1 (LIKE s1.t1 INCLUDING ALL);
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "tm1_pkey" for table "tm1"
-EXPLAIN (COSTS false) SELECT * FROM tm1 WHERE tm1.c1 = 1;
- QUERY PLAN
-----------------------------------
- Index Scan using tm1_pkey on tm1
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+SeqScan(tm1)*/
-EXPLAIN (COSTS false) SELECT * FROM tm1 WHERE tm1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(tm1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on tm1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. S-1-5-5
-EXPLAIN (COSTS false) SELECT * FROM pg_catalog.pg_class WHERE oid = 1;
- QUERY PLAN
--------------------------------------------------
- Index Scan using pg_class_oid_index on pg_class
- Index Cond: (oid = 1::oid)
-(2 rows)
-
-/*+SeqScan(pg_class)*/
-EXPLAIN (COSTS false) SELECT * FROM pg_catalog.pg_class WHERE oid = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(pg_class)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------
- Seq Scan on pg_class
- Filter: (oid = 1::oid)
-(2 rows)
-
--- No. S-1-5-6
--- refer ut-fdw.sql
--- No. S-1-5-7
-EXPLAIN (COSTS false) SELECT * FROM s1.f1() AS ft1 WHERE ft1.c1 = 1;
- QUERY PLAN
--------------------------
- Function Scan on f1 ft1
- Filter: (c1 = 1)
-(2 rows)
-
-/*+SeqScan(ft1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.f1() AS ft1 WHERE ft1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(ft1)
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------
- Function Scan on f1 ft1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. S-1-5-8
-EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS val1 (c1, c2, c3, c4) WHERE val1.c1 = 1;
- QUERY PLAN
----------------------------
- Values Scan on "*VALUES*"
- Filter: (column1 = 1)
-(2 rows)
-
-/*+SeqScan(val1)*/
-EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS val1 (c1, c2, c3, c4) WHERE val1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(val1)
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------
- Values Scan on "*VALUES*"
- Filter: (column1 = 1)
-(2 rows)
-
-/*+SeqScan(*VALUES*)*/
-EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS val1 (c1, c2, c3, c4) WHERE val1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(*VALUES*)
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------
- Values Scan on "*VALUES*"
- Filter: (column1 = 1)
-(2 rows)
-
--- No. S-1-5-9
-EXPLAIN (COSTS false) WITH c1(c1) AS (SELECT max(c1) FROM s1.t1 WHERE t1.c1 = 1)
-SELECT * FROM s1.t1, c1 WHERE t1.c1 = 1 AND t1.c1 = c1.c1;
- QUERY PLAN
----------------------------------------------------------------------
- Nested Loop
- CTE c1
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Index Only Scan using t1_i1 on t1
- Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
- -> CTE Scan on c1
- Filter: (c1 = 1)
-(11 rows)
-
-/*+SeqScan(c1)*/
-EXPLAIN (COSTS false) WITH c1(c1) AS (SELECT max(c1) FROM s1.t1 WHERE t1.c1 = 1)
-SELECT * FROM s1.t1, c1 WHERE t1.c1 = 1 AND t1.c1 = c1.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(c1)
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------
- Nested Loop
- CTE c1
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Index Only Scan using t1_i1 on t1
- Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
- -> CTE Scan on c1
- Filter: (c1 = 1)
-(11 rows)
-
--- No. S-1-5-10
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 WHERE v1.c1 = 1;
- QUERY PLAN
------------------------------------
- Index Scan using t1_i1 on t1 v1t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+SeqScan(v1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 WHERE v1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(v1)
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Index Scan using t1_i1 on t1 v1t1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. S-1-5-11
-EXPLAIN (COSTS false) SELECT * FROM (SELECT * FROM s1.t1 WHERE t1.c1 = 1) AS s1 WHERE s1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+SeqScan(s1)*/
-EXPLAIN (COSTS false) SELECT * FROM (SELECT * FROM s1.t1 WHERE t1.c1 = 1) AS s1 WHERE s1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(s1)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-----
----- No. S-2-1 some complexity query blocks
-----
--- No. S-2-1-1
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1), (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
-;
- QUERY PLAN
-------------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t4.c1)
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t3.c1)
- -> Index Only Scan using t1_i1 on t1 b1t1
- -> Index Only Scan using t3_i1 on t3 b1t3
- -> Index Only Scan using t4_i1 on t4 b1t4
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt4.c1)
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt3.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1
- -> Index Only Scan using t3_i1 on t3 bmt3
- -> Index Only Scan using t4_i1 on t4 bmt4
- -> Sort
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2
-(27 rows)
-
-/*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
-TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
-*/
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1), (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
-;
-LOG: available indexes for IndexScan(b1t3): t3_pkey
-LOG: available indexes for BitmapScan(b1t4): t4_pkey
-LOG: available indexes for IndexScan(bmt2): t2_pkey
-LOG: available indexes for BitmapScan(bmt3): t3_pkey
-LOG: pg_hint_plan:
-used hint:
-TidScan(b1t1)
-SeqScan(b1t2)
-IndexScan(b1t3 t3_pkey)
-BitmapScan(b1t4 t4_pkey)
-SeqScan(bmt1)
-IndexScan(bmt2 t2_pkey)
-BitmapScan(bmt3 t3_pkey)
-TidScan(bmt4)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $2)
- -> Aggregate
- -> Hash Join
- Hash Cond: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t3.c1)
- -> Nested Loop
- -> Seq Scan on t2 b1t2
- -> Bitmap Heap Scan on t4 b1t4
- Recheck Cond: (c1 = b1t2.c1)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = b1t2.c1)
- -> Index Scan using t3_pkey on t3 b1t3
- Index Cond: (c1 = b1t4.c1)
- -> Hash
- -> Seq Scan on t1 b1t1
- -> Hash Join
- Hash Cond: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- -> Hash Join
- Hash Cond: (bmt1.c1 = bmt2.c1)
- -> Seq Scan on t1 bmt1
- -> Hash
- -> Index Scan using t2_pkey on t2 bmt2
- -> Bitmap Heap Scan on t3 bmt3
- Recheck Cond: (c1 = bmt1.c1)
- -> Bitmap Index Scan on t3_pkey
- Index Cond: (c1 = bmt1.c1)
- -> Hash
- -> Seq Scan on t4 bmt4
-(31 rows)
-
--- No. S-2-1-2
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1), (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
-), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.c1 = b2t2.c1 AND b2t1.c1 = b2t3.c1 AND b2t1.c1 = b2t4.c1
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
-;
- QUERY PLAN
-------------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t4.c1)
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t3.c1)
- -> Index Only Scan using t1_i1 on t1 b1t1
- -> Index Only Scan using t3_i1 on t3 b1t3
- -> Index Only Scan using t4_i1 on t4 b1t4
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Merge Join
- Merge Cond: (b2t1.c1 = b2t2.c1)
- -> Merge Join
- Merge Cond: (b2t1.c1 = b2t4.c1)
- -> Merge Join
- Merge Cond: (b2t1.c1 = b2t3.c1)
- -> Index Only Scan using t1_i1 on t1 b2t1
- -> Index Only Scan using t3_i1 on t3 b2t3
- -> Index Only Scan using t4_i1 on t4 b2t4
- -> Sort
- Sort Key: b2t2.c1
- -> Seq Scan on t2 b2t2
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt4.c1)
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt3.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1
- -> Index Only Scan using t3_i1 on t3 bmt3
- -> Index Only Scan using t4_i1 on t4 bmt4
- -> Sort
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2
-(41 rows)
-
-/*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
-TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
-BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
-*/
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1), (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
-), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.c1 = b2t2.c1 AND b2t1.c1 = b2t3.c1 AND b2t1.c1 = b2t4.c1
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
-;
-LOG: available indexes for IndexScan(b1t3): t3_pkey
-LOG: available indexes for BitmapScan(b1t4): t4_pkey
-LOG: available indexes for BitmapScan(b2t1): t1_pkey
-LOG: available indexes for IndexScan(b2t4): t4_pkey
-LOG: available indexes for IndexScan(bmt2): t2_pkey
-LOG: available indexes for BitmapScan(bmt3): t3_pkey
-LOG: pg_hint_plan:
-used hint:
-TidScan(b1t1)
-SeqScan(b1t2)
-IndexScan(b1t3 t3_pkey)
-BitmapScan(b1t4 t4_pkey)
-BitmapScan(b2t1 t1_pkey)
-TidScan(b2t2)
-SeqScan(b2t3)
-IndexScan(b2t4 t4_pkey)
-SeqScan(bmt1)
-IndexScan(bmt2 t2_pkey)
-BitmapScan(bmt3 t3_pkey)
-TidScan(bmt4)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $2)
- -> Aggregate
- -> Hash Join
- Hash Cond: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t3.c1)
- -> Nested Loop
- -> Seq Scan on t2 b1t2
- -> Bitmap Heap Scan on t4 b1t4
- Recheck Cond: (c1 = b1t2.c1)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = b1t2.c1)
- -> Index Scan using t3_pkey on t3 b1t3
- Index Cond: (c1 = b1t4.c1)
- -> Hash
- -> Seq Scan on t1 b1t1
- InitPlan 2 (returns $4)
- -> Aggregate
- -> Hash Join
- Hash Cond: (b2t1.c1 = b2t3.c1)
- -> Merge Join
- Merge Cond: (b2t1.c1 = b2t2.c1)
- -> Nested Loop
- -> Index Scan using t4_pkey on t4 b2t4
- -> Bitmap Heap Scan on t1 b2t1
- Recheck Cond: (c1 = b2t4.c1)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (c1 = b2t4.c1)
- -> Sort
- Sort Key: b2t2.c1
- -> Seq Scan on t2 b2t2
- -> Hash
- -> Seq Scan on t3 b2t3
- -> Hash Join
- Hash Cond: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- -> Hash Join
- Hash Cond: (bmt1.c1 = bmt2.c1)
- -> Seq Scan on t1 bmt1
- -> Hash
- -> Index Scan using t2_pkey on t2 bmt2
- -> Bitmap Heap Scan on t3 bmt3
- Recheck Cond: (c1 = bmt1.c1)
- -> Bitmap Index Scan on t3_pkey
- Index Cond: (c1 = bmt1.c1)
- -> Hash
- -> Seq Scan on t4 bmt4
-(48 rows)
-
--- No. S-2-1-3
-EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, (SELECT * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = sbmt4.c1;
- QUERY PLAN
-----------------------------------------------------------------
- Aggregate
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt4.c1)
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt3.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1
- -> Index Only Scan using t3_i1 on t3 bmt3
- -> Index Only Scan using t4_i1 on t4 bmt4
- -> Sort
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2
-(13 rows)
-
-/*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
-*/
-EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, (SELECT * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = sbmt4.c1;
-LOG: available indexes for IndexScan(bmt2): t2_pkey
-LOG: available indexes for BitmapScan(bmt3): t3_pkey
-LOG: pg_hint_plan:
-used hint:
-SeqScan(bmt1)
-IndexScan(bmt2 t2_pkey)
-BitmapScan(bmt3 t3_pkey)
-TidScan(bmt4)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- -> Hash Join
- Hash Cond: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- -> Hash Join
- Hash Cond: (bmt1.c1 = bmt2.c1)
- -> Seq Scan on t1 bmt1
- -> Hash
- -> Index Scan using t2_pkey on t2 bmt2
- -> Bitmap Heap Scan on t3 bmt3
- Recheck Cond: (c1 = bmt1.c1)
- -> Bitmap Index Scan on t3_pkey
- Index Cond: (c1 = bmt1.c1)
- -> Hash
- -> Seq Scan on t4 bmt4
-(15 rows)
-
--- No. S-2-1-4
-EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, (SELECT * FROM s1.t3 bmt3) sbmt3, (SELECT * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = sbmt3.c1 AND bmt1.c1 = sbmt4.c1;
- QUERY PLAN
-----------------------------------------------------------------
- Aggregate
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt4.c1)
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt3.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1
- -> Index Only Scan using t3_i1 on t3 bmt3
- -> Index Only Scan using t4_i1 on t4 bmt4
- -> Sort
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2
-(13 rows)
-
-/*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
-*/
-EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, (SELECT * FROM s1.t3 bmt3) sbmt3, (SELECT * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = sbmt3.c1 AND bmt1.c1 = sbmt4.c1;
-LOG: available indexes for IndexScan(bmt2): t2_pkey
-LOG: available indexes for BitmapScan(bmt3): t3_pkey
-LOG: pg_hint_plan:
-used hint:
-SeqScan(bmt1)
-IndexScan(bmt2 t2_pkey)
-BitmapScan(bmt3 t3_pkey)
-TidScan(bmt4)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- -> Hash Join
- Hash Cond: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- -> Hash Join
- Hash Cond: (bmt1.c1 = bmt2.c1)
- -> Seq Scan on t1 bmt1
- -> Hash
- -> Index Scan using t2_pkey on t2 bmt2
- -> Bitmap Heap Scan on t3 bmt3
- Recheck Cond: (c1 = bmt1.c1)
- -> Bitmap Index Scan on t3_pkey
- Index Cond: (c1 = bmt1.c1)
- -> Hash
- -> Seq Scan on t4 bmt4
-(15 rows)
-
--- No. S-2-1-5
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
- AND bmt1.c1 <> (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
-)
-;
- QUERY PLAN
-------------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t4.c1)
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t3.c1)
- -> Index Only Scan using t1_i1 on t1 b1t1
- -> Index Only Scan using t3_i1 on t3 b1t3
- -> Index Only Scan using t4_i1 on t4 b1t4
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt4.c1)
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt3.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1
- Filter: (c1 <> $0)
- -> Index Only Scan using t3_i1 on t3 bmt3
- -> Index Only Scan using t4_i1 on t4 bmt4
- -> Sort
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2
-(28 rows)
-
-/*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
-TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
-*/
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
- AND bmt1.c1 <> (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
-)
-;
-LOG: available indexes for IndexScan(b1t3): t3_pkey
-LOG: available indexes for BitmapScan(b1t4): t4_pkey
-LOG: available indexes for IndexScan(bmt2): t2_pkey
-LOG: available indexes for BitmapScan(bmt3): t3_pkey
-LOG: pg_hint_plan:
-used hint:
-TidScan(b1t1)
-SeqScan(b1t2)
-IndexScan(b1t3 t3_pkey)
-BitmapScan(b1t4 t4_pkey)
-SeqScan(bmt1)
-IndexScan(bmt2 t2_pkey)
-BitmapScan(bmt3 t3_pkey)
-TidScan(bmt4)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $2)
- -> Aggregate
- -> Hash Join
- Hash Cond: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t3.c1)
- -> Nested Loop
- -> Seq Scan on t2 b1t2
- -> Bitmap Heap Scan on t4 b1t4
- Recheck Cond: (c1 = b1t2.c1)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = b1t2.c1)
- -> Index Scan using t3_pkey on t3 b1t3
- Index Cond: (c1 = b1t4.c1)
- -> Hash
- -> Seq Scan on t1 b1t1
- -> Hash Join
- Hash Cond: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- -> Hash Join
- Hash Cond: (bmt1.c1 = bmt2.c1)
- -> Seq Scan on t1 bmt1
- Filter: (c1 <> $2)
- -> Hash
- -> Index Scan using t2_pkey on t2 bmt2
- -> Bitmap Heap Scan on t3 bmt3
- Recheck Cond: (c1 = bmt1.c1)
- -> Bitmap Index Scan on t3_pkey
- Index Cond: (c1 = bmt1.c1)
- -> Hash
- -> Seq Scan on t4 bmt4
-(32 rows)
-
--- No. S-2-1-6
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
- AND bmt1.c1 <> (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
-) AND bmt1.c1 <> (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.c1 = b2t2.c1 AND b2t1.c1 = b2t3.c1 AND b2t1.c1 = b2t4.c1
-)
-;
- QUERY PLAN
-------------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $0)
- -> Aggregate
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t4.c1)
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t3.c1)
- -> Index Only Scan using t1_i1 on t1 b1t1
- -> Index Only Scan using t3_i1 on t3 b1t3
- -> Index Only Scan using t4_i1 on t4 b1t4
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Merge Join
- Merge Cond: (b2t1.c1 = b2t2.c1)
- -> Merge Join
- Merge Cond: (b2t1.c1 = b2t4.c1)
- -> Merge Join
- Merge Cond: (b2t1.c1 = b2t3.c1)
- -> Index Only Scan using t1_i1 on t1 b2t1
- -> Index Only Scan using t3_i1 on t3 b2t3
- -> Index Only Scan using t4_i1 on t4 b2t4
- -> Sort
- Sort Key: b2t2.c1
- -> Seq Scan on t2 b2t2
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt4.c1)
- -> Merge Join
- Merge Cond: (bmt1.c1 = bmt3.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1
- Filter: ((c1 <> $0) AND (c1 <> $1))
- -> Index Only Scan using t3_i1 on t3 bmt3
- -> Index Only Scan using t4_i1 on t4 bmt4
- -> Sort
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2
-(42 rows)
-
-/*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
-TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
-BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
-*/
-EXPLAIN (COSTS false)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
- AND bmt1.c1 <> (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
-) AND bmt1.c1 <> (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.c1 = b2t2.c1 AND b2t1.c1 = b2t3.c1 AND b2t1.c1 = b2t4.c1
-)
-;
-LOG: available indexes for IndexScan(b1t3): t3_pkey
-LOG: available indexes for BitmapScan(b1t4): t4_pkey
-LOG: available indexes for BitmapScan(b2t1): t1_pkey
-LOG: available indexes for IndexScan(b2t4): t4_pkey
-LOG: available indexes for IndexScan(bmt2): t2_pkey
-LOG: available indexes for BitmapScan(bmt3): t3_pkey
-LOG: pg_hint_plan:
-used hint:
-TidScan(b1t1)
-SeqScan(b1t2)
-IndexScan(b1t3 t3_pkey)
-BitmapScan(b1t4 t4_pkey)
-BitmapScan(b2t1 t1_pkey)
-TidScan(b2t2)
-SeqScan(b2t3)
-IndexScan(b2t4 t4_pkey)
-SeqScan(bmt1)
-IndexScan(bmt2 t2_pkey)
-BitmapScan(bmt3 t3_pkey)
-TidScan(bmt4)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------
- Aggregate
- InitPlan 1 (returns $2)
- -> Aggregate
- -> Hash Join
- Hash Cond: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t3.c1)
- -> Nested Loop
- -> Seq Scan on t2 b1t2
- -> Bitmap Heap Scan on t4 b1t4
- Recheck Cond: (c1 = b1t2.c1)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = b1t2.c1)
- -> Index Scan using t3_pkey on t3 b1t3
- Index Cond: (c1 = b1t4.c1)
- -> Hash
- -> Seq Scan on t1 b1t1
- InitPlan 2 (returns $4)
- -> Aggregate
- -> Hash Join
- Hash Cond: (b2t1.c1 = b2t3.c1)
- -> Merge Join
- Merge Cond: (b2t1.c1 = b2t2.c1)
- -> Nested Loop
- -> Index Scan using t4_pkey on t4 b2t4
- -> Bitmap Heap Scan on t1 b2t1
- Recheck Cond: (c1 = b2t4.c1)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (c1 = b2t4.c1)
- -> Sort
- Sort Key: b2t2.c1
- -> Seq Scan on t2 b2t2
- -> Hash
- -> Seq Scan on t3 b2t3
- -> Hash Join
- Hash Cond: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- -> Hash Join
- Hash Cond: (bmt1.c1 = bmt2.c1)
- -> Seq Scan on t1 bmt1
- Filter: ((c1 <> $2) AND (c1 <> $4))
- -> Hash
- -> Index Scan using t2_pkey on t2 bmt2
- -> Bitmap Heap Scan on t3 bmt3
- Recheck Cond: (c1 = bmt1.c1)
- -> Bitmap Index Scan on t3_pkey
- Index Cond: (c1 = bmt1.c1)
- -> Hash
- -> Seq Scan on t4 bmt4
-(49 rows)
-
--- No. S-2-1-7
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
-)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
-, c1
- WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
-AND bmt1.c1 = c1.c1
-;
- QUERY PLAN
-------------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t4.c1)
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t3.c1)
- -> Index Only Scan using t1_i1 on t1 b1t1
- -> Index Only Scan using t3_i1 on t3 b1t3
- -> Index Only Scan using t4_i1 on t4 b1t4
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt2.c1 = bmt1.c1)
- -> Nested Loop
- -> Hash Join
- Hash Cond: (bmt2.c1 = c1.c1)
- -> Seq Scan on t2 bmt2
- -> Hash
- -> CTE Scan on c1
- -> Index Only Scan using t3_i1 on t3 bmt3
- Index Cond: (c1 = bmt2.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1
- Index Cond: (c1 = bmt3.c1)
- -> Index Only Scan using t4_i1 on t4 bmt4
- Index Cond: (c1 = bmt3.c1)
-(31 rows)
-
-/*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
-TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
-)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
-, c1
- WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
-AND bmt1.c1 = c1.c1
-;
-LOG: available indexes for IndexScan(b1t3): t3_pkey
-LOG: available indexes for BitmapScan(b1t4): t4_pkey
-LOG: available indexes for IndexScan(bmt2): t2_pkey
-LOG: available indexes for BitmapScan(bmt3): t3_pkey
-LOG: pg_hint_plan:
-used hint:
-TidScan(b1t1)
-SeqScan(b1t2)
-IndexScan(b1t3 t3_pkey)
-BitmapScan(b1t4 t4_pkey)
-SeqScan(bmt1)
-IndexScan(bmt2 t2_pkey)
-BitmapScan(bmt3 t3_pkey)
-TidScan(bmt4)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Hash Join
- Hash Cond: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t3.c1)
- -> Nested Loop
- -> Seq Scan on t2 b1t2
- -> Bitmap Heap Scan on t4 b1t4
- Recheck Cond: (c1 = b1t2.c1)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = b1t2.c1)
- -> Index Scan using t3_pkey on t3 b1t3
- Index Cond: (c1 = b1t4.c1)
- -> Hash
- -> Seq Scan on t1 b1t1
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- -> Nested Loop
- -> Hash Join
- Hash Cond: (bmt1.c1 = c1.c1)
- -> Seq Scan on t1 bmt1
- -> Hash
- -> CTE Scan on c1
- -> Index Scan using t2_pkey on t2 bmt2
- Index Cond: (c1 = bmt1.c1)
- -> Bitmap Heap Scan on t3 bmt3
- Recheck Cond: (c1 = bmt1.c1)
- -> Bitmap Index Scan on t3_pkey
- Index Cond: (c1 = bmt1.c1)
- -> Seq Scan on t4 bmt4
-(33 rows)
-
--- No. S-2-1-8
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
-)
-, c2 (c1) AS (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.c1 = b2t2.c1 AND b2t1.c1 = b2t3.c1 AND b2t1.c1 = b2t4.c1
-)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
-, c1, c2
- WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
-AND bmt1.c1 = c1.c1
-AND bmt1.c1 = c2.c1
-;
- QUERY PLAN
-------------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t4.c1)
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t3.c1)
- -> Index Only Scan using t1_i1 on t1 b1t1
- -> Index Only Scan using t3_i1 on t3 b1t3
- -> Index Only Scan using t4_i1 on t4 b1t4
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- CTE c2
- -> Aggregate
- -> Merge Join
- Merge Cond: (b2t1.c1 = b2t2.c1)
- -> Merge Join
- Merge Cond: (b2t1.c1 = b2t4.c1)
- -> Merge Join
- Merge Cond: (b2t1.c1 = b2t3.c1)
- -> Index Only Scan using t1_i1 on t1 b2t1
- -> Index Only Scan using t3_i1 on t3 b2t3
- -> Index Only Scan using t4_i1 on t4 b2t4
- -> Sort
- Sort Key: b2t2.c1
- -> Seq Scan on t2 b2t2
- -> Nested Loop
- Join Filter: (bmt1.c1 = c2.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt2.c1 = bmt1.c1)
- -> Nested Loop
- -> Hash Join
- Hash Cond: (bmt2.c1 = c1.c1)
- -> Seq Scan on t2 bmt2
- -> Hash
- -> CTE Scan on c1
- -> Index Only Scan using t3_i1 on t3 bmt3
- Index Cond: (c1 = bmt2.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1
- Index Cond: (c1 = bmt3.c1)
- -> Index Only Scan using t4_i1 on t4 bmt4
- Index Cond: (c1 = bmt3.c1)
- -> CTE Scan on c2
-(48 rows)
-
-/*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
-TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
-BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
-)
-, c2 (c1) AS (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.c1 = b2t2.c1 AND b2t1.c1 = b2t3.c1 AND b2t1.c1 = b2t4.c1
-)
-SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
-, c1, c2
- WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
-AND bmt1.c1 = c1.c1
-AND bmt1.c1 = c2.c1
-;
-LOG: available indexes for IndexScan(b1t3): t3_pkey
-LOG: available indexes for BitmapScan(b1t4): t4_pkey
-LOG: available indexes for BitmapScan(b2t1): t1_pkey
-LOG: available indexes for IndexScan(b2t4): t4_pkey
-LOG: available indexes for IndexScan(bmt2): t2_pkey
-LOG: available indexes for BitmapScan(bmt3): t3_pkey
-LOG: pg_hint_plan:
-used hint:
-TidScan(b1t1)
-SeqScan(b1t2)
-IndexScan(b1t3 t3_pkey)
-BitmapScan(b1t4 t4_pkey)
-BitmapScan(b2t1 t1_pkey)
-TidScan(b2t2)
-SeqScan(b2t3)
-IndexScan(b2t4 t4_pkey)
-SeqScan(bmt1)
-IndexScan(bmt2 t2_pkey)
-BitmapScan(bmt3 t3_pkey)
-TidScan(bmt4)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Hash Join
- Hash Cond: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- Join Filter: (b1t2.c1 = b1t3.c1)
- -> Nested Loop
- -> Seq Scan on t2 b1t2
- -> Bitmap Heap Scan on t4 b1t4
- Recheck Cond: (c1 = b1t2.c1)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = b1t2.c1)
- -> Index Scan using t3_pkey on t3 b1t3
- Index Cond: (c1 = b1t4.c1)
- -> Hash
- -> Seq Scan on t1 b1t1
- CTE c2
- -> Aggregate
- -> Hash Join
- Hash Cond: (b2t1.c1 = b2t3.c1)
- -> Merge Join
- Merge Cond: (b2t1.c1 = b2t2.c1)
- -> Nested Loop
- -> Index Scan using t4_pkey on t4 b2t4
- -> Bitmap Heap Scan on t1 b2t1
- Recheck Cond: (c1 = b2t4.c1)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (c1 = b2t4.c1)
- -> Sort
- Sort Key: b2t2.c1
- -> Seq Scan on t2 b2t2
- -> Hash
- -> Seq Scan on t3 b2t3
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c2.c1)
- -> Nested Loop
- -> Nested Loop
- -> Hash Join
- Hash Cond: (bmt1.c1 = c1.c1)
- -> Seq Scan on t1 bmt1
- -> Hash
- -> CTE Scan on c1
- -> Index Scan using t2_pkey on t2 bmt2
- Index Cond: (c1 = bmt1.c1)
- -> Bitmap Heap Scan on t3 bmt3
- Recheck Cond: (c1 = bmt1.c1)
- -> Bitmap Index Scan on t3_pkey
- Index Cond: (c1 = bmt1.c1)
- -> CTE Scan on c2
- -> Seq Scan on t4 bmt4
-(53 rows)
-
-----
----- No. S-2-2 the number of the tables per quiry block
-----
--- No. S-2-2-1
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = 1
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
-)
- FROM s1.t1 bmt1, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = 1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = 1
-)
-;
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 4 (returns $3)
- -> Result
- InitPlan 3 (returns $2)
- -> Limit
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 6 (returns $5)
- -> Result
- InitPlan 5 (returns $4)
- -> Limit
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- -> Nested Loop
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 <> $5) AND (c1 = 1))
- -> CTE Scan on c1
-(27 rows)
-
-/*+SeqScan(bmt1)
-TidScan(b1t1)
-BitmapScan(b2t1 t1_pkey)
-IndexScan(b3t1 t1_pkey)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = 1
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
-)
- FROM s1.t1 bmt1, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = 1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = 1
-)
-;
-LOG: available indexes for BitmapScan(b2t1): t1_pkey
-LOG: available indexes for BitmapScan(b2t1): t1_pkey
-LOG: available indexes for IndexScan(b3t1): t1_pkey
-LOG: available indexes for IndexScan(b3t1): t1_pkey
-LOG: pg_hint_plan:
-used hint:
-TidScan(b1t1)
-BitmapScan(b2t1 t1_pkey)
-IndexScan(b3t1 t1_pkey)
-SeqScan(bmt1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 4 (returns $3)
- -> Result
- InitPlan 3 (returns $2)
- -> Limit
- -> Bitmap Heap Scan on t1 b2t1
- Recheck Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 6 (returns $5)
- -> Result
- InitPlan 5 (returns $4)
- -> Limit
- -> Index Scan using t1_pkey on t1 b3t1
- Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop
- -> Seq Scan on t1 bmt1
- Filter: ((c1 <> $5) AND (ctid = '(1,1)'::tid) AND (c1 = 1))
- -> CTE Scan on c1
-(28 rows)
-
--- No. S-2-2-2
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)'
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)'
-)
-;
- QUERY PLAN
--------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $2)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
-(34 rows)
-
-/*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)
-TidScan(b1t1)SeqScan(b1t2)
-BitmapScan(b2t1 t1_pkey)TidScan(b2t2)
-IndexScan(b3t1 t1_pkey)BitmapScan(b3t2 t2_pkey)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)'
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)'
-)
-;
-LOG: available indexes for BitmapScan(b2t1): t1_pkey
-LOG: available indexes for IndexScan(b3t1): t1_pkey
-LOG: available indexes for BitmapScan(b3t2): t2_pkey
-LOG: available indexes for IndexScan(bmt2): t2_pkey
-LOG: pg_hint_plan:
-used hint:
-TidScan(b1t1)
-SeqScan(b1t2)
-BitmapScan(b2t1 t1_pkey)
-TidScan(b2t2)
-IndexScan(b3t1 t1_pkey)
-BitmapScan(b3t2 t2_pkey)
-SeqScan(bmt1)
-IndexScan(bmt2 t2_pkey)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $2)
- -> Aggregate
- -> Nested Loop
- -> Tid Scan on t2 b2t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t1 b2t1
- Recheck Cond: (c1 = b2t2.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (c1 = b2t2.c1)
- InitPlan 3 (returns $4)
- -> Aggregate
- -> Nested Loop
- -> Index Scan using t1_pkey on t1 b3t1
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t2 b3t2
- Recheck Cond: (c1 = b3t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (c1 = b3t1.c1)
- -> Nested Loop
- -> Nested Loop
- -> Seq Scan on t1 bmt1
- Filter: ((c1 <> $4) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t2_pkey on t2 bmt2
- Index Cond: (c1 = bmt1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
-(37 rows)
-
--- No. S-2-2-3
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
-;
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c1.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $2)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
-(67 rows)
-
-/*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
-TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
-BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
-IndexScan(b3t1 t1_pkey)BitmapScan(b3t2 t2_pkey)TidScan(b3t3)SeqScan(b3t4)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
-)
-;
-LOG: available indexes for IndexScan(b1t3): t3_pkey
-LOG: available indexes for BitmapScan(b1t4): t4_pkey
-LOG: available indexes for BitmapScan(b2t1): t1_pkey
-LOG: available indexes for IndexScan(b2t4): t4_pkey
-LOG: available indexes for IndexScan(b3t1): t1_pkey
-LOG: available indexes for BitmapScan(b3t2): t2_pkey
-LOG: available indexes for IndexScan(bmt2): t2_pkey
-LOG: available indexes for BitmapScan(bmt3): t3_pkey
-LOG: pg_hint_plan:
-used hint:
-TidScan(b1t1)
-SeqScan(b1t2)
-IndexScan(b1t3 t3_pkey)
-BitmapScan(b1t4 t4_pkey)
-BitmapScan(b2t1 t1_pkey)
-TidScan(b2t2)
-SeqScan(b2t3)
-IndexScan(b2t4 t4_pkey)
-IndexScan(b3t1 t1_pkey)
-BitmapScan(b3t2 t2_pkey)
-TidScan(b3t3)
-SeqScan(b3t4)
-SeqScan(bmt1)
-IndexScan(bmt2 t2_pkey)
-BitmapScan(bmt3 t3_pkey)
-TidScan(bmt4)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3 b1t3
- Index Cond: (c1 = b1t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t4 b1t4
- Recheck Cond: (c1 = b1t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = b1t1.c1)
- InitPlan 2 (returns $4)
- -> Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- -> Tid Scan on t2 b2t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t1 b2t1
- Recheck Cond: (c1 = b2t2.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (c1 = b2t2.c1)
- -> Seq Scan on t3 b2t3
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t4_pkey on t4 b2t4
- Index Cond: (c1 = b2t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $7)
- -> Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Nested Loop
- -> Nested Loop
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1 b3t1
- Index Cond: (c1 = b3t3.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t2 b3t2
- Recheck Cond: (c1 = b3t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (c1 = b3t1.c1)
- -> Seq Scan on t4 b3t4
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c1.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- -> Nested Loop
- -> Seq Scan on t1 bmt1
- Filter: ((c1 <> $7) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t2_pkey on t2 bmt2
- Index Cond: (c1 = bmt1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t3 bmt3
- Recheck Cond: (c1 = bmt1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t3_pkey
- Index Cond: (c1 = bmt1.c1)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
-(74 rows)
-
--- No. S-2-2-4
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
-)
-;
- QUERY PLAN
--------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
- InitPlan 3 (returns $2)
- -> Result
- InitPlan 2 (returns $1)
- -> Limit
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 4 (returns $3)
- -> Aggregate
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c1.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt2.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $3)
- -> Seq Scan on t2 bmt2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
-(46 rows)
-
-/*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
-TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
-BitmapScan(b2t1 t1_pkey)
-IndexScan(b3t1 t1_pkey)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
-)
-SELECT max(bmt1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
-)
- FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
-AND bmt1.c1 <> (
-SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
-)
-;
-LOG: available indexes for IndexScan(b1t3): t3_pkey
-LOG: available indexes for BitmapScan(b1t4): t4_pkey
-LOG: available indexes for BitmapScan(b2t1): t1_pkey
-LOG: available indexes for BitmapScan(b2t1): t1_pkey
-LOG: available indexes for IndexScan(b3t1): t1_pkey
-LOG: available indexes for IndexScan(b3t1): t1_pkey
-LOG: available indexes for IndexScan(bmt2): t2_pkey
-LOG: available indexes for BitmapScan(bmt3): t3_pkey
-LOG: pg_hint_plan:
-used hint:
-TidScan(b1t1)
-SeqScan(b1t2)
-IndexScan(b1t3 t3_pkey)
-BitmapScan(b1t4 t4_pkey)
-BitmapScan(b2t1 t1_pkey)
-IndexScan(b3t1 t1_pkey)
-SeqScan(bmt1)
-IndexScan(bmt2 t2_pkey)
-BitmapScan(bmt3 t3_pkey)
-TidScan(bmt4)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------------------------------
- Aggregate
- CTE c1
- -> Aggregate
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3 b1t3
- Index Cond: (c1 = b1t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t4 b1t4
- Recheck Cond: (c1 = b1t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = b1t1.c1)
- InitPlan 3 (returns $3)
- -> Result
- InitPlan 2 (returns $2)
- -> Limit
- -> Bitmap Heap Scan on t1 b2t1
- Recheck Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 5 (returns $5)
- -> Result
- InitPlan 4 (returns $4)
- -> Limit
- -> Index Scan Backward using t1_pkey on t1 b3t1
- Index Cond: (c1 IS NOT NULL)
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop
- Join Filter: (bmt1.c1 = c1.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- -> Nested Loop
- -> Seq Scan on t1 bmt1
- Filter: ((c1 <> $5) AND (ctid = '(1,1)'::tid))
- -> Index Scan using t2_pkey on t2 bmt2
- Index Cond: (c1 = bmt1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t3 bmt3
- Recheck Cond: (c1 = bmt1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t3_pkey
- Index Cond: (c1 = bmt1.c1)
- -> Tid Scan on t4 bmt4
- TID Cond: (ctid = '(1,1)'::tid)
- -> CTE Scan on c1
-(54 rows)
-
-----
----- No. S-2-3 RULE or VIEW
-----
--- No. S-2-3-1
-EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-(19 rows)
-
-/*+TidScan(t1)SeqScan(t2)IndexScan(t3 t3_pkey)BitmapScan(t4 t4_pkey)
-SeqScan(r1)*/
-EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(t3): t3_pkey
-LOG: available indexes for BitmapScan(t4): t4_pkey
-LOG: pg_hint_plan:
-used hint:
-SeqScan(r1)
-TidScan(t1)
-SeqScan(t2)
-IndexScan(t3 t3_pkey)
-BitmapScan(t4 t4_pkey)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Seq Scan on r1
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3
- Index Cond: (c1 = t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t4
- Recheck Cond: (c1 = t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = t1.c1)
-(20 rows)
-
-EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Tid Scan on r1_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
-(19 rows)
-
-/*+TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
-SeqScan(r1_)*/
-EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(b1t3): t3_pkey
-LOG: available indexes for BitmapScan(b1t4): t4_pkey
-LOG: pg_hint_plan:
-used hint:
-TidScan(b1t1)
-SeqScan(b1t2)
-IndexScan(b1t3 t3_pkey)
-BitmapScan(b1t4 t4_pkey)
-SeqScan(r1_)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Seq Scan on r1_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3 b1t3
- Index Cond: (c1 = b1t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t4 b1t4
- Recheck Cond: (c1 = b1t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = b1t1.c1)
-(20 rows)
-
--- No. S-2-3-2
-EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-(39 rows)
-
-/*+TidScan(t1)SeqScan(t2)IndexScan(t3 t3_pkey)BitmapScan(t4 t4_pkey)
-SeqScan(r2)*/
-EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(t3): t3_pkey
-LOG: available indexes for BitmapScan(t4): t4_pkey
-LOG: pg_hint_plan:
-used hint:
-SeqScan(r2)
-TidScan(t1)
-SeqScan(t2)
-IndexScan(t3 t3_pkey)
-BitmapScan(t4 t4_pkey)
-not used hint:
-duplication hint:
-error hint:
-
-LOG: available indexes for IndexScan(t3): t3_pkey
-LOG: available indexes for BitmapScan(t4): t4_pkey
-LOG: pg_hint_plan:
-used hint:
-SeqScan(r2)
-TidScan(t1)
-SeqScan(t2)
-IndexScan(t3 t3_pkey)
-BitmapScan(t4 t4_pkey)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Seq Scan on r2
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3
- Index Cond: (c1 = t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t4
- Recheck Cond: (c1 = t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = t1.c1)
-
- Aggregate
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Seq Scan on r2
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3
- Index Cond: (c1 = t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t4
- Recheck Cond: (c1 = t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = t1.c1)
-(41 rows)
-
-EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Nested Loop
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
-(39 rows)
-
-/*+TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
-BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
-SeqScan(r2_)*/
-EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(b1t3): t3_pkey
-LOG: available indexes for BitmapScan(b1t4): t4_pkey
-LOG: pg_hint_plan:
-used hint:
-TidScan(b1t1)
-SeqScan(b1t2)
-IndexScan(b1t3 t3_pkey)
-BitmapScan(b1t4 t4_pkey)
-SeqScan(r2_)
-not used hint:
-BitmapScan(b2t1 t1_pkey)
-TidScan(b2t2)
-SeqScan(b2t3)
-IndexScan(b2t4 t4_pkey)
-duplication hint:
-error hint:
-
-LOG: available indexes for BitmapScan(b2t1): t1_pkey
-LOG: available indexes for IndexScan(b2t4): t4_pkey
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(b2t1 t1_pkey)
-TidScan(b2t2)
-SeqScan(b2t3)
-IndexScan(b2t4 t4_pkey)
-SeqScan(r2_)
-not used hint:
-TidScan(b1t1)
-SeqScan(b1t2)
-IndexScan(b1t3 t3_pkey)
-BitmapScan(b1t4 t4_pkey)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Seq Scan on r2_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3 b1t3
- Index Cond: (c1 = b1t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t4 b1t4
- Recheck Cond: (c1 = b1t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = b1t1.c1)
-
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- -> Nested Loop
- -> Seq Scan on r2_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t2 b2t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t1 b2t1
- Recheck Cond: (c1 = b2t2.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (c1 = b2t2.c1)
- -> Seq Scan on t3 b2t3
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t4_pkey on t4 b2t4
- Index Cond: (c1 = b2t1.c1)
- Filter: (ctid = '(1,1)'::tid)
-(41 rows)
-
--- No. S-2-3-3
-EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t3.c1)
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4
- TID Cond: (ctid = '(1,1)'::tid)
-(59 rows)
-
-/*+TidScan(t1)SeqScan(t2)IndexScan(t3 t3_pkey)BitmapScan(t4 t4_pkey)
-SeqScan(r3)*/
-EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(t3): t3_pkey
-LOG: available indexes for BitmapScan(t4): t4_pkey
-LOG: pg_hint_plan:
-used hint:
-SeqScan(r3)
-TidScan(t1)
-SeqScan(t2)
-IndexScan(t3 t3_pkey)
-BitmapScan(t4 t4_pkey)
-not used hint:
-duplication hint:
-error hint:
-
-LOG: available indexes for IndexScan(t3): t3_pkey
-LOG: available indexes for BitmapScan(t4): t4_pkey
-LOG: pg_hint_plan:
-used hint:
-SeqScan(r3)
-TidScan(t1)
-SeqScan(t2)
-IndexScan(t3 t3_pkey)
-BitmapScan(t4 t4_pkey)
-not used hint:
-duplication hint:
-error hint:
-
-LOG: available indexes for IndexScan(t3): t3_pkey
-LOG: available indexes for BitmapScan(t4): t4_pkey
-LOG: pg_hint_plan:
-used hint:
-SeqScan(r3)
-TidScan(t1)
-SeqScan(t2)
-IndexScan(t3 t3_pkey)
-BitmapScan(t4 t4_pkey)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Seq Scan on r3
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3
- Index Cond: (c1 = t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t4
- Recheck Cond: (c1 = t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = t1.c1)
-
- Aggregate
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Seq Scan on r3
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3
- Index Cond: (c1 = t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t4
- Recheck Cond: (c1 = t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = t1.c1)
-
- Aggregate
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- Join Filter: (t1.c1 = t2.c1)
- -> Nested Loop
- -> Seq Scan on r3
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3
- Index Cond: (c1 = t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t4
- Recheck Cond: (c1 = t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = t1.c1)
-(62 rows)
-
-EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b2t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Tid Scan on t1 b3t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4
- TID Cond: (ctid = '(1,1)'::tid)
-(59 rows)
-
-/*+TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
-BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
-IndexScan(b3t1 t1_pkey)BitmapScan(b3t2 t2_pkey)TidScan(b3t3)SeqScan(b3t4)
-SeqScan(r3_)*/
-EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(b1t3): t3_pkey
-LOG: available indexes for BitmapScan(b1t4): t4_pkey
-LOG: pg_hint_plan:
-used hint:
-TidScan(b1t1)
-SeqScan(b1t2)
-IndexScan(b1t3 t3_pkey)
-BitmapScan(b1t4 t4_pkey)
-SeqScan(r3_)
-not used hint:
-BitmapScan(b2t1 t1_pkey)
-TidScan(b2t2)
-SeqScan(b2t3)
-IndexScan(b2t4 t4_pkey)
-IndexScan(b3t1 t1_pkey)
-BitmapScan(b3t2 t2_pkey)
-TidScan(b3t3)
-SeqScan(b3t4)
-duplication hint:
-error hint:
-
-LOG: available indexes for BitmapScan(b2t1): t1_pkey
-LOG: available indexes for IndexScan(b2t4): t4_pkey
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(b2t1 t1_pkey)
-TidScan(b2t2)
-SeqScan(b2t3)
-IndexScan(b2t4 t4_pkey)
-SeqScan(r3_)
-not used hint:
-TidScan(b1t1)
-SeqScan(b1t2)
-IndexScan(b1t3 t3_pkey)
-BitmapScan(b1t4 t4_pkey)
-IndexScan(b3t1 t1_pkey)
-BitmapScan(b3t2 t2_pkey)
-TidScan(b3t3)
-SeqScan(b3t4)
-duplication hint:
-error hint:
-
-LOG: available indexes for IndexScan(b3t1): t1_pkey
-LOG: available indexes for BitmapScan(b3t2): t2_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexScan(b3t1 t1_pkey)
-BitmapScan(b3t2 t2_pkey)
-TidScan(b3t3)
-SeqScan(b3t4)
-SeqScan(r3_)
-not used hint:
-TidScan(b1t1)
-SeqScan(b1t2)
-IndexScan(b1t3 t3_pkey)
-BitmapScan(b1t4 t4_pkey)
-BitmapScan(b2t1 t1_pkey)
-TidScan(b2t2)
-SeqScan(b2t3)
-IndexScan(b2t4 t4_pkey)
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Seq Scan on r3_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1 b1t1
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3 b1t3
- Index Cond: (c1 = b1t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t4 b1t4
- Recheck Cond: (c1 = b1t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = b1t1.c1)
-
- Aggregate
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Nested Loop
- -> Nested Loop
- -> Seq Scan on r3_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t2 b2t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t1 b2t1
- Recheck Cond: (c1 = b2t2.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (c1 = b2t2.c1)
- -> Seq Scan on t3 b2t3
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t4_pkey on t4 b2t4
- Index Cond: (c1 = b2t1.c1)
- Filter: (ctid = '(1,1)'::tid)
-
- Aggregate
- -> Nested Loop
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Seq Scan on r3_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Index Scan using t1_pkey on t1 b3t1
- Index Cond: (c1 = b3t3.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t2 b3t2
- Recheck Cond: (c1 = b3t1.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (c1 = b3t1.c1)
- -> Seq Scan on t4 b3t4
- Filter: (ctid = '(1,1)'::tid)
-(62 rows)
-
--- No. S-2-3-4
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
- QUERY PLAN
-----------------------------------
- Hash Join
- Hash Cond: (v1t1.c1 = v1t1.c1)
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1
-(5 rows)
-
-/*+BitmapScan(v1t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(v1t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Index Scan using t1_i1 on t1 v1t1
- -> Bitmap Heap Scan on t1 v1t1
- Recheck Cond: (c1 = v1t1.c1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = v1t1.c1)
-(6 rows)
-
--- No. S-2-3-5
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
- QUERY PLAN
------------------------------------
- Hash Join
- Hash Cond: (v1t1.c1 = v1t1_.c1)
- -> Seq Scan on t1 v1t1
- -> Hash
- -> Seq Scan on t1 v1t1_
-(5 rows)
-
-/*+SeqScan(v1t1)BitmapScan(v1t1_)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(v1t1)
-BitmapScan(v1t1_)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Seq Scan on t1 v1t1
- -> Bitmap Heap Scan on t1 v1t1_
- Recheck Cond: (c1 = v1t1.c1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = v1t1.c1)
-(6 rows)
-
--- No. S-2-3-6
-EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-----------------------------------
- Hash Join
- Hash Cond: (r4t1.c1 = r4t1.c1)
- -> Seq Scan on t1 r4t1
- -> Hash
- -> Seq Scan on t1 r4t1
-(5 rows)
-
-/*+BitmapScan(r4t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(r4t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Index Scan using t1_i1 on t1 r4t1
- -> Bitmap Heap Scan on t1 r4t1
- Recheck Cond: (c1 = r4t1.c1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = r4t1.c1)
-(6 rows)
-
--- No. S-2-3-7
-EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
- QUERY PLAN
-----------------------------------
- Hash Join
- Hash Cond: (r4t1.c1 = r5t1.c1)
- -> Seq Scan on t1 r4t1
- -> Hash
- -> Seq Scan on t1 r5t1
-(5 rows)
-
-/*+SeqScan(r4t1)BitmapScan(r5t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(r4t1)
-BitmapScan(r5t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------
- Nested Loop
- -> Seq Scan on t1 r4t1
- -> Bitmap Heap Scan on t1 r5t1
- Recheck Cond: (c1 = r4t1.c1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = r4t1.c1)
-(6 rows)
-
-----
----- No. S-2-4 VALUES clause
-----
--- No. S-2-4-1
-EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1) WHERE t1.c1 = 1;
- QUERY PLAN
----------------------------
- Values Scan on "*VALUES*"
- Filter: (column1 = 1)
-(2 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1) WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(t1)
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------
- Values Scan on "*VALUES*"
- Filter: (column1 = 1)
-(2 rows)
-
-/*+SeqScan(*VALUES*)*/
-EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1) WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(*VALUES*)
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------
- Values Scan on "*VALUES*"
- Filter: (column1 = 1)
-(2 rows)
-
--- No. S-2-4-2
-EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t2 (c1, c2) WHERE t1.c1 = t2.c1;
- QUERY PLAN
-----------------------------------------------------------
- Nested Loop
- Join Filter: ("*VALUES*".column1 = "*VALUES*".column1)
- -> Values Scan on "*VALUES*"
- -> Values Scan on "*VALUES*"
-(4 rows)
-
-/*+SeqScan(t1 t2)*/
-EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t2 (c1, c2) WHERE t1.c1 = t2.c1;
-INFO: hint syntax error at or near ""
-DETAIL: SeqScan hint accepts only one relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-SeqScan(t1 t2)
-
- QUERY PLAN
-----------------------------------------------------------
- Nested Loop
- Join Filter: ("*VALUES*".column1 = "*VALUES*".column1)
- -> Values Scan on "*VALUES*"
- -> Values Scan on "*VALUES*"
-(4 rows)
-
-/*+SeqScan(*VALUES*)*/
-EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t2 (c1, c2) WHERE t1.c1 = t2.c1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(*VALUES*)
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------
- Nested Loop
- Join Filter: ("*VALUES*".column1 = "*VALUES*".column1)
- -> Values Scan on "*VALUES*"
- -> Values Scan on "*VALUES*"
-(4 rows)
-
-----
----- No. S-3-1 scan method hint
-----
--- No. S-3-1-1
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 >= 1)
-(2 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 >= 1)
-(2 rows)
-
--- No. S-3-1-2
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on t1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. S-3-1-3
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+IndexScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. S-3-1-4
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 >= 1)
-(2 rows)
-
-/*+IndexScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
-LOG: pg_hint_plan:
-used hint:
-IndexScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 >= 1)
-(2 rows)
-
--- No. S-3-1-5
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
- QUERY PLAN
----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c3 < 10)
- -> Bitmap Index Scan on t1_i
- Index Cond: (c3 < 10)
-(4 rows)
-
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c3 < 10)
- -> Bitmap Index Scan on t1_i
- Index Cond: (c3 < 10)
-(4 rows)
-
--- No. S-3-1-6
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
-(4 rows)
-
--- No. S-3-1-7
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
- QUERY PLAN
------------------------------------
- Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
-/*+TidScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-1-8
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid IN ('(1,1)', '(2,2)', '(3,3)');
- QUERY PLAN
--------------------------------------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
- Filter: (ctid = ANY ('{"(1,1)","(2,2)","(3,3)"}'::tid[]))
-(3 rows)
-
-/*+TidScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid IN ('(1,1)', '(2,2)', '(3,3)');
-LOG: pg_hint_plan:
-used hint:
-TidScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------
- Tid Scan on t1
- TID Cond: (ctid = ANY ('{"(1,1)","(2,2)","(3,3)"}'::tid[]))
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-1-9
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 >= 1)
-(2 rows)
-
-/*+NoSeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
-LOG: pg_hint_plan:
-used hint:
-NoSeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 >= 1)
-(2 rows)
-
--- No. S-3-1-10
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+NoSeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-NoSeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. S-3-1-11
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+NoIndexScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-NoIndexScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
-(4 rows)
-
--- No. S-3-1-12
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 >= 1)
-(2 rows)
-
-/*+NoIndexScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
-LOG: pg_hint_plan:
-used hint:
-NoIndexScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 >= 1)
-(2 rows)
-
--- No. S-3-1-13
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
- QUERY PLAN
----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c3 < 10)
- -> Bitmap Index Scan on t1_i
- Index Cond: (c3 < 10)
-(4 rows)
-
-/*+NoBitmapScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
-LOG: pg_hint_plan:
-used hint:
-NoBitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c3 < 10)
-(2 rows)
-
--- No. S-3-1-14
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+NoBitmapScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-NoBitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. S-3-1-15
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
- QUERY PLAN
------------------------------------
- Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
-/*+NoTidScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoTidScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
- Filter: (ctid = '(1,1)'::tid)
-(3 rows)
-
--- No. S-3-1-16
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+NoTidScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-NoTidScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. S-3-1-17
-EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
------------------------------------
- Index Only Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+IndexOnlyScan(t1)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Index Only Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. S-3-1-18
-EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 >= 1)
-(2 rows)
-
-/*+IndexOnlyScan(t1)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Index Only Scan using t1_i1 on t1
- Index Cond: (c1 >= 1)
-(2 rows)
-
--- No. S-3-1-19
-EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
------------------------------------
- Index Only Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+NoIndexOnlyScan(t1)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-NoIndexOnlyScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. S-3-1-20
-EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 >= 1)
-(2 rows)
-
-/*+NoIndexOnlyScan(t1)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
-LOG: pg_hint_plan:
-used hint:
-NoIndexOnlyScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 >= 1)
-(2 rows)
-
-----
----- No. S-3-3 index name specified
-----
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c2 = 1)
-(3 rows)
-
-SET enable_tidscan TO off;
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
- QUERY PLAN
----------------------------------
- Index Scan using ti1_i2 on ti1
- Index Cond: (c2 = 1)
- Filter: (ctid = '(1,1)'::tid)
-(3 rows)
-
-SET enable_indexscan TO off;
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c2 = 1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on ti1_i2
- Index Cond: (c2 = 1)
-(5 rows)
-
-RESET enable_tidscan;
-RESET enable_indexscan;
-EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
- QUERY PLAN
----------------------
- Seq Scan on ti1
- Filter: (c2 >= 1)
-(2 rows)
-
--- No. S-3-3-1
-/*+IndexScan(ti1 ti1_i3)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(ti1): ti1_i3
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_i3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------
- Index Scan using ti1_i3 on ti1
- Index Cond: (c2 = 1)
- Filter: (ctid = '(1,1)'::tid)
-(3 rows)
-
--- No. S-3-3-2
-/*+IndexScan(ti1 ti1_i3 ti1_i2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(ti1): ti1_i3 ti1_i2
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_i3 ti1_i2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------
- Index Scan using ti1_i2 on ti1
- Index Cond: (c2 = 1)
- Filter: (ctid = '(1,1)'::tid)
-(3 rows)
-
--- No. S-3-3-3
-/*+IndexScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(ti1): ti1_i4 ti1_i3 ti1_i2 ti1_i1
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------
- Index Scan using ti1_i2 on ti1
- Index Cond: (c2 = 1)
- Filter: (ctid = '(1,1)'::tid)
-(3 rows)
-
--- No. S-3-3-4
-/*+BitmapScan(ti1 ti1_i3)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
-LOG: available indexes for BitmapScan(ti1): ti1_i3
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_i3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c2 = 1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on ti1_i3
- Index Cond: (c2 = 1)
-(5 rows)
-
--- No. S-3-3-5
-/*+BitmapScan(ti1 ti1_i3 ti1_i2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
-LOG: available indexes for BitmapScan(ti1): ti1_i3 ti1_i2
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_i3 ti1_i2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c2 = 1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on ti1_i2
- Index Cond: (c2 = 1)
-(5 rows)
-
--- No. S-3-3-6
-/*+BitmapScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
-LOG: available indexes for BitmapScan(ti1): ti1_i4 ti1_i3 ti1_i2 ti1_i1
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c2 = 1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on ti1_i2
- Index Cond: (c2 = 1)
-(5 rows)
-
--- No. S-3-3-7
-/*+IndexOnlyScan(ti1 ti1_i3)*/
-EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
-LOG: available indexes for IndexOnlyScan(ti1): ti1_i3
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 ti1_i3)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Index Only Scan using ti1_i3 on ti1
- Index Cond: (c2 >= 1)
-(2 rows)
-
--- No. S-3-3-8
-/*+IndexOnlyScan(ti1 ti1_i3 ti1_i2)*/
-EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
-LOG: available indexes for IndexOnlyScan(ti1): ti1_i3 ti1_i2
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 ti1_i3 ti1_i2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Index Only Scan using ti1_i2 on ti1
- Index Cond: (c2 >= 1)
-(2 rows)
-
--- No. S-3-3-9
-/*+IndexOnlyScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
-EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
-LOG: available indexes for IndexOnlyScan(ti1): ti1_i4 ti1_i3 ti1_i2 ti1_i1
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Index Only Scan using ti1_i1 on ti1
- Index Cond: (c2 >= 1)
-(2 rows)
-
-----
----- No. S-3-4 index type
-----
-\d s1.ti1
- Table "s1.ti1"
- Column | Type | Modifiers
---------+---------+-----------
- c1 | integer | not null
- c2 | integer |
- c3 | integer |
- c4 | text |
-Indexes:
- "ti1_pkey" PRIMARY KEY, btree (c1)
- "ti1_c2_key" UNIQUE CONSTRAINT, btree (c2)
- "ti1_uniq" UNIQUE, btree (c1)
- "ti1_btree" btree (c1)
- "ti1_expr" btree ((c1 < 100))
- "ti1_gin" gin (c1)
- "ti1_gist" gist (c1)
- "ti1_hash" hash (c1)
- "ti1_i1" btree (c2)
- "ti1_i2" btree (c2, c4)
- "ti1_i3" btree (c2, c4, c4)
- "ti1_i4" btree (c2, c4, c4, c4)
- "ti1_multi" btree (c1, c2, c3, c4)
- "ti1_pred" btree (lower(c4))
- "ti1_ts" gin (to_tsvector('english'::regconfig, c4))
-
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 < 100) AND (c2 = 1) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
-(3 rows)
-
--- No. S-3-4-1
-/*+IndexScan(ti1 ti1_btree)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(ti1): ti1_btree
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_btree)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------
- Index Scan using ti1_btree on ti1
- Index Cond: (c1 < 100)
- Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
-(3 rows)
-
--- No. S-3-4-2
-/*+IndexScan(ti1 ti1_hash)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(ti1): ti1_hash
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_hash)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------
- Index Scan using ti1_hash on ti1
- Index Cond: (c1 = 100)
- Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
-(3 rows)
-
--- No. S-3-4-3
-/*+IndexScan(ti1 ti1_gist)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(ti1): ti1_gist
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_gist)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------
- Index Scan using ti1_gist on ti1
- Index Cond: (c1 < 100)
- Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
-(3 rows)
-
--- No. S-3-4-4
-/*+IndexScan(ti1 ti1_gin)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(ti1): ti1_gin
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_gin)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 < 100) AND (c2 = 1) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
-(3 rows)
-
--- No. S-3-4-5
-/*+IndexScan(ti1 ti1_expr)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(ti1): ti1_expr
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_expr)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Index Scan using ti1_expr on ti1
- Index Cond: ((c1 < 100) = true)
- Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
-(3 rows)
-
--- No. S-3-4-6
-/*+IndexScan(ti1 ti1_pred)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(ti1): ti1_pred
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_pred)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------
- Index Scan using ti1_pred on ti1
- Index Cond: (lower(c4) = '1'::text)
- Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
-(3 rows)
-
--- No. S-3-4-7
-/*+IndexScan(ti1 ti1_uniq)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(ti1): ti1_uniq
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_uniq)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------
- Index Scan using ti1_uniq on ti1
- Index Cond: (c1 < 100)
- Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
-(3 rows)
-
--- No. S-3-4-8
-/*+IndexScan(ti1 ti1_multi)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(ti1): ti1_multi
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_multi)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------
- Index Scan using ti1_multi on ti1
- Index Cond: ((c1 < 100) AND (c2 = 1))
- Filter: ((ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
-(3 rows)
-
--- No. S-3-4-9
-/*+IndexScan(ti1 ti1_ts)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(ti1): ti1_ts
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_ts)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 < 100) AND (c2 = 1) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
-(3 rows)
-
--- No. S-3-4-10
-/*+IndexScan(ti1 ti1_pkey)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(ti1): ti1_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_pkey)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------
- Index Scan using ti1_pkey on ti1
- Index Cond: (c1 < 100)
- Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
-(3 rows)
-
--- No. S-3-4-11
-/*+IndexScan(ti1 ti1_c2_key)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(ti1): ti1_c2_key
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_c2_key)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------
- Index Scan using ti1_c2_key on ti1
- Index Cond: (c2 = 1)
- Filter: ((c1 < 100) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
-(3 rows)
-
--- No. S-3-4-12
-/*+BitmapScan(ti1 ti1_btree)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for BitmapScan(ti1): ti1_btree
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_btree)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c1 < 100)
- Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
- -> Bitmap Index Scan on ti1_btree
- Index Cond: (c1 < 100)
-(5 rows)
-
--- No. S-3-4-13
-/*+BitmapScan(ti1 ti1_hash)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for BitmapScan(ti1): ti1_hash
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_hash)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c1 = 100)
- Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
- -> Bitmap Index Scan on ti1_hash
- Index Cond: (c1 = 100)
-(5 rows)
-
--- No. S-3-4-14
-/*+BitmapScan(ti1 ti1_gist)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for BitmapScan(ti1): ti1_gist
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_gist)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c1 < 100)
- Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
- -> Bitmap Index Scan on ti1_gist
- Index Cond: (c1 < 100)
-(5 rows)
-
--- No. S-3-4-15
-/*+BitmapScan(ti1 ti1_gin)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for BitmapScan(ti1): ti1_gin
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_gin)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c1 < 100)
- Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
- -> Bitmap Index Scan on ti1_gin
- Index Cond: (c1 < 100)
-(5 rows)
-
--- No. S-3-4-16
-/*+BitmapScan(ti1 ti1_expr)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for BitmapScan(ti1): ti1_expr
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_expr)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Bitmap Heap Scan on ti1
- Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
- -> Bitmap Index Scan on ti1_expr
- Index Cond: ((c1 < 100) = true)
-(4 rows)
-
--- No. S-3-4-17
-/*+BitmapScan(ti1 ti1_pred)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for BitmapScan(ti1): ti1_pred
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_pred)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (lower(c4) = '1'::text)
- Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
- -> Bitmap Index Scan on ti1_pred
- Index Cond: (lower(c4) = '1'::text)
-(5 rows)
-
--- No. S-3-4-18
-/*+BitmapScan(ti1 ti1_uniq)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for BitmapScan(ti1): ti1_uniq
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_uniq)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c1 < 100)
- Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
- -> Bitmap Index Scan on ti1_uniq
- Index Cond: (c1 < 100)
-(5 rows)
-
--- No. S-3-4-19
-/*+BitmapScan(ti1 ti1_multi)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for BitmapScan(ti1): ti1_multi
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_multi)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: ((c1 < 100) AND (c2 = 1))
- Filter: ((ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
- -> Bitmap Index Scan on ti1_multi
- Index Cond: ((c1 < 100) AND (c2 = 1))
-(5 rows)
-
--- No. S-3-4-20
-/*+BitmapScan(ti1 ti1_ts)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for BitmapScan(ti1): ti1_ts
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_ts)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
- Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text))
- -> Bitmap Index Scan on ti1_ts
- Index Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
-(5 rows)
-
--- No. S-3-4-10
-/*+BitmapScan(ti1 ti1_pkey)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for BitmapScan(ti1): ti1_pkey
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_pkey)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c1 < 100)
- Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
- -> Bitmap Index Scan on ti1_pkey
- Index Cond: (c1 < 100)
-(5 rows)
-
--- No. S-3-4-11
-/*+BitmapScan(ti1 ti1_c2_key)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
-LOG: available indexes for BitmapScan(ti1): ti1_c2_key
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_c2_key)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c2 = 1)
- Filter: ((c1 < 100) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
- -> Bitmap Index Scan on ti1_c2_key
- Index Cond: (c2 = 1)
-(5 rows)
-
--- No. S-3-4-23
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
- QUERY PLAN
----------------------
- Seq Scan on ti1
- Filter: (c1 >= 1)
-(2 rows)
-
-/*+IndexOnlyScan(ti1 ti1_btree)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
-LOG: available indexes for IndexOnlyScan(ti1): ti1_btree
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 ti1_btree)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------
- Index Only Scan using ti1_btree on ti1
- Index Cond: (c1 >= 1)
-(2 rows)
-
--- No. S-3-4-24
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
- QUERY PLAN
----------------------------------------
- Index Only Scan using ti1_uniq on ti1
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+IndexOnlyScan(ti1 ti1_hash)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
-LOG: available indexes for IndexOnlyScan(ti1): ti1_hash
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 ti1_hash)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Index Scan using ti1_hash on ti1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. S-3-4-25
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 1;
- QUERY PLAN
----------------------------------------
- Index Only Scan using ti1_uniq on ti1
- Index Cond: (c1 < 1)
-(2 rows)
-
-/*+IndexOnlyScan(ti1 ti1_gist)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 1;
-LOG: available indexes for IndexOnlyScan(ti1): ti1_gist
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 ti1_gist)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Index Scan using ti1_gist on ti1
- Index Cond: (c1 < 1)
-(2 rows)
-
--- No. S-3-4-26
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
- QUERY PLAN
----------------------------------------
- Index Only Scan using ti1_uniq on ti1
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+IndexOnlyScan(ti1 ti1_gin)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
-LOG: available indexes for IndexOnlyScan(ti1): ti1_gin
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 ti1_gin)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on ti1
- Filter: (c1 = 1)
-(2 rows)
-
--- No. S-3-4-27
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 100;
- QUERY PLAN
----------------------------------------
- Index Only Scan using ti1_uniq on ti1
- Index Cond: (c1 < 100)
-(2 rows)
-
-/*+IndexOnlyScan(ti1 ti1_expr)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 100;
-LOG: available indexes for IndexOnlyScan(ti1): ti1_expr
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 ti1_expr)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Index Scan using ti1_expr on ti1
- Index Cond: ((c1 < 100) = true)
- Filter: (c1 < 100)
-(3 rows)
-
--- No. S-3-4-28
-EXPLAIN (COSTS false) SELECT c4 FROM s1.ti1 WHERE lower(c4) >= '1';
- QUERY PLAN
-------------------------------------
- Seq Scan on ti1
- Filter: (lower(c4) >= '1'::text)
-(2 rows)
-
-/*+IndexOnlyScan(ti1 ti1_pred)*/
-EXPLAIN (COSTS false) SELECT c4 FROM s1.ti1 WHERE lower(c4) >= '1';
-LOG: available indexes for IndexOnlyScan(ti1): ti1_pred
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 ti1_pred)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------
- Index Scan using ti1_pred on ti1
- Index Cond: (lower(c4) >= '1'::text)
-(2 rows)
-
--- No. S-3-4-29
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
- QUERY PLAN
----------------------
- Seq Scan on ti1
- Filter: (c1 >= 1)
-(2 rows)
-
-/*+IndexOnlyScan(ti1 ti1_uniq)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
-LOG: available indexes for IndexOnlyScan(ti1): ti1_uniq
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 ti1_uniq)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Index Only Scan using ti1_uniq on ti1
- Index Cond: (c1 >= 1)
-(2 rows)
-
--- No. S-3-4-30
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
- QUERY PLAN
----------------------
- Seq Scan on ti1
- Filter: (c1 >= 1)
-(2 rows)
-
-/*+IndexOnlyScan(ti1 ti1_multi)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
-LOG: available indexes for IndexOnlyScan(ti1): ti1_multi
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 ti1_multi)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------
- Index Only Scan using ti1_multi on ti1
- Index Cond: (c1 >= 1)
-(2 rows)
-
--- No. S-3-4-31
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE to_tsvector('english', c4) @@ 'a & b';
- QUERY PLAN
------------------------------------------------------------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
- -> Bitmap Index Scan on ti1_ts
- Index Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
-(4 rows)
-
-/*+IndexOnlyScan(ti1 ti1_ts)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE to_tsvector('english', c4) @@ 'a & b';
-LOG: available indexes for IndexOnlyScan(ti1): ti1_ts
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 ti1_ts)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------------------------------------------------
- Seq Scan on ti1
- Filter: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
-(2 rows)
-
--- No. S-3-4-32
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
- QUERY PLAN
----------------------
- Seq Scan on ti1
- Filter: (c1 >= 1)
-(2 rows)
-
-/*+IndexOnlyScan(ti1 ti1_pkey)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
-LOG: available indexes for IndexOnlyScan(ti1): ti1_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 ti1_pkey)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Index Only Scan using ti1_pkey on ti1
- Index Cond: (c1 >= 1)
-(2 rows)
-
--- No. S-3-4-33
-EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE c2 >= 1;
- QUERY PLAN
----------------------
- Seq Scan on ti1
- Filter: (c2 >= 1)
-(2 rows)
-
-/*+IndexOnlyScan(ti1 ti1_c2_key)*/
-EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE c2 >= 1;
-LOG: available indexes for IndexOnlyScan(ti1): ti1_c2_key
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 ti1_c2_key)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------
- Index Only Scan using ti1_c2_key on ti1
- Index Cond: (c2 >= 1)
-(2 rows)
-
-----
----- No. S-3-5 not used index
-----
--- No. S-3-5-1
-/*+IndexScan(ti1 ti1_pred)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
-LOG: available indexes for IndexScan(ti1): ti1_pred
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_pred)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------
- Seq Scan on ti1 (cost=10000000000.00..10000000018.50 rows=1 width=15)
- Filter: (c1 = 100)
-(2 rows)
-
--- No. S-3-5-2
-/*+BitmapScan(ti1 ti1_pred)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
-LOG: available indexes for BitmapScan(ti1): ti1_pred
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_pred)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------
- Seq Scan on ti1 (cost=10000000000.00..10000000018.50 rows=1 width=15)
- Filter: (c1 = 100)
-(2 rows)
-
--- No. S-3-5-3
-/*+IndexOnlyScan(ti1 ti1_pred)*/
-EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100;
-LOG: available indexes for IndexOnlyScan(ti1): ti1_pred
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 ti1_pred)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------
- Seq Scan on ti1 (cost=10000000000.00..10000000018.50 rows=1 width=4)
- Filter: (c1 = 100)
-(2 rows)
-
--- No. S-3-5-4
-/*+IndexScan(ti1 not_exist)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
-LOG: available indexes for IndexScan(ti1):
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 not_exist)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------
- Seq Scan on ti1 (cost=10000000000.00..10000000018.50 rows=1 width=15)
- Filter: (c1 = 100)
-(2 rows)
-
--- No. S-3-5-5
-/*+BitmapScan(ti1 not_exist)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
-LOG: available indexes for BitmapScan(ti1):
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 not_exist)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------
- Seq Scan on ti1 (cost=10000000000.00..10000000018.50 rows=1 width=15)
- Filter: (c1 = 100)
-(2 rows)
-
--- No. S-3-5-6
-/*+IndexOnlyScan(ti1 not_exist)*/
-EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100;
-LOG: available indexes for IndexOnlyScan(ti1):
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 not_exist)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------
- Seq Scan on ti1 (cost=10000000000.00..10000000018.50 rows=1 width=4)
- Filter: (c1 = 100)
-(2 rows)
-
--- No. S-3-5-7
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
-(2 rows)
-
-/*+TidScan(t1)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-TidScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------------------------------------------
- Seq Scan on t1 (cost=10000000000.00..10000000018.50 rows=1 width=15)
- Filter: (c1 = 1)
-(2 rows)
-
-----
----- No. S-3-6 query structure
-----
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
- QUERY PLAN
------------------------------------------------
- Hash Join
- Hash Cond: (t2.c1 = t1.c1)
- -> Seq Scan on t2
- -> Hash
- -> Tid Scan on t1
- TID Cond: (ctid = '(1,1)'::tid)
-(6 rows)
-
--- No. S-3-6-1
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE c1 = 100;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------
- Seq Scan on t1
- Filter: (c1 = 100)
-(2 rows)
-
--- No. S-3-6-2
-/*+SeqScan(t1)BitmapScan(t2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-BitmapScan(t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------
- Nested Loop
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t2
- Recheck Cond: (c1 = t1.c1)
- -> Bitmap Index Scan on t2_i1
- Index Cond: (c1 = t1.c1)
-(7 rows)
-
--- No. S-3-6-3
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------
- Hash Join
- Hash Cond: (t2.c1 = t1.c1)
- -> Seq Scan on t2
- -> Hash
- -> Seq Scan on t1
- Filter: (ctid = '(1,1)'::tid)
-(6 rows)
-
-----
----- No. S-3-7 query structure
-----
--- No. S-3-7-1
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.c1 = 1)
-SELECT max(b3t1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
- ) FROM s1.t1 b3t1 WHERE b3t1.c1 = (
-SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
- QUERY PLAN
----------------------------------------------------------------------
- Result
- InitPlan 2 (returns $1)
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Index Only Scan using t1_i1 on t1 b2t1
- Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 4 (returns $3)
- -> Result
- InitPlan 3 (returns $2)
- -> Limit
- -> Index Only Scan using t1_i1 on t1 b4t1
- Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 5 (returns $4)
- -> Limit
- -> Index Only Scan using t1_i1 on t1 b3t1
- Index Cond: ((c1 IS NOT NULL) AND (c1 = $3))
-(17 rows)
-
-/*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
-*/
-EXPLAIN (COSTS false)
-WITH c1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.c1 = 1)
-SELECT max(b3t1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
- ) FROM s1.t1 b3t1 WHERE b3t1.c1 = (
-SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
-LOG: available indexes for IndexScan(b2t1): t1_pkey
-LOG: available indexes for IndexScan(b2t1): t1_pkey
-LOG: available indexes for BitmapScan(b3t1): t1_pkey
-LOG: available indexes for BitmapScan(b3t1): t1_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexScan(b2t1 t1_pkey)
-BitmapScan(b3t1 t1_pkey)
-TidScan(b4t1)
-not used hint:
-SeqScan(b1t1)
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------
- Result
- InitPlan 2 (returns $1)
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Index Scan using t1_pkey on t1 b2t1
- Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 4 (returns $3)
- -> Result
- InitPlan 3 (returns $2)
- -> Limit
- -> Seq Scan on t1 b4t1
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 5 (returns $4)
- -> Limit
- -> Bitmap Heap Scan on t1 b3t1
- Recheck Cond: ((c1 IS NOT NULL) AND (c1 = $3))
- -> Bitmap Index Scan on t1_pkey
- Index Cond: ((c1 IS NOT NULL) AND (c1 = $3))
-(19 rows)
-
--- No. S-3-7-2
-EXPLAIN (COSTS false)
-WITH cte1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
-SELECT max(b3t1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 JOIN s1.t2 b2t2 ON(b2t1.c1 = b2t2.c1) WHERE b2t1.c1 = 1
- ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
-SELECT max(b4t1.c1) FROM s1.t1 b4t1 JOIN s1.t2 b4t2 ON(b4t1.c1 = b4t2.c1) WHERE b4t1.c1 = 1);
- QUERY PLAN
-------------------------------------------------------------
- Aggregate
- CTE cte1
- -> Aggregate
- -> Nested Loop
- -> Index Only Scan using t1_i1 on t1 b1t1
- Index Cond: (c1 = 1)
- -> Seq Scan on t2 b1t2
- Filter: (c1 = 1)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- -> Index Only Scan using t1_i1 on t1 b2t1
- Index Cond: (c1 = 1)
- -> Seq Scan on t2 b2t2
- Filter: (c1 = 1)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- -> Index Only Scan using t1_i1 on t1 b4t1
- Index Cond: (c1 = 1)
- -> Seq Scan on t2 b4t2
- Filter: (c1 = 1)
- -> Nested Loop
- -> Nested Loop
- -> Index Only Scan using t1_i1 on t1 b3t1
- Index Cond: (c1 = $2)
- -> Seq Scan on t2 b3t2
- Filter: (c1 = $2)
- -> CTE Scan on cte1
- Filter: (c1 = $2)
-(30 rows)
-
-/*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
-TidScan(b1t2)SeqScan(b2t2)IndexScan(b3t2 t2_pkey)BitmapScan(b4t2 t2_pkey)
-*/
-EXPLAIN (COSTS false)
-WITH cte1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
-SELECT max(b3t1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 JOIN s1.t2 b2t2 ON(b2t1.c1 = b2t2.c1) WHERE b2t1.c1 = 1
- ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
-SELECT max(b4t1.c1) FROM s1.t1 b4t1 JOIN s1.t2 b4t2 ON(b4t1.c1 = b4t2.c1) WHERE b4t1.c1 = 1);
-LOG: available indexes for IndexScan(b2t1): t1_pkey
-LOG: available indexes for BitmapScan(b4t2): t2_pkey
-LOG: available indexes for BitmapScan(b3t1): t1_pkey
-LOG: available indexes for IndexScan(b3t2): t2_pkey
-LOG: pg_hint_plan:
-used hint:
-SeqScan(b1t1)
-TidScan(b1t2)
-IndexScan(b2t1 t1_pkey)
-SeqScan(b2t2)
-BitmapScan(b3t1 t1_pkey)
-IndexScan(b3t2 t2_pkey)
-TidScan(b4t1)
-BitmapScan(b4t2 t2_pkey)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------
- Aggregate
- CTE cte1
- -> Aggregate
- -> Nested Loop
- -> Seq Scan on t1 b1t1
- Filter: (c1 = 1)
- -> Seq Scan on t2 b1t2
- Filter: (c1 = 1)
- InitPlan 2 (returns $1)
- -> Aggregate
- -> Nested Loop
- -> Index Scan using t1_pkey on t1 b2t1
- Index Cond: (c1 = 1)
- -> Seq Scan on t2 b2t2
- Filter: (c1 = 1)
- InitPlan 3 (returns $2)
- -> Aggregate
- -> Nested Loop
- -> Seq Scan on t1 b4t1
- Filter: (c1 = 1)
- -> Bitmap Heap Scan on t2 b4t2
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (c1 = 1)
- -> Nested Loop
- -> Nested Loop
- -> Bitmap Heap Scan on t1 b3t1
- Recheck Cond: (c1 = $2)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (c1 = $2)
- -> Index Scan using t2_pkey on t2 b3t2
- Index Cond: (c1 = $2)
- -> CTE Scan on cte1
- Filter: (c1 = $2)
-(34 rows)
-
--- No. S-3-7-3
-EXPLAIN (COSTS false)
-WITH cte1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
-SELECT max(b3t1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
- ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
-SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
- QUERY PLAN
----------------------------------------------------------------------
- Aggregate
- CTE cte1
- -> Aggregate
- -> Nested Loop
- -> Index Only Scan using t1_i1 on t1 b1t1
- Index Cond: (c1 = 1)
- -> Seq Scan on t2 b1t2
- Filter: (c1 = 1)
- InitPlan 3 (returns $2)
- -> Result
- InitPlan 2 (returns $1)
- -> Limit
- -> Index Only Scan using t1_i1 on t1 b2t1
- Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 5 (returns $4)
- -> Result
- InitPlan 4 (returns $3)
- -> Limit
- -> Index Only Scan using t1_i1 on t1 b4t1
- Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- -> Nested Loop
- -> Nested Loop
- -> Index Only Scan using t1_i1 on t1 b3t1
- Index Cond: (c1 = $4)
- -> Seq Scan on t2 b3t2
- Filter: (c1 = $4)
- -> CTE Scan on cte1
- Filter: (c1 = $4)
-(28 rows)
-
-/*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
-TidScan(b1t2)IndexScan(b3t2 t2_pkey)
-*/
-EXPLAIN (COSTS false)
-WITH cte1 (c1) AS (
-SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
-SELECT max(b3t1.c1), (
-SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
- ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
-SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
-LOG: available indexes for IndexScan(b2t1): t1_pkey
-LOG: available indexes for IndexScan(b2t1): t1_pkey
-LOG: available indexes for BitmapScan(b3t1): t1_pkey
-LOG: available indexes for IndexScan(b3t2): t2_pkey
-LOG: pg_hint_plan:
-used hint:
-SeqScan(b1t1)
-TidScan(b1t2)
-IndexScan(b2t1 t1_pkey)
-BitmapScan(b3t1 t1_pkey)
-IndexScan(b3t2 t2_pkey)
-TidScan(b4t1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------
- Aggregate
- CTE cte1
- -> Aggregate
- -> Nested Loop
- -> Seq Scan on t1 b1t1
- Filter: (c1 = 1)
- -> Seq Scan on t2 b1t2
- Filter: (c1 = 1)
- InitPlan 3 (returns $2)
- -> Result
- InitPlan 2 (returns $1)
- -> Limit
- -> Index Scan using t1_pkey on t1 b2t1
- Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 5 (returns $4)
- -> Result
- InitPlan 4 (returns $3)
- -> Limit
- -> Seq Scan on t1 b4t1
- Filter: ((c1 IS NOT NULL) AND (c1 = 1))
- -> Nested Loop
- -> Nested Loop
- -> Bitmap Heap Scan on t1 b3t1
- Recheck Cond: (c1 = $4)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: (c1 = $4)
- -> Index Scan using t2_pkey on t2 b3t2
- Index Cond: (c1 = $4)
- -> CTE Scan on cte1
- Filter: (c1 = $4)
-(30 rows)
-
-----
----- No. S-3-8 inheritance table select type
-----
--- No. S-3-8-1
-EXPLAIN (COSTS false) SELECT * FROM ONLY s1.p1 WHERE c1 = 1;
- QUERY PLAN
---------------------
- Seq Scan on p1
- Filter: (c1 = 1)
-(2 rows)
-
-/*+IndexScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM ONLY s1.p1 WHERE c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------
- Index Scan using p1_i on p1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. S-3-8-2
-EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
- QUERY PLAN
----------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: (c1 = 1)
- -> Seq Scan on p1c1 p1
- Filter: (c1 = 1)
-(6 rows)
-
-/*+IndexScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Result
- -> Append
- -> Index Scan using p1_i on p1
- Index Cond: (c1 = 1)
- -> Index Scan using p1c1_i on p1c1 p1
- Index Cond: (c1 = 1)
-(6 rows)
-
-----
----- No. S-3-9 inheritance table number
-----
--- No. S-3-9-1
-EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
- QUERY PLAN
----------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: (c1 = 1)
- -> Seq Scan on p1c1 p1
- Filter: (c1 = 1)
-(6 rows)
-
-/*+IndexScan(p1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Result
- -> Append
- -> Index Scan using p1_i on p1
- Index Cond: (c1 = 1)
- -> Index Scan using p1c1_i on p1c1 p1
- Index Cond: (c1 = 1)
-(6 rows)
-
--- No. S-3-9-2
-EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
- QUERY PLAN
------------------------------------
- Result
- -> Append
- -> Seq Scan on p2
- Filter: (c1 = 1)
- -> Seq Scan on p2c1 p2
- Filter: (c1 = 1)
- -> Seq Scan on p2c1c1 p2
- Filter: (c1 = 1)
-(8 rows)
-
-/*+IndexScan(p2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------
- Result
- -> Append
- -> Index Scan using p2_i on p2
- Index Cond: (c1 = 1)
- -> Index Scan using p2c1_i on p2c1 p2
- Index Cond: (c1 = 1)
- -> Index Scan using p2c1c1_i on p2c1c1 p2
- Index Cond: (c1 = 1)
-(8 rows)
-
-----
----- No. S-3-10 inheritance table specified table
-----
-EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
- QUERY PLAN
------------------------------------
- Result
- -> Append
- -> Seq Scan on p2
- Filter: (c1 = 1)
- -> Seq Scan on p2c1 p2
- Filter: (c1 = 1)
- -> Seq Scan on p2c1c1 p2
- Filter: (c1 = 1)
-(8 rows)
-
--- No. S-3-10-1
-/*+IndexScan(p2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------------------
- Result
- -> Append
- -> Index Scan using p2_i on p2
- Index Cond: (c1 = 1)
- -> Index Scan using p2c1_i on p2c1 p2
- Index Cond: (c1 = 1)
- -> Index Scan using p2c1c1_i on p2c1c1 p2
- Index Cond: (c1 = 1)
-(8 rows)
-
--- No. S-3-10-2
-/*+IndexScan(p2c1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-IndexScan(p2c1)
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Result
- -> Append
- -> Seq Scan on p2
- Filter: (c1 = 1)
- -> Seq Scan on p2c1 p2
- Filter: (c1 = 1)
- -> Seq Scan on p2c1c1 p2
- Filter: (c1 = 1)
-(8 rows)
-
--- No. S-3-10-3
-EXPLAIN SELECT c4 FROM s1.p1 WHERE c2 * 2 < 100 AND c1 < 10;
- QUERY PLAN
--------------------------------------------------------------------
- Result (cost=0.00..2.75 rows=4 width=10)
- -> Append (cost=0.00..2.75 rows=4 width=10)
- -> Seq Scan on p1 (cost=0.00..0.00 rows=1 width=32)
- Filter: ((c1 < 10) AND ((c2 * 2) < 100))
- -> Seq Scan on p1c1 p1 (cost=0.00..2.75 rows=3 width=2)
- Filter: ((c1 < 10) AND ((c2 * 2) < 100))
-(6 rows)
-
-/*+IndexScan(p1 p1_parent)*/
-EXPLAIN SELECT c4 FROM s1.p1 WHERE c2 * 2 < 100 AND c1 < 10;
-LOG: available indexes for IndexScan(p1): p1_parent
-LOG: available indexes for IndexScan(p1c1): p1c1_c4_expr_idx
-LOG: available indexes for IndexScan(p1c2): p1c2_c4_expr_idx
-LOG: available indexes for IndexScan(p1c3): p1c3_c4_expr_idx
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p1 p1_parent)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------------------------------
- Result (cost=0.00..20.73 rows=4 width=10)
- -> Append (cost=0.00..20.73 rows=4 width=10)
- -> Index Scan using p1_parent on p1 (cost=0.00..8.27 rows=1 width=32)
- Filter: ((c2 * 2) < 100)
- -> Index Scan using p1c1_c4_expr_idx on p1c1 p1 (cost=0.00..12.45 rows=3 width=2)
- Filter: ((c2 * 2) < 100)
-(6 rows)
-
--- No. S-3-10-4
-/*+IndexScan(p1 p1_i2)*/
-EXPLAIN SELECT c2 FROM s1.p1 WHERE c2 = 1;
-LOG: available indexes for IndexScan(p1): p1_i2
-LOG: available indexes for IndexScan(p1c1):
-LOG: available indexes for IndexScan(p1c2):
-LOG: available indexes for IndexScan(p1c3):
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p1 p1_i2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------------------------------------------
- Result (cost=0.00..30000000015.02 rows=4 width=4)
- -> Append (cost=0.00..30000000015.02 rows=4 width=4)
- -> Index Scan using p1_i2 on p1 (cost=0.00..8.27 rows=1 width=4)
- Index Cond: (c2 = 1)
- -> Seq Scan on p1c1 p1 (cost=10000000000.00..10000000002.25 rows=1 width=4)
- Filter: (c2 = 1)
- -> Seq Scan on p1c2 p1 (cost=10000000000.00..10000000002.25 rows=1 width=4)
- Filter: (c2 = 1)
- -> Seq Scan on p1c3 p1 (cost=10000000000.00..10000000002.25 rows=1 width=4)
- Filter: (c2 = 1)
-(10 rows)
-
--- No. S-3-10-5
-/*+IndexScan(p2 p2c1_pkey)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.p2 WHERE c1 = 1;
-LOG: available indexes for IndexScan(p2):
-LOG: available indexes for IndexScan(p2c1): p2c1_pkey
-LOG: available indexes for IndexScan(p2c2):
-LOG: available indexes for IndexScan(p2c3):
-LOG: available indexes for IndexScan(p2c1c1):
-LOG: available indexes for IndexScan(p2c1c2):
-LOG: available indexes for IndexScan(p2c2c1):
-LOG: available indexes for IndexScan(p2c2c2):
-LOG: available indexes for IndexScan(p2c3c1):
-LOG: available indexes for IndexScan(p2c3c2):
-LOG: pg_hint_plan:
-used hint:
-IndexScan(p2 p2c1_pkey)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------------------------------------------------
- Result (cost=10000000000.00..20000000009.89 rows=3 width=34)
- -> Append (cost=10000000000.00..20000000009.89 rows=3 width=34)
- -> Seq Scan on p2 (cost=10000000000.00..10000000000.00 rows=1 width=44)
- Filter: (c1 = 1)
- -> Index Scan using p2c1_pkey on p2c1 p2 (cost=0.00..8.27 rows=1 width=44)
- Index Cond: (c1 = 1)
- -> Seq Scan on p2c1c1 p2 (cost=10000000000.00..10000000001.62 rows=1 width=14)
- Filter: (c1 = 1)
-(8 rows)
-
-----
----- No. S-3-11 specified same table
-----
--- No. S-3-11-1
-/*+IndexScan(ti1) BitmapScan(ti1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO: hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
-DETAIL: Conflict scan method hint.
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1)
-not used hint:
-duplication hint:
-IndexScan(ti1)
-error hint:
-
- QUERY PLAN
--------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c1 = 1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on ti1_uniq
- Index Cond: (c1 = 1)
-(5 rows)
-
--- No. S-3-11-2
-/*+IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO: hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
-DETAIL: Conflict scan method hint.
-LOG: available indexes for BitmapScan(ti1): ti1_btree
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_btree)
-not used hint:
-duplication hint:
-IndexScan(ti1 ti1_pkey)
-error hint:
-
- QUERY PLAN
---------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c1 = 1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on ti1_btree
- Index Cond: (c1 = 1)
-(5 rows)
-
--- No. S-3-11-3
-/*+BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO: hint syntax error at or near "BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)"
-DETAIL: Conflict scan method hint.
-INFO: hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
-DETAIL: Conflict scan method hint.
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1)
-not used hint:
-duplication hint:
-BitmapScan(ti1)
-IndexScan(ti1)
-error hint:
-
- QUERY PLAN
--------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c1 = 1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on ti1_uniq
- Index Cond: (c1 = 1)
-(5 rows)
-
--- No. S-3-11-4
-/*+BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO: hint syntax error at or near "BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
-DETAIL: Conflict scan method hint.
-INFO: hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
-DETAIL: Conflict scan method hint.
-LOG: available indexes for BitmapScan(ti1): ti1_btree
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_btree)
-not used hint:
-duplication hint:
-BitmapScan(ti1 ti1_hash)
-IndexScan(ti1 ti1_pkey)
-error hint:
-
- QUERY PLAN
---------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c1 = 1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on ti1_btree
- Index Cond: (c1 = 1)
-(5 rows)
-
-----
----- No. S-3-12 message output
-----
--- No. S-3-12-1
-/*+SeqScan(ti1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-SeqScan(ti1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Seq Scan on ti1
- Filter: ((c1 = 1) AND (ctid = '(1,1)'::tid))
-(2 rows)
-
--- No. S-3-12-2
-/*+SeqScan(ti1 ti1_pkey)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO: hint syntax error at or near ""
-DETAIL: SeqScan hint accepts only one relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-SeqScan(ti1 ti1_pkey)
-
- QUERY PLAN
------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-12-3
-/*+SeqScan(ti1 ti1_pkey ti1_btree)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO: hint syntax error at or near ""
-DETAIL: SeqScan hint accepts only one relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-SeqScan(ti1 ti1_pkey ti1_btree)
-
- QUERY PLAN
------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-12-4
-/*+IndexScan(ti1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Index Scan using ti1_uniq on ti1
- Index Cond: (c1 = 1)
- Filter: (ctid = '(1,1)'::tid)
-(3 rows)
-
--- No. S-3-12-5
-/*+IndexScan(ti1 ti1_pkey)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(ti1): ti1_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_pkey)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Index Scan using ti1_pkey on ti1
- Index Cond: (c1 = 1)
- Filter: (ctid = '(1,1)'::tid)
-(3 rows)
-
--- No. S-3-12-6
-/*+IndexScan(ti1 ti1_pkey ti1_btree)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: available indexes for IndexScan(ti1): ti1_btree ti1_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_pkey ti1_btree)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Index Scan using ti1_btree on ti1
- Index Cond: (c1 = 1)
- Filter: (ctid = '(1,1)'::tid)
-(3 rows)
-
--- No. S-3-12-7
-/*+BitmapScan(ti1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c1 = 1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on ti1_uniq
- Index Cond: (c1 = 1)
-(5 rows)
-
--- No. S-3-12-8
-/*+BitmapScan(ti1 ti1_pkey)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: available indexes for BitmapScan(ti1): ti1_pkey
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_pkey)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
--------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c1 = 1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on ti1_pkey
- Index Cond: (c1 = 1)
-(5 rows)
-
--- No. S-3-12-9
-/*+BitmapScan(ti1 ti1_pkey ti1_btree)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: available indexes for BitmapScan(ti1): ti1_btree ti1_pkey
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(ti1 ti1_pkey ti1_btree)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------
- Bitmap Heap Scan on ti1
- Recheck Cond: (c1 = 1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on ti1_btree
- Index Cond: (c1 = 1)
-(5 rows)
-
--- No. S-3-12-10
-/*+TidScan(ti1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-TidScan(ti1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-12-11
-/*+TidScan(ti1 ti1_pkey)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO: hint syntax error at or near ""
-DETAIL: TidScan hint accepts only one relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-TidScan(ti1 ti1_pkey)
-
- QUERY PLAN
------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-12-12
-/*+TidScan(ti1 ti1_pkey ti1_btree)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO: hint syntax error at or near ""
-DETAIL: TidScan hint accepts only one relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-TidScan(ti1 ti1_pkey ti1_btree)
-
- QUERY PLAN
------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-12-13
-/*+NoSeqScan(ti1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoSeqScan(ti1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-12-14
-/*+NoSeqScan(ti1 ti1_pkey)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO: hint syntax error at or near ""
-DETAIL: NoSeqScan hint accepts only one relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-NoSeqScan(ti1 ti1_pkey)
-
- QUERY PLAN
------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-12-15
-/*+NoSeqScan(ti1 ti1_pkey ti1_btree)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO: hint syntax error at or near ""
-DETAIL: NoSeqScan hint accepts only one relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-NoSeqScan(ti1 ti1_pkey ti1_btree)
-
- QUERY PLAN
------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-12-16
-/*+NoIndexScan(ti1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoIndexScan(ti1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-12-17
-/*+NoIndexScan(ti1 ti1_pkey)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO: hint syntax error at or near ""
-DETAIL: NoIndexScan hint accepts only one relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-NoIndexScan(ti1 ti1_pkey)
-
- QUERY PLAN
------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-12-18
-/*+NoIndexScan(ti1 ti1_pkey ti1_btree)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO: hint syntax error at or near ""
-DETAIL: NoIndexScan hint accepts only one relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-NoIndexScan(ti1 ti1_pkey ti1_btree)
-
- QUERY PLAN
------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-12-19
-/*+NoBitmapScan(ti1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoBitmapScan(ti1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-12-20
-/*+NoBitmapScan(ti1 ti1_pkey)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO: hint syntax error at or near ""
-DETAIL: NoBitmapScan hint accepts only one relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-NoBitmapScan(ti1 ti1_pkey)
-
- QUERY PLAN
------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-12-21
-/*+NoBitmapScan(ti1 ti1_pkey ti1_btree)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO: hint syntax error at or near ""
-DETAIL: NoBitmapScan hint accepts only one relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-NoBitmapScan(ti1 ti1_pkey ti1_btree)
-
- QUERY PLAN
------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-12-22
-/*+NoTidScan(ti1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-LOG: pg_hint_plan:
-used hint:
-NoTidScan(ti1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Index Scan using ti1_uniq on ti1
- Index Cond: (c1 = 1)
- Filter: (ctid = '(1,1)'::tid)
-(3 rows)
-
--- No. S-3-12-23
-/*+NoTidScan(ti1 ti1_pkey)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO: hint syntax error at or near ""
-DETAIL: NoTidScan hint accepts only one relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-NoTidScan(ti1 ti1_pkey)
-
- QUERY PLAN
------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-12-24
-/*+NoTidScan(ti1 ti1_pkey ti1_btree)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO: hint syntax error at or near ""
-DETAIL: NoTidScan hint accepts only one relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-NoTidScan(ti1 ti1_pkey ti1_btree)
-
- QUERY PLAN
------------------------------------
- Tid Scan on ti1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
-(3 rows)
-
--- No. S-3-12-25
-/*+IndexOnlyScan(ti1)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Index Only Scan using ti1_uniq on ti1
- Index Cond: (c1 >= 1)
-(2 rows)
-
--- No. S-3-12-26
-/*+IndexOnlyScan(ti1 ti1_pkey)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
-LOG: available indexes for IndexOnlyScan(ti1): ti1_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 ti1_pkey)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------
- Index Only Scan using ti1_pkey on ti1
- Index Cond: (c1 >= 1)
-(2 rows)
-
--- No. S-3-12-27
-/*+IndexOnlyScan(ti1 ti1_pkey ti1_btree)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
-LOG: available indexes for IndexOnlyScan(ti1): ti1_btree ti1_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexOnlyScan(ti1 ti1_pkey ti1_btree)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------------
- Index Only Scan using ti1_btree on ti1
- Index Cond: (c1 >= 1)
-(2 rows)
-
--- No. S-3-12-28
-/*+NoIndexOnlyScan(ti1)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
-LOG: pg_hint_plan:
-used hint:
-NoIndexOnlyScan(ti1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Index Scan using ti1_uniq on ti1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. S-3-12-29
-/*+NoIndexOnlyScan(ti1 ti1_pkey)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
-INFO: hint syntax error at or near ""
-DETAIL: NoIndexOnlyScan hint accepts only one relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-NoIndexOnlyScan(ti1 ti1_pkey)
-
- QUERY PLAN
----------------------------------------
- Index Only Scan using ti1_uniq on ti1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. S-3-12-30
-/*+NoIndexOnlyScan(ti1 ti1_pkey ti1_btree)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
-INFO: hint syntax error at or near ""
-DETAIL: NoIndexOnlyScan hint accepts only one relation.
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-duplication hint:
-error hint:
-NoIndexOnlyScan(ti1 ti1_pkey ti1_btree)
-
- QUERY PLAN
----------------------------------------
- Index Only Scan using ti1_uniq on ti1
- Index Cond: (c1 = 1)
-(2 rows)
-
-----
----- No. S-3-13 message output
-----
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
- QUERY PLAN
---------------------------------
- Index Scan using ti1_i2 on ti1
- Index Cond: (c2 = 1)
-(2 rows)
-
--- No. S-3-13-1
-/*+IndexScanRegexp(ti1 ti1_.*_key)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
-LOG: available indexes for IndexScanRegexp(ti1): ti1_c2_key
-LOG: pg_hint_plan:
-used hint:
-IndexScanRegexp(ti1 ti1_.*_key)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------
- Index Scan using ti1_c2_key on ti1
- Index Cond: (c2 = 1)
-(2 rows)
-
--- No. S-3-13-2
-/*+IndexScanRegexp(ti1 ti1_i.)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
-LOG: available indexes for IndexScanRegexp(ti1): ti1_i4 ti1_i3 ti1_i2 ti1_i1
-LOG: pg_hint_plan:
-used hint:
-IndexScanRegexp(ti1 ti1_i.)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------
- Index Scan using ti1_i2 on ti1
- Index Cond: (c2 = 1)
-(2 rows)
-
--- No. S-3-13-3
-/*+IndexScanRegexp(ti1 no.*_exist)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
-LOG: available indexes for IndexScanRegexp(ti1):
-LOG: pg_hint_plan:
-used hint:
-IndexScanRegexp(ti1 no.*_exist)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on ti1
- Filter: (c2 = 1)
-(2 rows)
-
--- No. S-3-13-4
-/*+IndexScanRegexp(p1 .*pkey)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
-LOG: available indexes for IndexScanRegexp(p1): p1_pkey
-LOG: available indexes for IndexScanRegexp(p1c1): p1c1_pkey
-LOG: available indexes for IndexScanRegexp(p1c2): p1c2_pkey
-LOG: available indexes for IndexScanRegexp(p1c3): p1c3_pkey
-LOG: pg_hint_plan:
-used hint:
-IndexScanRegexp(p1 .*pkey)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------------------------
- Result
- -> Append
- -> Index Scan using p1_pkey on p1
- Index Cond: (c1 = 1)
- -> Index Scan using p1c1_pkey on p1c1 p1
- Index Cond: (c1 = 1)
-(6 rows)
-
--- No. S-3-13-5
-/*+IndexScanRegexp(p1 p1.*i)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
-LOG: available indexes for IndexScanRegexp(p1): p1_i2 p1_i
-LOG: available indexes for IndexScanRegexp(p1c1): p1c1_i p1c1_c4_expr_idx
-LOG: available indexes for IndexScanRegexp(p1c2): p1c2_i p1c2_c4_expr_idx
-LOG: available indexes for IndexScanRegexp(p1c3): p1c3_i p1c3_c4_expr_idx
-LOG: pg_hint_plan:
-used hint:
-IndexScanRegexp(p1 p1.*i)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
-------------------------------------------------
- Result
- -> Append
- -> Index Scan using p1_i on p1
- Index Cond: (c1 = 1)
- -> Index Scan using p1c1_i on p1c1 p1
- Index Cond: (c1 = 1)
-(6 rows)
-
--- No. S-3-13-6
-/*+IndexScanRegexp(p1 no.*_exist)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
-LOG: available indexes for IndexScanRegexp(p1):
-LOG: available indexes for IndexScanRegexp(p1c1):
-LOG: available indexes for IndexScanRegexp(p1c2):
-LOG: available indexes for IndexScanRegexp(p1c3):
-LOG: pg_hint_plan:
-used hint:
-IndexScanRegexp(p1 no.*_exist)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
----------------------------------
- Result
- -> Append
- -> Seq Scan on p1
- Filter: (c1 = 1)
- -> Seq Scan on p1c1 p1
- Filter: (c1 = 1)
-(6 rows)
-
-----
----- No. S-3-14 message output
-----
--- No. S-3-14-1
-/*+IndexScan(ti1 ti1_i1)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
-LOG: available indexes for IndexScan(ti1): ti1_i1
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_i1)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------
- Index Scan using ti1_i1 on ti1
- Index Cond: (c2 = 1)
-(2 rows)
-
--- No. S-3-14-2
-/*+IndexScan(ti1 not_exist)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
-LOG: available indexes for IndexScan(ti1):
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 not_exist)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on ti1
- Filter: (c2 = 1)
-(2 rows)
-
--- No. S-3-14-3
-/*+IndexScan(ti1 ti1_i1 ti1_i2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
-LOG: available indexes for IndexScan(ti1): ti1_i2 ti1_i1
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_i1 ti1_i2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------
- Index Scan using ti1_i2 on ti1
- Index Cond: (c2 = 1)
-(2 rows)
-
--- No. S-3-14-4
-/*+IndexScan(ti1 ti1_i1 not_exist)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
-LOG: available indexes for IndexScan(ti1): ti1_i1
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 ti1_i1 not_exist)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------
- Index Scan using ti1_i1 on ti1
- Index Cond: (c2 = 1)
-(2 rows)
-
--- No. S-3-14-5
-/*+IndexScan(ti1 not_exist1 not_exist2)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
-LOG: available indexes for IndexScan(ti1):
-LOG: pg_hint_plan:
-used hint:
-IndexScan(ti1 not_exist1 not_exist2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------
- Seq Scan on ti1
- Filter: (c2 = 1)
-(2 rows)
-