EXTENSION = pg_hint_plan
DATA = pg_hint_plan--1.0.sql
-EXTRA_CLEAN = core.c sql/ut-fdw.sql expected/ut-fdw.out $(REGRESSION_EXPECTED)
+EXTRA_CLEAN = sql/ut-fdw.sql expected/ut-fdw.out
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
-core.c: core-$(MAJORVERSION).c
- cp core-$(MAJORVERSION).c core.c
-
-$(REGRESSION_EXPECTED): %.out: %-$(MAJORVERSION).out
- cp $< $@
-
installcheck: $(REGRESSION_EXPECTED)
# pg_hint_plan.c includes core.c and make_join_rel.c
+++ /dev/null
-# SPEC file for pg_hint_plan
-# Copyright(C) 2013 NIPPON TELEGRAPH AND TELEPHONE CORPORATION
-
-%define _pgdir /usr/pgsql-9.1
-%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.1
-Name: pg_hint_plan91
-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: postgresql91-devel
-Requires: postgresql91-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.1.
-
-## 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()
- * accumulate_append_subpath()
- * set_dummy_rel_pathlist()
- * 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-2011, 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"
- *
- * The passed-in rel and RTE represent the entire append relation. The
- * relation's contents are computed by appending together the output of
- * the individual member relations. Note that in the inheritance case,
- * the first member relation is actually the same table as is mentioned in
- * the parent RTE ... but it has a different RTE and RelOptInfo. This is
- * a good thing because their outputs are not the same size.
- */
-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;
- double parent_rows;
- double parent_size;
- double *parent_attrsizes;
- int nattrs;
- ListCell *l;
-
- /*
- * Initialize to compute size estimates for whole append relation.
- *
- * We handle width estimates by weighting the widths of different child
- * rels proportionally to their number of rows. This is sensible because
- * the use of width estimates is mainly to compute the total relation
- * "footprint" if we have to sort or hash it. To do this, we sum the
- * total equivalent size (in "double" arithmetic) and then divide by the
- * total rowcount estimate. This is done separately for the total rel
- * width and each attribute.
- *
- * Note: if you consider changing this logic, beware that child rels could
- * have zero rows and/or width, if they were excluded by constraints.
- */
- parent_rows = 0;
- parent_size = 0;
- nattrs = rel->max_attr - rel->min_attr + 1;
- parent_attrsizes = (double *) palloc0(nattrs * sizeof(double));
-
- /*
- * Generate access paths for each member relation, and pick the cheapest
- * path for each one.
- */
- foreach(l, root->append_rel_list)
- {
- AppendRelInfo *appinfo = (AppendRelInfo *) lfirst(l);
- int childRTindex;
- RangeTblEntry *childRTE;
- RelOptInfo *childrel;
- List *childquals;
- Node *childqual;
- ListCell *lcp;
- ListCell *parentvars;
- ListCell *childvars;
-
- /* append_rel_list contains all append rels; ignore others */
- if (appinfo->parent_relid != parentRTindex)
- continue;
-
- childRTindex = appinfo->child_relid;
- childRTE = root->simple_rte_array[childRTindex];
-
- /*
- * The child rel's RelOptInfo was already created during
- * add_base_rels_to_query.
- */
- childrel = find_base_rel(root, childRTindex);
- Assert(childrel->reloptkind == RELOPT_OTHER_MEMBER_REL);
-
- /*
- * We have to copy the parent's targetlist and quals to the child,
- * with appropriate substitution of variables. However, only the
- * baserestrictinfo quals are needed before we can check for
- * constraint exclusion; so do that first and then check to see if we
- * can disregard this child.
- *
- * As of 8.4, the child rel's targetlist might contain non-Var
- * expressions, which means that substitution into the quals could
- * produce opportunities for const-simplification, and perhaps even
- * pseudoconstant quals. To deal with this, we strip the RestrictInfo
- * nodes, do the substitution, do const-simplification, and then
- * reconstitute the RestrictInfo layer.
- */
- childquals = get_all_actual_clauses(rel->baserestrictinfo);
- childquals = (List *) adjust_appendrel_attrs((Node *) childquals,
- appinfo);
- childqual = eval_const_expressions(root, (Node *)
- make_ands_explicit(childquals));
- if (childqual && IsA(childqual, Const) &&
- (((Const *) childqual)->constisnull ||
- !DatumGetBool(((Const *) childqual)->constvalue)))
- {
- /*
- * Restriction reduces to constant FALSE or constant NULL after
- * substitution, so this child need not be scanned.
- */
- set_dummy_rel_pathlist(childrel);
- continue;
- }
- childquals = make_ands_implicit((Expr *) childqual);
- childquals = make_restrictinfos_from_actual_clauses(root,
- childquals);
- childrel->baserestrictinfo = childquals;
-
- if (relation_excluded_by_constraints(root, childrel, childRTE))
- {
- /*
- * This child need not be scanned, so we can omit it from the
- * appendrel. Mark it with a dummy cheapest-path though, in case
- * best_appendrel_indexscan() looks at it later.
- */
- set_dummy_rel_pathlist(childrel);
- continue;
- }
-
- /*
- * CE failed, so finish copying/modifying targetlist and join quals.
- *
- * Note: the resulting childrel->reltargetlist may contain arbitrary
- * expressions, which normally would not occur in a reltargetlist.
- * That is okay because nothing outside of this routine will look at
- * the child rel's reltargetlist. We do have to cope with the case
- * while constructing attr_widths estimates below, though.
- */
- childrel->joininfo = (List *)
- adjust_appendrel_attrs((Node *) rel->joininfo,
- appinfo);
- childrel->reltargetlist = (List *)
- adjust_appendrel_attrs((Node *) rel->reltargetlist,
- appinfo);
-
- /*
- * We have to make child entries in the EquivalenceClass data
- * structures as well. This is needed either if the parent
- * participates in some eclass joins (because we will want to consider
- * inner-indexscan joins on the individual children) or if the parent
- * has useful pathkeys (because we should try to build MergeAppend
- * paths that produce those sort orderings).
- */
- if (rel->has_eclass_joins || has_useful_pathkeys(root, rel))
- add_child_rel_equivalences(root, appinfo, rel, childrel);
- childrel->has_eclass_joins = rel->has_eclass_joins;
-
- /*
- * Note: we could compute appropriate attr_needed data for the child's
- * variables, by transforming the parent's attr_needed through the
- * translated_vars mapping. However, currently there's no need
- * because attr_needed is only examined for base relations not
- * otherrels. So we just leave the child's attr_needed empty.
- */
-
- /* Remember which childrels are live, for MergeAppend logic below */
- live_childrels = lappend(live_childrels, childrel);
-
- /*
- * Compute the child's access paths, and add the cheapest one to the
- * Append path we are constructing for the parent.
- */
- set_rel_pathlist(root, childrel, childRTindex, childRTE);
-
- subpaths = accumulate_append_subpath(subpaths,
- childrel->cheapest_total_path);
-
- /*
- * Collect a list of all the available path orderings for all the
- * children. We use this as a heuristic to indicate which sort
- * orderings we should build MergeAppend paths for.
- */
- foreach(lcp, childrel->pathlist)
- {
- Path *childpath = (Path *) lfirst(lcp);
- List *childkeys = childpath->pathkeys;
- ListCell *lpk;
- bool found = false;
-
- /* Ignore unsorted paths */
- if (childkeys == NIL)
- continue;
-
- /* 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);
- }
- }
-
- /*
- * Accumulate size information from each child.
- */
- if (childrel->rows > 0)
- {
- parent_rows += childrel->rows;
- parent_size += childrel->width * childrel->rows;
-
- /*
- * Accumulate per-column estimates too. We need not do anything
- * for PlaceHolderVars in the parent list. If child expression
- * isn't a Var, or we didn't record a width estimate for it, we
- * have to fall back on a datatype-based estimate.
- *
- * By construction, child's reltargetlist is 1-to-1 with parent's.
- */
- forboth(parentvars, rel->reltargetlist,
- childvars, childrel->reltargetlist)
- {
- Var *parentvar = (Var *) lfirst(parentvars);
- Node *childvar = (Node *) lfirst(childvars);
-
- if (IsA(parentvar, Var))
- {
- int pndx = parentvar->varattno - rel->min_attr;
- int32 child_width = 0;
-
- if (IsA(childvar, Var))
- {
- int cndx = ((Var *) childvar)->varattno - childrel->min_attr;
-
- child_width = childrel->attr_widths[cndx];
- }
- if (child_width <= 0)
- child_width = get_typavgwidth(exprType(childvar),
- exprTypmod(childvar));
- Assert(child_width > 0);
- parent_attrsizes[pndx] += child_width * childrel->rows;
- }
- }
- }
- }
-
- /*
- * Save the finished size estimates.
- */
- rel->rows = parent_rows;
- if (parent_rows > 0)
- {
- int i;
-
- rel->width = rint(parent_size / parent_rows);
- for (i = 0; i < nattrs; i++)
- rel->attr_widths[i] = rint(parent_attrsizes[i] / parent_rows);
- }
- else
- rel->width = 0; /* attr_widths should be zero already */
-
- /*
- * Set "raw tuples" count equal to "rows" for the appendrel; needed
- * because some places assume rel->tuples is valid for any baserel.
- */
- rel->tuples = parent_rows;
-
- pfree(parent_attrsizes);
-
- /*
- * Next, build an unordered 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));
-
- /*
- * Next, build MergeAppend paths based on the collected list of 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 list.
- */
- foreach(l, all_child_pathkeys)
- {
- List *pathkeys = (List *) lfirst(l);
- 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,
- STARTUP_COST);
- cheapest_total =
- get_cheapest_path_for_pathkeys(childrel->pathlist,
- pathkeys,
- TOTAL_COST);
-
- /*
- * If we can't find any paths with the right order just add the
- * cheapest-total path; we'll have to sort it.
- */
- if (cheapest_startup == NULL)
- cheapest_startup = childrel->cheapest_total_path;
- if (cheapest_total == NULL)
- cheapest_total = childrel->cheapest_total_path;
-
- /*
- * 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));
- if (startup_neq_total)
- add_path(rel, (Path *) create_merge_append_path(root,
- rel,
- total_subpaths,
- pathkeys));
- }
-
- /* Select cheapest path */
- set_cheapest(rel);
-}
-
-/*
- * 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);
-}
-
-/*
- * set_dummy_rel_pathlist
- * Build a dummy path for a relation that's been excluded by constraints
- *
- * Rather than inventing a special "dummy" path type, we represent this as an
- * AppendPath with no members (see also IS_DUMMY_PATH macro).
- */
-static void
-set_dummy_rel_pathlist(RelOptInfo *rel)
-{
- /* Set dummy size estimates --- we leave attr_widths[] as zeroes */
- rel->rows = 0;
- rel->width = 0;
-
- add_path(rel, (Path *) create_append_path(rel, NIL));
-
- /* Select cheapest path (pretty easy in this case...) */
- set_cheapest(rel);
-}
-
-/*
- * 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.
- *
- * In the first pass (level == 2), we try to join each initial rel to each
- * initial rel that appears later in joinrels[1]. (The mirror-image joins
- * are handled automatically by make_join_rel.) In later passes, we try
- * to join rels of size level-1 from joinrels[level-1] to each initial rel
- * in joinrels[1].
- */
- foreach(r, joinrels[level - 1])
- {
- RelOptInfo *old_rel = (RelOptInfo *) lfirst(r);
- ListCell *other_rels;
-
- if (level == 2)
- other_rels = lnext(r); /* only consider remaining initial
- * rels */
- else
- other_rels = list_head(joinrels[1]); /* consider all initial
- * rels */
-
- if (old_rel->joininfo != NIL || old_rel->has_eclass_joins ||
- has_join_restriction(root, old_rel))
- {
- /*
- * Note that if all available join clauses for this rel require
- * more than one other rel, we will fail to make any joins against
- * it here. In most cases that's OK; it'll be considered by
- * "bushy plan" join code in a higher-level pass where we have
- * those other rels collected into a join rel.
- *
- * See also the last-ditch case below.
- */
- 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.
- */
- make_rels_by_clauseless_joins(root,
- old_rel,
- other_rels);
- }
- }
-
- /*
- * 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 clauseless joins here, *except* when 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 usable
- * join clause or a relevant join 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. An example is
- *
- * SELECT * FROM a,b,c WHERE (a.f1 + b.f2 + c.f3) = 0;
- *
- * The join clause will be usable at level 3, but at level 2 we have no
- * choice but to make cartesian joins. 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);
- ListCell *other_rels;
-
- if (level == 2)
- other_rels = lnext(r); /* only consider remaining initial
- * rels */
- else
- other_rels = list_head(joinrels[1]); /* consider all initial
- * rels */
-
- make_rels_by_clauseless_joins(root,
- old_rel,
- other_rels);
- }
-
- /*----------
- * 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?
- *
- * If so, it will have a single path that is dummy.
- */
-static bool
-is_dummy_rel(RelOptInfo *rel)
-{
- return (rel->cheapest_total_path != NULL &&
- IS_DUMMY_PATH(rel->cheapest_total_path));
-}
-
-/*
- * 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));
-
- /* Set or update cheapest_total_path */
- 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;
-}
-base_plan.out
fdw.out
-init.out
-pg_hint_plan.out
-ut-A.out
-ut-A2.out
-ut-G.out
-ut-J.out
-ut-L.out
-ut-S.out
-indexonly.out
-create_execute.out
+++ /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
---------------------------------------------------
- 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)
-
+++ /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_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
-(29 rows)
-
+++ /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
---------------------------------------------
- Hash Join
- Hash Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1
- -> Hash
- -> Index Scan using t2_pkey on t2
-(5 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
---------------------------------------------------
- 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 "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.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( 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
---------------------------------------------------
- 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( 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
---------------------------------------------------
- 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(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
---------------------------------------------------
- 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)
-
-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 Scan using t1_pkey on t1
- Index Cond: (id = $3)
- InitPlan 2 (returns $1)
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Index 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 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 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 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 Scan using t1_pkey on t1
- Index Cond: (id = $2)
- InitPlan 2 (returns $1)
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Index 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 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 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 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 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 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 < 10) AND (id = t2.id))
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t1_pkey
- Index Cond: ((id < 10) AND (id = t2.id))
-(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
-------------------------------
- Hash Full Join
- Hash Cond: (t1.id = t2.id)
- -> Seq Scan on t1
- -> Hash
- -> Seq Scan on t2
-(5 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 < 10) AND (id = p1.id))
-(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 < 10) AND (id = p1.id))
-(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 < 10) AND (id = p1.id))
-(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 < 10) AND (id = p1.id))
-(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 < 10) AND (id = p1.id))
-(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 < 10) AND (id = p1.id))
-(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 < 10) AND (id = p1.id))
-(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 < 10) AND (id = p1.id))
-(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 < 10) AND (id = p1.id))
-(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 < 10) AND (id = p1.id))
-(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 < 10) AND (id = p1.id))
-(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 < 10) AND (id = p1.id))
-(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 Scan using t1_pkey on t1 t1_5
- -> Index 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 Scan using t1_pkey on t1 t1_2
- -> Index 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 Scan using t1_pkey on t1 t1_4
- -> Index 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 Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $2)
- -> Seq Scan on t3 t3_1
- Filter: (id = $2)
- -> Index Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $2)
- -> Index Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $2)
- -> Index 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 Scan using t2_pkey on t2 t2_5
- -> Index 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 $2)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_2.id = t3_2.id)
- -> Nested Loop
- -> Index Scan using t2_pkey on t2 t2_2
- -> Index 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 $3)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_4.id = t3_4.id)
- -> Nested Loop
- -> Index Scan using t2_pkey on t2 t2_4
- -> Index 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 Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $3)
- -> Seq Scan on t3 t3_1
- Filter: (id = $3)
- -> Index Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $3)
- -> Index Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $3)
- -> Index Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $3)
- -> Seq Scan on t3 t3_3
- Filter: (id = $3)
- -> CTE Scan on c1_1
- Filter: (id = $3)
-(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 Scan using t2_pkey on t2 t2_5
- -> Index 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 $2)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_2.id = t3_2.id)
- -> Nested Loop
- -> Index Scan using t2_pkey on t2 t2_2
- -> Index 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 $3)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_4.id = t3_4.id)
- -> Nested Loop
- -> Index Scan using t2_pkey on t2 t2_4
- -> Index 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 Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $3)
- -> Seq Scan on t3 t3_1
- Filter: (id = $3)
- -> Index Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $3)
- -> Index Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $3)
- -> Index Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $3)
- -> Seq Scan on t3 t3_3
- Filter: (id = $3)
- -> CTE Scan on c1_1
- Filter: (id = $3)
-(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 Scan using t2_pkey on t2 t2_5
- -> Index 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 $2)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_2.id = t3_2.id)
- -> Nested Loop
- -> Index Scan using t2_pkey on t2 t2_2
- -> Index 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 $3)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_4.id = t3_4.id)
- -> Nested Loop
- -> Index Scan using t2_pkey on t2 t2_4
- -> Index 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 Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $3)
- -> Seq Scan on t3 t3_1
- Filter: (id = $3)
- -> Index Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $3)
- -> Index Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $3)
- -> Index Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $3)
- -> Seq Scan on t3 t3_3
- Filter: (id = $3)
- -> CTE Scan on c1_1
- Filter: (id = $3)
-(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 Scan using t2_pkey on t2 t2_5
- -> Sort
- Sort Key: t3_5.id
- -> Seq Scan on t3 t3_5
- -> Index 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 Scan using t2_pkey on t2 t2_2
- -> Sort
- Sort Key: t3_2.id
- -> Seq Scan on t3 t3_2
- -> Index 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 Scan using t2_pkey on t2 t2_4
- -> Sort
- Sort Key: t3_4.id
- -> Seq Scan on t3 t3_4
- -> Index 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 Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $2)
- -> Index Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $2)
- -> Seq Scan on t3 t3_1
- Filter: (id = $2)
- -> Index Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $2)
- -> Index 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 Scan using t1_pkey on t1 t1_5
- -> Index 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 Scan using t1_pkey on t1 t1_2
- -> Index 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 Scan using t1_pkey on t1 t1_4
- -> Index 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 Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $2)
- -> Seq Scan on t3 t3_1
- Filter: (id = $2)
- -> Index Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $2)
- -> Nested Loop
- -> Nested Loop
- -> Index Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $2)
- -> Seq Scan on t3 t3_3
- Filter: (id = $2)
- -> Index Scan using t2_pkey on t2 t2_3
- Index Cond: (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 Scan using t2_pkey on t2 t2_5
- -> Index 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 $2)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_2.id = t3_2.id)
- -> Nested Loop
- -> Index Scan using t2_pkey on t2 t2_2
- -> Index 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 $3)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_4.id = t3_4.id)
- -> Nested Loop
- -> Index Scan using t2_pkey on t2 t2_4
- -> Index 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 Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $3)
- -> Seq Scan on t3 t3_1
- Filter: (id = $3)
- -> Index Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $3)
- -> Nested Loop
- -> Nested Loop
- -> Index Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $3)
- -> Seq Scan on t3 t3_3
- Filter: (id = $3)
- -> Index Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $3)
- -> CTE Scan on c1_1
- Filter: (id = $3)
-(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 Scan using t2_pkey on t2 t2_5
- -> Index 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 $2)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_2.id = t3_2.id)
- -> Nested Loop
- -> Index Scan using t2_pkey on t2 t2_2
- -> Index 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 $3)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_4.id = t3_4.id)
- -> Nested Loop
- -> Index Scan using t2_pkey on t2 t2_4
- -> Index 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 Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $3)
- -> Seq Scan on t3 t3_1
- Filter: (id = $3)
- -> Index Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $3)
- -> Nested Loop
- -> Nested Loop
- -> Index Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $3)
- -> Seq Scan on t3 t3_3
- Filter: (id = $3)
- -> Index Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $3)
- -> CTE Scan on c1_1
- Filter: (id = $3)
-(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 Scan using t2_pkey on t2 t2_5
- -> Index 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 $2)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_2.id = t3_2.id)
- -> Nested Loop
- -> Index Scan using t2_pkey on t2 t2_2
- -> Index 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 $3)
- -> Aggregate
- -> Merge Join
- Merge Cond: (t1_4.id = t3_4.id)
- -> Nested Loop
- -> Index Scan using t2_pkey on t2 t2_4
- -> Index 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 Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $3)
- -> Seq Scan on t3 t3_1
- Filter: (id = $3)
- -> Index Scan using t1_pkey on t1 t1_1
- Index Cond: (id = $3)
- -> Nested Loop
- -> Nested Loop
- -> Index Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $3)
- -> Seq Scan on t3 t3_3
- Filter: (id = $3)
- -> Index Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $3)
- -> CTE Scan on c1_1
- Filter: (id = $3)
-(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 Scan using t2_pkey on t2 t2_5
- -> Sort
- Sort Key: t3_5.id
- -> Seq Scan on t3 t3_5
- -> Index 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 Scan using t2_pkey on t2 t2_2
- -> Sort
- Sort Key: t3_2.id
- -> Seq Scan on t3 t3_2
- -> Index 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 Scan using t2_pkey on t2 t2_4
- -> Sort
- Sort Key: t3_4.id
- -> Seq Scan on t3 t3_4
- -> Index Scan using t1_pkey on t1 t1_4
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- -> Index Scan using t2_pkey on t2 t2_3
- Index Cond: (id = $2)
- -> Seq Scan on t3 t3_3
- Filter: (id = $2)
- -> Index Scan using t1_pkey on t1 t1_3
- Index Cond: (id = $2)
- -> CTE Scan on c1_1
- Filter: (id = $2)
- -> Seq Scan on t3 t3_1
- Filter: (id = $2)
- -> Index Scan using t2_pkey on t2 t2_1
- Index Cond: (id = $2)
- -> Index 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 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 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 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 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
- -> Merge Join
- Merge Cond: (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 Scan using t1_pkey on t1
- Index Cond: (id = t2.id)
-(15 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) AND (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) AND (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 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;
-INFO: hint syntax error at or near "IndexOnlyScanRegexp(t5 t5_[^i].*)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScanRegexp".
- QUERY PLAN
-----------------------------------------------------------------------------------------
- Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
- Index Cond: (id = 1)
-(2 rows)
-
-/*+ IndexOnlyScanRegexp(t5 t5_id[0-9].*)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-INFO: hint syntax error at or near "IndexOnlyScanRegexp(t5 t5_id[0-9].*)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScanRegexp".
- QUERY PLAN
-----------------------------------------------------------------------------------------
- Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
- Index Cond: (id = 1)
-(2 rows)
-
-/*+ IndexOnlyScanRegexp(t5 t5[^_].*)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-INFO: hint syntax error at or near "IndexOnlyScanRegexp(t5 t5[^_].*)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScanRegexp".
- QUERY PLAN
-----------------------------------------------------------------------------------------
- Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
- Index Cond: (id = 1)
-(2 rows)
-
-/*+ IndexOnlyScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-INFO: hint syntax error at or near "IndexOnlyScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScanRegexp".
- QUERY PLAN
-----------------------------------------------------------------------------------------
- Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
- Index Cond: (id = 1)
-(2 rows)
-
-/*+ IndexOnlyScan(t5 t5_id[0-9].*)*/
-EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
-INFO: hint syntax error at or near "IndexOnlyScan(t5 t5_id[0-9].*)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
-----------------------------------------------------------------------------------------
- Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
- Index Cond: (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;
-INFO: hint syntax error at or near "IndexOnlyScanRegexp(p1 p1_.*[^0-9]$)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScanRegexp".
- 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;
-INFO: hint syntax error at or near "IndexOnlyScanRegexp(p1 p1_.*val2.*)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScanRegexp".
- 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[^_].*)*/
-EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
-INFO: hint syntax error at or near "IndexOnlyScanRegexp(p1 p1[^_].*)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScanRegexp".
- 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;
-INFO: hint syntax error at or near "IndexOnlyScan(p1 p1_.*val2.*)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- 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 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;
+++ /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 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 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:
-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)
-
-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 < $1)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 < $1)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 < $1)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 < $1)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 < $1)
-(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;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1;
- 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;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- 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;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
-EXPLAIN (COSTS false) EXECUTE p1;
- 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;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- 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 < $1)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 < $1)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 < $1)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 < $1)
-(2 rows)
-
-EXPLAIN (COSTS false) EXECUTE p1 (1000);
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 < $1)
-(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;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
- 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;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-/*+SeqScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- 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;
-LOG: pg_hint_plan:
-used hint:
-SeqScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
- 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;
-LOG: pg_hint_plan:
-used hint:
-BitmapScan(t1)
-not used hint:
-duplication hint:
-error hint:
-
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 < $1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 < $1)
-(4 rows)
-
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- 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 < $1)
-(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)
-
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 < $1)
-(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)
-
-/*+BitmapScan(t1)*/
-EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 < $1)
-(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
--------------------------------------------------------------------+-------
- /*+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
-(4 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;
-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)
-
-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-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_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(29 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_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(29 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_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(29 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_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(29 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_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(29 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_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(29 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_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(29 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_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(29 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_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(29 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_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(29 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_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(29 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_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(29 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_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(29 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_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | notice
-(29 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 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 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 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)
-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" 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" line 12 at SQL statement
- QUERY PLAN
-----------------------------------
- Index 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" line 12 at SQL statement
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(t_2)
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Index 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" line 12 at SQL statement
- QUERY PLAN
-----------------------------------
- Index 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)
-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" 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" 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" 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" 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" 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" 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" 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" 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" 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" line 12 at SQL statement
-LOG: pg_hint_plan:
-used hint:
-not used hint:
-SeqScan(t_2)
-duplication hint:
-error hint:
-
- QUERY PLAN
-----------------------------------
- Index 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 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 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 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 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 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 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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1
- 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: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- -> Tid Scan on r1_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (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: (b1t2.c1 = b1t1.c1)
- -> Hash Join
- Hash Cond: (b1t3.c1 = b1t2.c1)
- -> Seq Scan on t3 b1t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1 b1t1
- 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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1
- 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: (t2.c1 = t1.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1
- 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: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (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: (b2t2.c1 = b2t1.c1)
- -> Nested Loop
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b2t1
- TID Cond: (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: (b1t2.c1 = b1t1.c1)
- -> Hash Join
- Hash Cond: (b1t3.c1 = b1t2.c1)
- -> Seq Scan on t3 b1t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1 b1t1
- 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: (b2t2.c1 = b2t1.c1)
- -> Hash Join
- Hash Cond: (b2t3.c1 = b2t2.c1)
- -> Seq Scan on t3 b2t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1 b2t1
- 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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1
- 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: (t2.c1 = t1.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1
- 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: (t2.c1 = t1.c1)
- -> Hash Join
- Hash Cond: (t3.c1 = t2.c1)
- -> Seq Scan on t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1
- 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: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (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: (b2t2.c1 = b2t1.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b2t1
- TID Cond: (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: (b3t2.c1 = b3t1.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b3t1
- TID Cond: (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: (b1t2.c1 = b1t1.c1)
- -> Hash Join
- Hash Cond: (b1t3.c1 = b1t2.c1)
- -> Seq Scan on t3 b1t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1 b1t1
- 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: (b2t2.c1 = b2t1.c1)
- -> Hash Join
- Hash Cond: (b2t3.c1 = b2t2.c1)
- -> Seq Scan on t3 b2t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1 b2t1
- 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: (b3t2.c1 = b3t1.c1)
- -> Hash Join
- Hash Cond: (b3t3.c1 = b3t2.c1)
- -> Seq Scan on t3 b3t3
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Hash
- -> Seq Scan on t1 b3t1
- 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 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 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
- Join Filter: (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
- -> Append
- -> Index Scan using p1_i on p1 t2
- Index Cond: ((c1 = t1.c1) AND (c1 = t1.c1))
- -> Index Scan using p1c1_i on p1c1 t2
- Index Cond: ((c1 = t1.c1) AND (c1 = t1.c1))
- -> Index Scan using p1c2_i on p1c2 t2
- Index Cond: ((c1 = t1.c1) AND (c1 = t1.c1))
- -> Index Scan using p1c3_i on p1c3 t2
- Index Cond: ((c1 = t1.c1) AND (c1 = t1.c1))
-(16 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 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 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 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.28..10000000084.81 rows=1 width=29)
- InitPlan 1 (returns $1)
- -> Aggregate (cost=74.27..74.28 rows=1 width=4)
- -> Nested Loop (cost=0.00..74.02 rows=100 width=4)
- -> Seq Scan on t2 st2 (cost=0.00..2.00 rows=100 width=4)
- -> Index 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 = bmt2.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 <> $0) AND (c1 <> $1))
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (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 = bmt2.c1)
- -> Nested Loop
- Join Filter: (bmt3.c1 = bmt1.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)
- -> 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
-(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 = bmt2.c1)
- -> Nested Loop
- Join Filter: (bmt3.c1 = bmt1.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)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $3)
- -> Seq Scan on t2 bmt2
- Filter: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- -> Tid Scan on r1_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (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: (b2t2.c1 = b2t1.c1)
- -> Nested Loop
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b2t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (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: (b2t2.c1 = b2t1.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b2t1
- TID Cond: (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: (b3t2.c1 = b3t1.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b3t1
- TID Cond: (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
--------------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
-(10 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
--------------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
-(10 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
- Join Filter: (t1.c1 = t2.c1)
- -> Hash Join
- Hash Cond: (t1.c1 = "*VALUES*".column1)
- -> Seq Scan on t1
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Seq Scan on t2
-(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)
- -> Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Values Scan on "*VALUES*"
-(13 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)
- -> Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Values Scan on "*VALUES*"
-(13 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)
- -> Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Values Scan on "*VALUES*"
-(13 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)
- -> Merge Join
- Merge Cond: (t1.c1 = t3.c1)
- -> 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
- -> 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 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
- -> 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 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
- -> Nested Loop
- -> 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 = "*VALUES*".column1)
- -> Index Scan using t4_i1 on t4
- Index Cond: (c1 = "*VALUES*".column1)
-(11 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
- -> Nested Loop
- -> 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 = "*VALUES*".column1)
- -> Index Scan using t4_i1 on t4
- Index Cond: (c1 = "*VALUES*".column1)
-(11 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 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 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 = bmt2.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt3.c1)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((c1 <> $0) AND (c1 <> $1))
- -> Tid Scan on t3 bmt3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t2 bmt2
- Filter: (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 = bmt2.c1)
- -> Nested Loop
- Join Filter: (bmt3.c1 = bmt1.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)
- -> 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
-(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 = bmt2.c1)
- -> Nested Loop
- Join Filter: (bmt3.c1 = bmt1.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)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $3)
- -> Seq Scan on t2 bmt2
- Filter: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- -> Tid Scan on r1_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (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: (b2t2.c1 = b2t1.c1)
- -> Nested Loop
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b2t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (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: (b2t2.c1 = b2t1.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b2t1
- TID Cond: (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: (b3t2.c1 = b3t1.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b3t1
- TID Cond: (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
--------------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
-(10 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
--------------------------------------------------------
- Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
-(10 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
------------------------------------------------------------
- Hash Join
- Hash Cond: (t2.c1 = t1.c1)
- -> Seq Scan on t2
- -> Hash
- -> Nested Loop
- -> Values Scan on "*VALUES*"
- -> Index Scan using t1_i1 on t1
- Index Cond: (c1 = "*VALUES*".column1)
-(8 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)
- -> Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Values Scan on "*VALUES*"
-(13 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)
- -> Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Values Scan on "*VALUES*"
-(13 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)
- -> Merge Join
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1
- -> Sort
- Sort Key: t2.c1
- -> Hash Join
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2
- -> Hash
- -> Values Scan on "*VALUES*"
- -> Values Scan on "*VALUES*"
-(13 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
- -> Nested Loop
- -> 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 = t2.c1)
- -> Index Scan using t4_i1 on t4
- Index Cond: (c1 = t1.c1)
-(10 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)
-
+++ /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 Scan using t1_i1 on t1
- Index Cond: (c1 = 1)
- InitPlan 2 (returns $1)
- -> Result
- InitPlan 1 (returns $0)
- -> Limit
- -> Index 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 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 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 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 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 Scan using t1_i1 on t1 b1t1
- -> Index Scan using t3_i1 on t3 b1t3
- -> Index 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 Scan using t1_i1 on t1 bmt1
- -> Index Scan using t3_i1 on t3 bmt3
- -> Index 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 $1)
- -> Aggregate
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t3.c1)
- -> Sort
- Sort Key: b1t1.c1
- -> Seq Scan on t1 b1t1
- -> Index Scan using t3_pkey on t3 b1t3
- -> Bitmap Heap Scan on t4 b1t4
- Recheck Cond: (c1 = b1t1.c1)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = b1t1.c1)
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- -> Hash Join
- Hash Cond: (bmt4.c1 = bmt1.c1)
- -> Seq Scan on t4 bmt4
- -> Hash
- -> 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)
-(33 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 Scan using t1_i1 on t1 b1t1
- -> Index Scan using t3_i1 on t3 b1t3
- -> Index 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 Scan using t1_i1 on t1 b2t1
- -> Index Scan using t3_i1 on t3 b2t3
- -> Index 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 Scan using t1_i1 on t1 bmt1
- -> Index Scan using t3_i1 on t3 bmt3
- -> Index 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 $1)
- -> Aggregate
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t3.c1)
- -> Sort
- Sort Key: b1t1.c1
- -> Seq Scan on t1 b1t1
- -> Index Scan using t3_pkey on t3 b1t3
- -> Bitmap Heap Scan on t4 b1t4
- Recheck Cond: (c1 = b1t1.c1)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = b1t1.c1)
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- InitPlan 2 (returns $3)
- -> Aggregate
- -> Hash Join
- Hash Cond: (b2t3.c1 = b2t1.c1)
- -> Seq Scan on t3 b2t3
- -> Hash
- -> 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 Join
- Hash Cond: (bmt4.c1 = bmt1.c1)
- -> Seq Scan on t4 bmt4
- -> Hash
- -> 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)
-(50 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 Scan using t1_i1 on t1 bmt1
- -> Index Scan using t3_i1 on t3 bmt3
- -> Index 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: (bmt4.c1 = bmt1.c1)
- -> Seq Scan on t4 bmt4
- -> Hash
- -> 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)
-(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 Scan using t1_i1 on t1 bmt1
- -> Index Scan using t3_i1 on t3 bmt3
- -> Index 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: (bmt4.c1 = bmt1.c1)
- -> Seq Scan on t4 bmt4
- -> Hash
- -> 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)
-(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 Scan using t1_i1 on t1 b1t1
- -> Index Scan using t3_i1 on t3 b1t3
- -> Index 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 Scan using t1_i1 on t1 bmt1
- Filter: (c1 <> $0)
- -> Index Scan using t3_i1 on t3 bmt3
- -> Index 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 $1)
- -> Aggregate
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t3.c1)
- -> Sort
- Sort Key: b1t1.c1
- -> Seq Scan on t1 b1t1
- -> Index Scan using t3_pkey on t3 b1t3
- -> Bitmap Heap Scan on t4 b1t4
- Recheck Cond: (c1 = b1t1.c1)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = b1t1.c1)
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- -> Hash Join
- Hash Cond: (bmt4.c1 = bmt1.c1)
- -> Seq Scan on t4 bmt4
- -> Hash
- -> Nested Loop
- -> Hash Join
- Hash Cond: (bmt1.c1 = bmt2.c1)
- -> Seq Scan on t1 bmt1
- Filter: (c1 <> $1)
- -> 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)
-(34 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 Scan using t1_i1 on t1 b1t1
- -> Index Scan using t3_i1 on t3 b1t3
- -> Index 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 Scan using t1_i1 on t1 b2t1
- -> Index Scan using t3_i1 on t3 b2t3
- -> Index 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 Scan using t1_i1 on t1 bmt1
- Filter: ((c1 <> $0) AND (c1 <> $1))
- -> Index Scan using t3_i1 on t3 bmt3
- -> Index 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 $1)
- -> Aggregate
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t3.c1)
- -> Sort
- Sort Key: b1t1.c1
- -> Seq Scan on t1 b1t1
- -> Index Scan using t3_pkey on t3 b1t3
- -> Bitmap Heap Scan on t4 b1t4
- Recheck Cond: (c1 = b1t1.c1)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = b1t1.c1)
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- InitPlan 2 (returns $3)
- -> Aggregate
- -> Hash Join
- Hash Cond: (b2t3.c1 = b2t1.c1)
- -> Seq Scan on t3 b2t3
- -> Hash
- -> 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 Join
- Hash Cond: (bmt4.c1 = bmt1.c1)
- -> Seq Scan on t4 bmt4
- -> Hash
- -> Nested Loop
- -> Hash Join
- Hash Cond: (bmt1.c1 = bmt2.c1)
- -> Seq Scan on t1 bmt1
- Filter: ((c1 <> $1) AND (c1 <> $3))
- -> 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)
-(51 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 Scan using t1_i1 on t1 b1t1
- -> Index Scan using t3_i1 on t3 b1t3
- -> Index 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 Scan using t1_i1 on t1 bmt1
- -> Index Scan using t3_i1 on t3 bmt3
- -> Index Scan using t4_i1 on t4 bmt4
- -> Sort
- Sort Key: bmt2.c1
- -> Hash Join
- Hash Cond: (bmt2.c1 = c1.c1)
- -> Seq Scan on t2 bmt2
- -> Hash
- -> CTE Scan on 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
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t3.c1)
- -> Sort
- Sort Key: b1t1.c1
- -> Seq Scan on t1 b1t1
- -> Index Scan using t3_pkey on t3 b1t3
- -> Bitmap Heap Scan on t4 b1t4
- Recheck Cond: (c1 = b1t1.c1)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = b1t1.c1)
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- -> Hash Join
- Hash Cond: (bmt4.c1 = bmt1.c1)
- -> Seq Scan on t4 bmt4
- -> Hash
- -> 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)
-(36 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 Scan using t1_i1 on t1 b1t1
- -> Index Scan using t3_i1 on t3 b1t3
- -> Index 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 Scan using t1_i1 on t1 b2t1
- -> Index Scan using t3_i1 on t3 b2t3
- -> Index 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)
- -> 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 Scan using t1_i1 on t1 bmt1
- -> Index Scan using t3_i1 on t3 bmt3
- -> Index Scan using t4_i1 on t4 bmt4
- -> Sort
- Sort Key: bmt2.c1
- -> Hash Join
- Hash Cond: (bmt2.c1 = c1.c1)
- -> Seq Scan on t2 bmt2
- -> Hash
- -> CTE Scan on 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
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Nested Loop
- -> Merge Join
- Merge Cond: (b1t1.c1 = b1t3.c1)
- -> Sort
- Sort Key: b1t1.c1
- -> Seq Scan on t1 b1t1
- -> Index Scan using t3_pkey on t3 b1t3
- -> Bitmap Heap Scan on t4 b1t4
- Recheck Cond: (c1 = b1t1.c1)
- -> Bitmap Index Scan on t4_pkey
- Index Cond: (c1 = b1t1.c1)
- -> Sort
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2
- CTE c2
- -> Aggregate
- -> Hash Join
- Hash Cond: (b2t3.c1 = b2t1.c1)
- -> Seq Scan on t3 b2t3
- -> Hash
- -> 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 Join
- Hash Cond: (bmt4.c1 = bmt1.c1)
- -> Seq Scan on t4 bmt4
- -> Hash
- -> Nested Loop
- -> Nested Loop
- Join Filter: (bmt1.c1 = c2.c1)
- -> 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)
- -> CTE Scan on c2
- -> Bitmap Heap Scan on t3 bmt3
- Recheck Cond: (c1 = bmt1.c1)
- -> Bitmap Index Scan on t3_pkey
- Index Cond: (c1 = bmt1.c1)
-(56 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 = bmt2.c1)
- -> Nested Loop
- Join Filter: (bmt3.c1 = bmt1.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)
- -> 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
-(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 $3)
- -> 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 $5)
- -> Aggregate
- -> Nested Loop
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b3t3.c1 = b3t4.c1)
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t4 b3t4
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t2 b3t2
- Recheck Cond: (c1 = b3t3.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (c1 = b3t3.c1)
- -> Index Scan using t1_pkey on t1 b3t1
- Index Cond: (c1 = b3t2.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop
- -> Nested Loop
- Join Filter: (bmt1.c1 = c1.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- -> Seq Scan on t1 bmt1
- Filter: ((c1 <> $5) AND (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
- -> Index Scan using t2_pkey on t2 bmt2
- Index Cond: (c1 = bmt1.c1)
- Filter: (ctid = '(1,1)'::tid)
-(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 = bmt2.c1)
- -> Nested Loop
- Join Filter: (bmt3.c1 = bmt1.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)
- -> Tid Scan on t1 bmt1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 <> $3)
- -> Seq Scan on t2 bmt2
- Filter: (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
- -> Nested Loop
- Join Filter: (bmt1.c1 = c1.c1)
- -> Nested Loop
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Nested Loop
- -> Seq Scan on t1 bmt1
- Filter: ((c1 <> $5) AND (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
- -> Index Scan using t2_pkey on t2 bmt2
- Index Cond: (c1 = bmt1.c1)
- Filter: (ctid = '(1,1)'::tid)
-(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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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
- Join Filter: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Nested Loop
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3
- Index Cond: (c1 = t2.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r1
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1
- TID Cond: (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: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- -> Tid Scan on r1_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (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
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- -> Nested Loop
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3 b1t3
- Index Cond: (c1 = b1t2.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r1_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1 b1t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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
- Join Filter: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Nested Loop
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3
- Index Cond: (c1 = t2.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r2
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1
- TID Cond: (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
- Join Filter: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Nested Loop
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3
- Index Cond: (c1 = t2.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r2
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1
- TID Cond: (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: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (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: (b2t2.c1 = b2t1.c1)
- -> Nested Loop
- -> Tid Scan on r2_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b2t1
- TID Cond: (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
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- -> Nested Loop
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3 b1t3
- Index Cond: (c1 = b1t2.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r2_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1 b1t1
- TID Cond: (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
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b2t2.c1 = b2t3.c1)
- -> Tid Scan on t2 b2t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t3 b2t3
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r2_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> 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)
- -> 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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Tid Scan on r3
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1
- TID Cond: (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
- Join Filter: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Nested Loop
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3
- Index Cond: (c1 = t2.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1
- TID Cond: (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
- Join Filter: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Nested Loop
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3
- Index Cond: (c1 = t2.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1
- TID Cond: (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
- Join Filter: (t2.c1 = t1.c1)
- -> Nested Loop
- -> Nested Loop
- -> Seq Scan on t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3
- Index Cond: (c1 = t2.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1
- TID Cond: (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: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b1t1
- TID Cond: (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: (b2t2.c1 = b2t1.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b2t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b2t1
- TID Cond: (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: (b3t2.c1 = b3t1.c1)
- -> Nested Loop
- -> Tid Scan on r3_
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: (c1 = 1)
- -> Seq Scan on t2 b3t2
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t1 b3t1
- TID Cond: (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
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Nested Loop
- -> Nested Loop
- -> Seq Scan on t2 b1t2
- Filter: (ctid = '(1,1)'::tid)
- -> Index Scan using t3_pkey on t3 b1t3
- Index Cond: (c1 = b1t2.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Tid Scan on t1 b1t1
- TID Cond: (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
- -> Nested Loop
- -> Nested Loop
- Join Filter: (b2t2.c1 = b2t3.c1)
- -> Tid Scan on t2 b2t2
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on t3 b2t3
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> 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)
- -> 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
- -> Tid Scan on t3 b3t3
- TID Cond: (ctid = '(1,1)'::tid)
- -> Bitmap Heap Scan on t2 b3t2
- Recheck Cond: (c1 = b3t3.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> Bitmap Index Scan on t2_pkey
- Index Cond: (c1 = b3t3.c1)
- -> Seq Scan on r3_
- Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
- -> Index Scan using t1_pkey on t1 b3t1
- Index Cond: (c1 = b3t2.c1)
- Filter: (ctid = '(1,1)'::tid)
- -> 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 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;
-INFO: hint syntax error at or near "IndexOnlyScan(t1)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
-------------------------------
- Index 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;
-INFO: hint syntax error at or near "IndexOnlyScan(t1)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
----------------------
- Seq Scan on t1
- Filter: (c1 >= 1)
-(2 rows)
-
--- No. S-3-1-19
-EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-------------------------------
- Index 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;
-INFO: hint syntax error at or near "NoIndexOnlyScan(t1)"
-DETAIL: Unrecognized hint keyword "NoIndexOnlyScan".
- 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;
-INFO: hint syntax error at or near "NoIndexOnlyScan(t1)"
-DETAIL: Unrecognized hint keyword "NoIndexOnlyScan".
- 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;
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 ti1_i3)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
----------------------
- Seq Scan on ti1
- Filter: (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;
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 ti1_i3 ti1_i2)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
----------------------
- Seq Scan on ti1
- Filter: (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;
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
----------------------
- Seq Scan on ti1
- Filter: (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;
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 ti1_btree)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
----------------------
- Seq Scan on ti1
- Filter: (c1 >= 1)
-(2 rows)
-
--- No. S-3-4-24
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
- QUERY PLAN
-----------------------------------
- Index 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;
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 ti1_hash)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
-----------------------------------
- Index Scan using ti1_uniq 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 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;
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 ti1_gist)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
-----------------------------------
- Index Scan using ti1_uniq 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 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;
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 ti1_gin)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
-----------------------------------
- Index Scan using ti1_uniq on ti1
- Index Cond: (c1 = 1)
-(2 rows)
-
--- No. S-3-4-27
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 100;
- QUERY PLAN
-----------------------------------
- Index 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;
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 ti1_expr)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
-----------------------------------
- Index Scan using ti1_uniq on ti1
- Index Cond: (c1 < 100)
-(2 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';
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 ti1_pred)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
-------------------------------------
- Seq Scan on ti1
- Filter: (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;
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 ti1_uniq)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
----------------------
- Seq Scan on ti1
- Filter: (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;
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 ti1_multi)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
----------------------
- Seq Scan on ti1
- Filter: (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';
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 ti1_ts)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- 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)
-
--- 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;
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 ti1_pkey)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
----------------------
- Seq Scan on ti1
- Filter: (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;
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 ti1_c2_key)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
----------------------
- Seq Scan on ti1
- Filter: (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;
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 ti1_pred)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
---------------------------------------------------------------------
- Index Scan using ti1_uniq on ti1 (cost=0.00..8.27 rows=1 width=4)
- Index Cond: (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;
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 not_exist)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
---------------------------------------------------------------------
- Index Scan using ti1_uniq on ti1 (cost=0.00..8.27 rows=1 width=4)
- Index Cond: (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 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 Scan using t1_i1 on t1 b4t1
- Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- InitPlan 5 (returns $4)
- -> Limit
- -> Index 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 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 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 Scan using t1_i1 on t1 b4t1
- Index Cond: (c1 = 1)
- -> Seq Scan on t2 b4t2
- Filter: (c1 = 1)
- -> Nested Loop
- -> Nested Loop
- -> Index 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)
- -> CTE Scan on cte1
- Filter: (c1 = $2)
- -> Index Scan using t2_pkey on t2 b3t2
- Index Cond: (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 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 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 Scan using t1_i1 on t1 b4t1
- Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
- -> Nested Loop
- -> Nested Loop
- -> Index 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)
- -> CTE Scan on cte1
- Filter: (c1 = $4)
- -> Index Scan using t2_pkey on t2 b3t2
- Index Cond: (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;
-INFO: hint syntax error at or near "IndexOnlyScan(ti1)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
----------------------
- Seq Scan on ti1
- Filter: (c1 >= 1)
-(2 rows)
-
--- No. S-3-12-26
-/*+IndexOnlyScan(ti1 ti1_pkey)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 ti1_pkey)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
----------------------
- Seq Scan on ti1
- Filter: (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;
-INFO: hint syntax error at or near "IndexOnlyScan(ti1 ti1_pkey ti1_btree)"
-DETAIL: Unrecognized hint keyword "IndexOnlyScan".
- QUERY PLAN
----------------------
- Seq Scan on ti1
- Filter: (c1 >= 1)
-(2 rows)
-
--- No. S-3-12-28
-/*+NoIndexOnlyScan(ti1)*/
-EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
-INFO: hint syntax error at or near "NoIndexOnlyScan(ti1)"
-DETAIL: Unrecognized hint keyword "NoIndexOnlyScan".
- 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 "NoIndexOnlyScan(ti1 ti1_pkey)"
-DETAIL: Unrecognized hint keyword "NoIndexOnlyScan".
- QUERY PLAN
-----------------------------------
- Index 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 "NoIndexOnlyScan(ti1 ti1_pkey ti1_btree)"
-DETAIL: Unrecognized hint keyword "NoIndexOnlyScan".
- QUERY PLAN
-----------------------------------
- Index 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)
-
+++ /dev/null
-/*-------------------------------------------------------------------------
- *
- * plpgsql-9.1.h - Definitions for the PL/pgSQL
- * procedural language
- *
- * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- *
- * IDENTIFICATION
- * src/pl/plpgsql/src/plpgsql.h
- *
- *-------------------------------------------------------------------------
- */
-
-#ifndef PLPGSQL_H
-#define PLPGSQL_H
-
-#include "postgres.h"
-
-#include "access/xact.h"
-#include "fmgr.h"
-#include "commands/trigger.h"
-#include "executor/spi.h"
-#include "lib/stringinfo.h"
-#include "nodes/bitmapset.h"
-#include "utils/tuplestore.h"
-
-/**********************************************************************
- * Definitions
- **********************************************************************/
-
-/* define our text domain for translations */
-#undef TEXTDOMAIN
-#define TEXTDOMAIN PG_TEXTDOMAIN("plpgsql")
-
-#undef _
-#define _(x) dgettext(TEXTDOMAIN, x)
-
-/* ----------
- * Compiler's namespace item types
- * ----------
- */
-enum
-{
- PLPGSQL_NSTYPE_LABEL,
- PLPGSQL_NSTYPE_VAR,
- PLPGSQL_NSTYPE_ROW,
- PLPGSQL_NSTYPE_REC
-};
-
-/* ----------
- * Datum array node types
- * ----------
- */
-enum
-{
- PLPGSQL_DTYPE_VAR,
- PLPGSQL_DTYPE_ROW,
- PLPGSQL_DTYPE_REC,
- PLPGSQL_DTYPE_RECFIELD,
- PLPGSQL_DTYPE_ARRAYELEM,
- PLPGSQL_DTYPE_EXPR
-};
-
-/* ----------
- * Variants distinguished in PLpgSQL_type structs
- * ----------
- */
-enum
-{
- PLPGSQL_TTYPE_SCALAR, /* scalar types and domains */
- PLPGSQL_TTYPE_ROW, /* composite types */
- PLPGSQL_TTYPE_REC, /* RECORD pseudotype */
- PLPGSQL_TTYPE_PSEUDO /* other pseudotypes */
-};
-
-/* ----------
- * Execution tree node types
- * ----------
- */
-enum PLpgSQL_stmt_types
-{
- PLPGSQL_STMT_BLOCK,
- PLPGSQL_STMT_ASSIGN,
- PLPGSQL_STMT_IF,
- PLPGSQL_STMT_CASE,
- PLPGSQL_STMT_LOOP,
- PLPGSQL_STMT_WHILE,
- PLPGSQL_STMT_FORI,
- PLPGSQL_STMT_FORS,
- PLPGSQL_STMT_FORC,
- PLPGSQL_STMT_FOREACH_A,
- PLPGSQL_STMT_EXIT,
- PLPGSQL_STMT_RETURN,
- PLPGSQL_STMT_RETURN_NEXT,
- PLPGSQL_STMT_RETURN_QUERY,
- PLPGSQL_STMT_RAISE,
- PLPGSQL_STMT_EXECSQL,
- PLPGSQL_STMT_DYNEXECUTE,
- PLPGSQL_STMT_DYNFORS,
- PLPGSQL_STMT_GETDIAG,
- PLPGSQL_STMT_OPEN,
- PLPGSQL_STMT_FETCH,
- PLPGSQL_STMT_CLOSE,
- PLPGSQL_STMT_PERFORM
-};
-
-
-/* ----------
- * Execution node return codes
- * ----------
- */
-enum
-{
- PLPGSQL_RC_OK,
- PLPGSQL_RC_EXIT,
- PLPGSQL_RC_RETURN,
- PLPGSQL_RC_CONTINUE
-};
-
-/* ----------
- * GET DIAGNOSTICS system attrs
- * ----------
- */
-enum
-{
- PLPGSQL_GETDIAG_ROW_COUNT,
- PLPGSQL_GETDIAG_RESULT_OID
-};
-
-/* --------
- * RAISE statement options
- * --------
- */
-enum
-{
- PLPGSQL_RAISEOPTION_ERRCODE,
- PLPGSQL_RAISEOPTION_MESSAGE,
- PLPGSQL_RAISEOPTION_DETAIL,
- PLPGSQL_RAISEOPTION_HINT
-};
-
-/* --------
- * Behavioral modes for plpgsql variable resolution
- * --------
- */
-typedef enum
-{
- PLPGSQL_RESOLVE_ERROR, /* throw error if ambiguous */
- PLPGSQL_RESOLVE_VARIABLE, /* prefer plpgsql var to table column */
- PLPGSQL_RESOLVE_COLUMN /* prefer table column to plpgsql var */
-} PLpgSQL_resolve_option;
-
-
-/**********************************************************************
- * Node and structure definitions
- **********************************************************************/
-
-
-typedef struct
-{ /* Postgres data type */
- char *typname; /* (simple) name of the type */
- Oid typoid; /* OID of the data type */
- int ttype; /* PLPGSQL_TTYPE_ code */
- int16 typlen; /* stuff copied from its pg_type entry */
- bool typbyval;
- Oid typrelid;
- Oid typioparam;
- Oid collation; /* from pg_type, but can be overridden */
- FmgrInfo typinput; /* lookup info for typinput function */
- int32 atttypmod; /* typmod (taken from someplace else) */
-} PLpgSQL_type;
-
-
-/*
- * PLpgSQL_datum is the common supertype for PLpgSQL_expr, PLpgSQL_var,
- * PLpgSQL_row, PLpgSQL_rec, PLpgSQL_recfield, and PLpgSQL_arrayelem
- */
-typedef struct
-{ /* Generic datum array item */
- int dtype;
- int dno;
-} PLpgSQL_datum;
-
-/*
- * The variants PLpgSQL_var, PLpgSQL_row, and PLpgSQL_rec share these
- * fields
- */
-typedef struct
-{ /* Scalar or composite variable */
- int dtype;
- int dno;
- char *refname;
- int lineno;
-} PLpgSQL_variable;
-
-typedef struct PLpgSQL_expr
-{ /* SQL Query to plan and execute */
- int dtype;
- int dno;
- char *query;
- SPIPlanPtr plan;
- Bitmapset *paramnos; /* all dnos referenced by this query */
-
- /* function containing this expr (not set until we first parse query) */
- struct PLpgSQL_function *func;
-
- /* namespace chain visible to this expr */
- struct PLpgSQL_nsitem *ns;
-
- /* fields for "simple expression" fast-path execution: */
- Expr *expr_simple_expr; /* NULL means not a simple expr */
- int expr_simple_generation; /* plancache generation we checked */
- Oid expr_simple_type; /* result type Oid, if simple */
-
- /*
- * if expr is simple AND prepared in current transaction,
- * expr_simple_state and expr_simple_in_use are valid. Test validity by
- * seeing if expr_simple_lxid matches current LXID. (If not,
- * expr_simple_state probably points at garbage!)
- */
- ExprState *expr_simple_state; /* eval tree for expr_simple_expr */
- bool expr_simple_in_use; /* true if eval tree is active */
- LocalTransactionId expr_simple_lxid;
-} PLpgSQL_expr;
-
-
-typedef struct
-{ /* Scalar variable */
- int dtype;
- int dno;
- char *refname;
- int lineno;
-
- PLpgSQL_type *datatype;
- int isconst;
- int notnull;
- PLpgSQL_expr *default_val;
- PLpgSQL_expr *cursor_explicit_expr;
- int cursor_explicit_argrow;
- int cursor_options;
-
- Datum value;
- bool isnull;
- bool freeval;
-} PLpgSQL_var;
-
-
-typedef struct
-{ /* Row variable */
- int dtype;
- int dno;
- char *refname;
- int lineno;
-
- TupleDesc rowtupdesc;
-
- /*
- * Note: TupleDesc is only set up for named rowtypes, else it is NULL.
- *
- * Note: if the underlying rowtype contains a dropped column, the
- * corresponding fieldnames[] entry will be NULL, and there is no
- * corresponding var (varnos[] will be -1).
- */
- int nfields;
- char **fieldnames;
- int *varnos;
-} PLpgSQL_row;
-
-
-typedef struct
-{ /* Record variable (non-fixed structure) */
- int dtype;
- int dno;
- char *refname;
- int lineno;
-
- HeapTuple tup;
- TupleDesc tupdesc;
- bool freetup;
- bool freetupdesc;
-} PLpgSQL_rec;
-
-
-typedef struct
-{ /* Field in record */
- int dtype;
- int dno;
- char *fieldname;
- int recparentno; /* dno of parent record */
-} PLpgSQL_recfield;
-
-
-typedef struct
-{ /* Element of array variable */
- int dtype;
- int dno;
- PLpgSQL_expr *subscript;
- int arrayparentno; /* dno of parent array variable */
-} PLpgSQL_arrayelem;
-
-
-typedef struct PLpgSQL_nsitem
-{ /* Item in the compilers namespace tree */
- int itemtype;
- int itemno;
- struct PLpgSQL_nsitem *prev;
- char name[1]; /* actually, as long as needed */
-} PLpgSQL_nsitem;
-
-
-typedef struct
-{ /* Generic execution node */
- int cmd_type;
- int lineno;
-} PLpgSQL_stmt;
-
-
-typedef struct PLpgSQL_condition
-{ /* One EXCEPTION condition name */
- int sqlerrstate; /* SQLSTATE code */
- char *condname; /* condition name (for debugging) */
- struct PLpgSQL_condition *next;
-} PLpgSQL_condition;
-
-typedef struct
-{
- int sqlstate_varno;
- int sqlerrm_varno;
- List *exc_list; /* List of WHEN clauses */
-} PLpgSQL_exception_block;
-
-typedef struct
-{ /* One EXCEPTION ... WHEN clause */
- int lineno;
- PLpgSQL_condition *conditions;
- List *action; /* List of statements */
-} PLpgSQL_exception;
-
-
-typedef struct
-{ /* Block of statements */
- int cmd_type;
- int lineno;
- char *label;
- List *body; /* List of statements */
- int n_initvars;
- int *initvarnos;
- PLpgSQL_exception_block *exceptions;
-} PLpgSQL_stmt_block;
-
-
-typedef struct
-{ /* Assign statement */
- int cmd_type;
- int lineno;
- int varno;
- PLpgSQL_expr *expr;
-} PLpgSQL_stmt_assign;
-
-typedef struct
-{ /* PERFORM statement */
- int cmd_type;
- int lineno;
- PLpgSQL_expr *expr;
-} PLpgSQL_stmt_perform;
-
-typedef struct
-{ /* Get Diagnostics item */
- int kind; /* id for diagnostic value desired */
- int target; /* where to assign it */
-} PLpgSQL_diag_item;
-
-typedef struct
-{ /* Get Diagnostics statement */
- int cmd_type;
- int lineno;
- List *diag_items; /* List of PLpgSQL_diag_item */
-} PLpgSQL_stmt_getdiag;
-
-
-typedef struct
-{ /* IF statement */
- int cmd_type;
- int lineno;
- PLpgSQL_expr *cond;
- List *true_body; /* List of statements */
- List *false_body; /* List of statements */
-} PLpgSQL_stmt_if;
-
-
-typedef struct /* CASE statement */
-{
- int cmd_type;
- int lineno;
- PLpgSQL_expr *t_expr; /* test expression, or NULL if none */
- int t_varno; /* var to store test expression value into */
- List *case_when_list; /* List of PLpgSQL_case_when structs */
- bool have_else; /* flag needed because list could be empty */
- List *else_stmts; /* List of statements */
-} PLpgSQL_stmt_case;
-
-typedef struct /* one arm of CASE statement */
-{
- int lineno;
- PLpgSQL_expr *expr; /* boolean expression for this case */
- List *stmts; /* List of statements */
-} PLpgSQL_case_when;
-
-
-typedef struct
-{ /* Unconditional LOOP statement */
- int cmd_type;
- int lineno;
- char *label;
- List *body; /* List of statements */
-} PLpgSQL_stmt_loop;
-
-
-typedef struct
-{ /* WHILE cond LOOP statement */
- int cmd_type;
- int lineno;
- char *label;
- PLpgSQL_expr *cond;
- List *body; /* List of statements */
-} PLpgSQL_stmt_while;
-
-
-typedef struct
-{ /* FOR statement with integer loopvar */
- int cmd_type;
- int lineno;
- char *label;
- PLpgSQL_var *var;
- PLpgSQL_expr *lower;
- PLpgSQL_expr *upper;
- PLpgSQL_expr *step; /* NULL means default (ie, BY 1) */
- int reverse;
- List *body; /* List of statements */
-} PLpgSQL_stmt_fori;
-
-
-/*
- * PLpgSQL_stmt_forq represents a FOR statement running over a SQL query.
- * It is the common supertype of PLpgSQL_stmt_fors, PLpgSQL_stmt_forc
- * and PLpgSQL_dynfors.
- */
-typedef struct
-{
- int cmd_type;
- int lineno;
- char *label;
- PLpgSQL_rec *rec;
- PLpgSQL_row *row;
- List *body; /* List of statements */
-} PLpgSQL_stmt_forq;
-
-typedef struct
-{ /* FOR statement running over SELECT */
- int cmd_type;
- int lineno;
- char *label;
- PLpgSQL_rec *rec;
- PLpgSQL_row *row;
- List *body; /* List of statements */
- /* end of fields that must match PLpgSQL_stmt_forq */
- PLpgSQL_expr *query;
-} PLpgSQL_stmt_fors;
-
-typedef struct
-{ /* FOR statement running over cursor */
- int cmd_type;
- int lineno;
- char *label;
- PLpgSQL_rec *rec;
- PLpgSQL_row *row;
- List *body; /* List of statements */
- /* end of fields that must match PLpgSQL_stmt_forq */
- int curvar;
- PLpgSQL_expr *argquery; /* cursor arguments if any */
-} PLpgSQL_stmt_forc;
-
-typedef struct
-{ /* FOR statement running over EXECUTE */
- int cmd_type;
- int lineno;
- char *label;
- PLpgSQL_rec *rec;
- PLpgSQL_row *row;
- List *body; /* List of statements */
- /* end of fields that must match PLpgSQL_stmt_forq */
- PLpgSQL_expr *query;
- List *params; /* USING expressions */
-} PLpgSQL_stmt_dynfors;
-
-
-typedef struct
-{ /* FOREACH item in array loop */
- int cmd_type;
- int lineno;
- char *label;
- int varno; /* loop target variable */
- int slice; /* slice dimension, or 0 */
- PLpgSQL_expr *expr; /* array expression */
- List *body; /* List of statements */
-} PLpgSQL_stmt_foreach_a;
-
-
-typedef struct
-{ /* OPEN a curvar */
- int cmd_type;
- int lineno;
- int curvar;
- int cursor_options;
- PLpgSQL_row *returntype;
- PLpgSQL_expr *argquery;
- PLpgSQL_expr *query;
- PLpgSQL_expr *dynquery;
- List *params; /* USING expressions */
-} PLpgSQL_stmt_open;
-
-
-typedef struct
-{ /* FETCH or MOVE statement */
- int cmd_type;
- int lineno;
- PLpgSQL_rec *rec; /* target, as record or row */
- PLpgSQL_row *row;
- int curvar; /* cursor variable to fetch from */
- FetchDirection direction; /* fetch direction */
- long how_many; /* count, if constant (expr is NULL) */
- PLpgSQL_expr *expr; /* count, if expression */
- bool is_move; /* is this a fetch or move? */
- bool returns_multiple_rows; /* can return more than one row? */
-} PLpgSQL_stmt_fetch;
-
-
-typedef struct
-{ /* CLOSE curvar */
- int cmd_type;
- int lineno;
- int curvar;
-} PLpgSQL_stmt_close;
-
-
-typedef struct
-{ /* EXIT or CONTINUE statement */
- int cmd_type;
- int lineno;
- bool is_exit; /* Is this an exit or a continue? */
- char *label; /* NULL if it's an unlabelled EXIT/CONTINUE */
- PLpgSQL_expr *cond;
-} PLpgSQL_stmt_exit;
-
-
-typedef struct
-{ /* RETURN statement */
- int cmd_type;
- int lineno;
- PLpgSQL_expr *expr;
- int retvarno;
-} PLpgSQL_stmt_return;
-
-typedef struct
-{ /* RETURN NEXT statement */
- int cmd_type;
- int lineno;
- PLpgSQL_expr *expr;
- int retvarno;
-} PLpgSQL_stmt_return_next;
-
-typedef struct
-{ /* RETURN QUERY statement */
- int cmd_type;
- int lineno;
- PLpgSQL_expr *query; /* if static query */
- PLpgSQL_expr *dynquery; /* if dynamic query (RETURN QUERY EXECUTE) */
- List *params; /* USING arguments for dynamic query */
-} PLpgSQL_stmt_return_query;
-
-typedef struct
-{ /* RAISE statement */
- int cmd_type;
- int lineno;
- int elog_level;
- char *condname; /* condition name, SQLSTATE, or NULL */
- char *message; /* old-style message format literal, or NULL */
- List *params; /* list of expressions for old-style message */
- List *options; /* list of PLpgSQL_raise_option */
-} PLpgSQL_stmt_raise;
-
-typedef struct
-{ /* RAISE statement option */
- int opt_type;
- PLpgSQL_expr *expr;
-} PLpgSQL_raise_option;
-
-
-typedef struct
-{ /* Generic SQL statement to execute */
- int cmd_type;
- int lineno;
- PLpgSQL_expr *sqlstmt;
- bool mod_stmt; /* is the stmt INSERT/UPDATE/DELETE? */
- /* note: mod_stmt is set when we plan the query */
- bool into; /* INTO supplied? */
- bool strict; /* INTO STRICT flag */
- PLpgSQL_rec *rec; /* INTO target, if record */
- PLpgSQL_row *row; /* INTO target, if row */
-} PLpgSQL_stmt_execsql;
-
-
-typedef struct
-{ /* Dynamic SQL string to execute */
- int cmd_type;
- int lineno;
- PLpgSQL_expr *query; /* string expression */
- bool into; /* INTO supplied? */
- bool strict; /* INTO STRICT flag */
- PLpgSQL_rec *rec; /* INTO target, if record */
- PLpgSQL_row *row; /* INTO target, if row */
- List *params; /* USING expressions */
-} PLpgSQL_stmt_dynexecute;
-
-
-typedef struct PLpgSQL_func_hashkey
-{ /* Hash lookup key for functions */
- Oid funcOid;
-
- bool isTrigger; /* true if called as a trigger */
-
- /* be careful that pad bytes in this struct get zeroed! */
-
- /*
- * For a trigger function, the OID of the relation triggered on is part of
- * the hash key --- we want to compile the trigger separately for each
- * relation it is used with, in case the rowtype is different. Zero if
- * not called as a trigger.
- */
- Oid trigrelOid;
-
- /*
- * We must include the input collation as part of the hash key too,
- * because we have to generate different plans (with different Param
- * collations) for different collation settings.
- */
- Oid inputCollation;
-
- /*
- * We include actual argument types in the hash key to support polymorphic
- * PLpgSQL functions. Be careful that extra positions are zeroed!
- */
- Oid argtypes[FUNC_MAX_ARGS];
-} PLpgSQL_func_hashkey;
-
-
-typedef struct PLpgSQL_function
-{ /* Complete compiled function */
- char *fn_name;
- Oid fn_oid;
- TransactionId fn_xmin;
- ItemPointerData fn_tid;
- bool fn_is_trigger;
- Oid fn_input_collation;
- PLpgSQL_func_hashkey *fn_hashkey; /* back-link to hashtable key */
- MemoryContext fn_cxt;
-
- Oid fn_rettype;
- int fn_rettyplen;
- bool fn_retbyval;
- FmgrInfo fn_retinput;
- Oid fn_rettypioparam;
- bool fn_retistuple;
- bool fn_retset;
- bool fn_readonly;
-
- int fn_nargs;
- int fn_argvarnos[FUNC_MAX_ARGS];
- int out_param_varno;
- int found_varno;
- int new_varno;
- int old_varno;
- int tg_name_varno;
- int tg_when_varno;
- int tg_level_varno;
- int tg_op_varno;
- int tg_relid_varno;
- int tg_relname_varno;
- int tg_table_name_varno;
- int tg_table_schema_varno;
- int tg_nargs_varno;
- int tg_argv_varno;
-
- PLpgSQL_resolve_option resolve_option;
-
- int ndatums;
- PLpgSQL_datum **datums;
- PLpgSQL_stmt_block *action;
-
- /* these fields change when the function is used */
- struct PLpgSQL_execstate *cur_estate;
- unsigned long use_count;
-} PLpgSQL_function;
-
-
-typedef struct PLpgSQL_execstate
-{ /* Runtime execution data */
- PLpgSQL_function *func; /* function being executed */
-
- Datum retval;
- bool retisnull;
- Oid rettype; /* type of current retval */
-
- Oid fn_rettype; /* info about declared function rettype */
- bool retistuple;
- bool retisset;
-
- bool readonly_func;
-
- TupleDesc rettupdesc;
- char *exitlabel; /* the "target" label of the current EXIT or
- * CONTINUE stmt, if any */
- ErrorData *cur_error; /* current exception handler's error */
-
- Tuplestorestate *tuple_store; /* SRFs accumulate results here */
- MemoryContext tuple_store_cxt;
- ResourceOwner tuple_store_owner;
- ReturnSetInfo *rsi;
-
- int found_varno;
- int ndatums;
- PLpgSQL_datum **datums;
-
- /* temporary state for results from evaluation of query or expr */
- SPITupleTable *eval_tuptable;
- uint32 eval_processed;
- Oid eval_lastoid;
- ExprContext *eval_econtext; /* for executing simple expressions */
- PLpgSQL_expr *cur_expr; /* current query/expr being evaluated */
-
- /* status information for error context reporting */
- PLpgSQL_stmt *err_stmt; /* current stmt */
- const char *err_text; /* additional state info */
-
- void *plugin_info; /* reserved for use by optional plugin */
-} PLpgSQL_execstate;
-
-
-/*
- * A PLpgSQL_plugin structure represents an instrumentation plugin.
- * To instrument PL/pgSQL, a plugin library must access the rendezvous
- * variable "PLpgSQL_plugin" and set it to point to a PLpgSQL_plugin struct.
- * Typically the struct could just be static data in the plugin library.
- * We expect that a plugin would do this at library load time (_PG_init()).
- * It must also be careful to set the rendezvous variable back to NULL
- * if it is unloaded (_PG_fini()).
- *
- * This structure is basically a collection of function pointers --- at
- * various interesting points in pl_exec.c, we call these functions
- * (if the pointers are non-NULL) to give the plugin a chance to watch
- * what we are doing.
- *
- * func_setup is called when we start a function, before we've initialized
- * the local variables defined by the function.
- *
- * func_beg is called when we start a function, after we've initialized
- * the local variables.
- *
- * func_end is called at the end of a function.
- *
- * stmt_beg and stmt_end are called before and after (respectively) each
- * statement.
- *
- * Also, immediately before any call to func_setup, PL/pgSQL fills in the
- * error_callback and assign_expr fields with pointers to its own
- * plpgsql_exec_error_callback and exec_assign_expr functions. This is
- * a somewhat ad-hoc expedient to simplify life for debugger plugins.
- */
-
-typedef struct
-{
- /* Function pointers set up by the plugin */
- void (*func_setup) (PLpgSQL_execstate *estate, PLpgSQL_function *func);
- void (*func_beg) (PLpgSQL_execstate *estate, PLpgSQL_function *func);
- void (*func_end) (PLpgSQL_execstate *estate, PLpgSQL_function *func);
- void (*stmt_beg) (PLpgSQL_execstate *estate, PLpgSQL_stmt *stmt);
- void (*stmt_end) (PLpgSQL_execstate *estate, PLpgSQL_stmt *stmt);
-
- /* Function pointers set by PL/pgSQL itself */
- void (*error_callback) (void *arg);
- void (*assign_expr) (PLpgSQL_execstate *estate, PLpgSQL_datum *target,
- PLpgSQL_expr *expr);
-} PLpgSQL_plugin;
-
-
-/* Struct types used during parsing */
-
-typedef struct
-{
- char *ident; /* palloc'd converted identifier */
- bool quoted; /* Was it double-quoted? */
-} PLword;
-
-typedef struct
-{
- List *idents; /* composite identifiers (list of String) */
-} PLcword;
-
-typedef struct
-{
- PLpgSQL_datum *datum; /* referenced variable */
- char *ident; /* valid if simple name */
- bool quoted;
- List *idents; /* valid if composite name */
-} PLwdatum;
-
-/**********************************************************************
- * Global variable declarations
- **********************************************************************/
-
-typedef enum
-{
- IDENTIFIER_LOOKUP_NORMAL, /* normal processing of var names */
- IDENTIFIER_LOOKUP_DECLARE, /* In DECLARE --- don't look up names */
- IDENTIFIER_LOOKUP_EXPR /* In SQL expression --- special case */
-} IdentifierLookup;
-
-extern IdentifierLookup plpgsql_IdentifierLookup;
-
-extern int plpgsql_variable_conflict;
-
-extern bool plpgsql_check_syntax;
-extern bool plpgsql_DumpExecTree;
-
-extern PLpgSQL_stmt_block *plpgsql_parse_result;
-
-extern int plpgsql_nDatums;
-extern PLpgSQL_datum **plpgsql_Datums;
-
-extern char *plpgsql_error_funcname;
-
-extern PLpgSQL_function *plpgsql_curr_compile;
-extern MemoryContext compile_tmp_cxt;
-
-extern PLpgSQL_plugin **plugin_ptr;
-
-/**********************************************************************
- * Function declarations
- **********************************************************************/
-
-/* ----------
- * Functions in pl_comp.c
- * ----------
- */
-extern PLpgSQL_function *plpgsql_compile(FunctionCallInfo fcinfo,
- bool forValidator);
-extern PLpgSQL_function *plpgsql_compile_inline(char *proc_source);
-extern void plpgsql_parser_setup(struct ParseState *pstate,
- PLpgSQL_expr *expr);
-extern bool plpgsql_parse_word(char *word1, const char *yytxt,
- PLwdatum *wdatum, PLword *word);
-extern bool plpgsql_parse_dblword(char *word1, char *word2,
- PLwdatum *wdatum, PLcword *cword);
-extern bool plpgsql_parse_tripword(char *word1, char *word2, char *word3,
- PLwdatum *wdatum, PLcword *cword);
-extern PLpgSQL_type *plpgsql_parse_wordtype(char *ident);
-extern PLpgSQL_type *plpgsql_parse_cwordtype(List *idents);
-extern PLpgSQL_type *plpgsql_parse_wordrowtype(char *ident);
-extern PLpgSQL_type *plpgsql_parse_cwordrowtype(List *idents);
-extern PLpgSQL_type *plpgsql_build_datatype(Oid typeOid, int32 typmod,
- Oid collation);
-extern PLpgSQL_variable *plpgsql_build_variable(const char *refname, int lineno,
- PLpgSQL_type *dtype,
- bool add2namespace);
-extern PLpgSQL_rec *plpgsql_build_record(const char *refname, int lineno,
- bool add2namespace);
-extern int plpgsql_recognize_err_condition(const char *condname,
- bool allow_sqlstate);
-extern PLpgSQL_condition *plpgsql_parse_err_condition(char *condname);
-extern void plpgsql_adddatum(PLpgSQL_datum *new);
-extern int plpgsql_add_initdatums(int **varnos);
-extern void plpgsql_HashTableInit(void);
-
-/* ----------
- * Functions in pl_handler.c
- * ----------
- */
-extern void _PG_init(void);
-extern Datum plpgsql_call_handler(PG_FUNCTION_ARGS);
-extern Datum plpgsql_inline_handler(PG_FUNCTION_ARGS);
-extern Datum plpgsql_validator(PG_FUNCTION_ARGS);
-
-/* ----------
- * Functions in pl_exec.c
- * ----------
- */
-extern Datum plpgsql_exec_function(PLpgSQL_function *func,
- FunctionCallInfo fcinfo);
-extern HeapTuple plpgsql_exec_trigger(PLpgSQL_function *func,
- TriggerData *trigdata);
-extern void plpgsql_xact_cb(XactEvent event, void *arg);
-extern void plpgsql_subxact_cb(SubXactEvent event, SubTransactionId mySubid,
- SubTransactionId parentSubid, void *arg);
-extern Oid exec_get_datum_type(PLpgSQL_execstate *estate,
- PLpgSQL_datum *datum);
-extern void exec_get_datum_type_info(PLpgSQL_execstate *estate,
- PLpgSQL_datum *datum,
- Oid *typeid, int32 *typmod, Oid *collation);
-
-/* ----------
- * Functions for namespace handling in pl_funcs.c
- * ----------
- */
-extern void plpgsql_ns_init(void);
-extern void plpgsql_ns_push(const char *label);
-extern void plpgsql_ns_pop(void);
-extern PLpgSQL_nsitem *plpgsql_ns_top(void);
-extern void plpgsql_ns_additem(int itemtype, int itemno, const char *name);
-extern PLpgSQL_nsitem *plpgsql_ns_lookup(PLpgSQL_nsitem *ns_cur, bool localmode,
- const char *name1, const char *name2,
- const char *name3, int *names_used);
-extern PLpgSQL_nsitem *plpgsql_ns_lookup_label(PLpgSQL_nsitem *ns_cur,
- const char *name);
-
-/* ----------
- * Other functions in pl_funcs.c
- * ----------
- */
-extern const char *plpgsql_stmt_typename(PLpgSQL_stmt *stmt);
-extern void plpgsql_free_function_memory(PLpgSQL_function *func);
-extern void plpgsql_dumptree(PLpgSQL_function *func);
-
-/* ----------
- * Scanner functions in pl_scanner.c
- * ----------
- */
-extern int plpgsql_base_yylex(void);
-extern int plpgsql_yylex(void);
-extern void plpgsql_push_back_token(int token);
-extern void plpgsql_append_source_text(StringInfo buf,
- int startlocation, int endlocation);
-extern int plpgsql_scanner_errposition(int location);
-extern void plpgsql_yyerror(const char *message);
-extern int plpgsql_location_to_lineno(int location);
-extern int plpgsql_latest_lineno(void);
-extern void plpgsql_scanner_init(const char *str);
-extern void plpgsql_scanner_finish(void);
-
-/* ----------
- * Externs in gram.y
- * ----------
- */
-extern int plpgsql_yyparse(void);
-
-#endif /* PLPGSQL_H */