PostgreSQL Source Code git master
|
#include "postgres.h"
#include <limits.h>
#include <math.h>
#include "access/sysattr.h"
#include "access/tsmapi.h"
#include "catalog/pg_class.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_proc.h"
#include "foreign/fdwapi.h"
#include "miscadmin.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "nodes/supportnodes.h"
#include "optimizer/appendinfo.h"
#include "optimizer/clauses.h"
#include "optimizer/cost.h"
#include "optimizer/geqo.h"
#include "optimizer/optimizer.h"
#include "optimizer/pathnode.h"
#include "optimizer/paths.h"
#include "optimizer/plancat.h"
#include "optimizer/planner.h"
#include "optimizer/prep.h"
#include "optimizer/tlist.h"
#include "parser/parse_clause.h"
#include "parser/parsetree.h"
#include "partitioning/partbounds.h"
#include "port/pg_bitutils.h"
#include "rewrite/rewriteManip.h"
#include "utils/lsyscache.h"
#include "utils/selfuncs.h"
Go to the source code of this file.
Data Structures | |
struct | pushdown_safety_info |
Macros | |
#define | UNSAFE_HAS_VOLATILE_FUNC (1 << 0) |
#define | UNSAFE_HAS_SET_FUNC (1 << 1) |
#define | UNSAFE_NOTIN_DISTINCTON_CLAUSE (1 << 2) |
#define | UNSAFE_NOTIN_PARTITIONBY_CLAUSE (1 << 3) |
#define | UNSAFE_TYPE_MISMATCH (1 << 4) |
Typedefs | |
typedef struct pushdown_safety_info | pushdown_safety_info |
typedef enum pushdown_safe_type | pushdown_safe_type |
Enumerations | |
enum | pushdown_safe_type { PUSHDOWN_UNSAFE , PUSHDOWN_SAFE , PUSHDOWN_WINDOWCLAUSE_RUNCOND } |
Variables | |
bool | enable_geqo = false |
bool | enable_eager_aggregate = true |
int | geqo_threshold |
double | min_eager_agg_group_size |
int | min_parallel_table_scan_size |
int | min_parallel_index_scan_size |
set_rel_pathlist_hook_type | set_rel_pathlist_hook = NULL |
join_search_hook_type | join_search_hook = NULL |
#define UNSAFE_HAS_SET_FUNC (1 << 1) |
Definition at line 56 of file allpaths.c.
#define UNSAFE_HAS_VOLATILE_FUNC (1 << 0) |
Definition at line 55 of file allpaths.c.
#define UNSAFE_NOTIN_DISTINCTON_CLAUSE (1 << 2) |
Definition at line 57 of file allpaths.c.
#define UNSAFE_NOTIN_PARTITIONBY_CLAUSE (1 << 3) |
Definition at line 58 of file allpaths.c.
#define UNSAFE_TYPE_MISMATCH (1 << 4) |
Definition at line 59 of file allpaths.c.
typedef enum pushdown_safe_type pushdown_safe_type |
typedef struct pushdown_safety_info pushdown_safety_info |
enum pushdown_safe_type |
Enumerator | |
---|---|
PUSHDOWN_UNSAFE | |
PUSHDOWN_SAFE | |
PUSHDOWN_WINDOWCLAUSE_RUNCOND |
Definition at line 72 of file allpaths.c.
|
static |
Definition at line 2213 of file allpaths.c.
References AppendPath::first_partial_path, IsA, lappend(), list_concat(), list_copy_head(), list_copy_tail(), Path::parallel_aware, AppendPath::path, AppendPath::subpaths, and MergeAppendPath::subpaths.
Referenced by add_paths_to_append_rel(), and generate_orderedappend_paths().
void add_paths_to_append_rel | ( | PlannerInfo * | root, |
RelOptInfo * | rel, | ||
List * | live_childrels | ||
) |
Definition at line 1404 of file allpaths.c.
References accumulate_append_subpath(), add_partial_path(), add_path(), Assert(), bms_equal(), RelOptInfo::cheapest_startup_path, RelOptInfo::cheapest_total_path, compare_pathkeys(), RelOptInfo::consider_parallel, RelOptInfo::consider_startup, create_append_path(), enable_parallel_append, for_each_from, generate_orderedappend_paths(), get_cheapest_fractional_path(), get_cheapest_parallel_safe_total_inner(), get_cheapest_parameterized_child_path(), lappend(), lfirst, linitial, list_length(), list_make1, Max, max_parallel_workers_per_gather, Min, NIL, Path::parallel_workers, RelOptInfo::partial_pathlist, AppendPath::path, PATH_REQ_OUTER, Path::pathkeys, PATHKEYS_EQUAL, RelOptInfo::pathlist, pg_leftmost_one_pos32(), root, Path::rows, subpath(), and Path::total_cost.
Referenced by apply_scanjoin_target_to_paths(), create_partitionwise_grouping_paths(), generate_partitionwise_join_paths(), and set_append_rel_pathlist().
|
static |
Definition at line 2530 of file allpaths.c.
References OpExpr::args, TargetEntry::expr, find_window_run_conditions(), func_strict(), if(), IsA, linitial, list_length(), list_nth(), lsecond, TargetEntry::resno, set_opfuncid(), Query::targetList, and Var::varattno.
Referenced by set_subquery_pathlist().
|
static |
Definition at line 4192 of file allpaths.c.
References contain_volatile_functions(), Query::distinctClause, TargetEntry::expr, expression_returns_set(), InvalidOid, lfirst, TargetEntry::resno, targetIsInAllPartitionLists(), targetIsInSortList(), Query::targetList, UNSAFE_HAS_SET_FUNC, UNSAFE_HAS_VOLATILE_FUNC, UNSAFE_NOTIN_DISTINCTON_CLAUSE, UNSAFE_NOTIN_PARTITIONBY_CLAUSE, and pushdown_safety_info::unsafeFlags.
Referenced by subquery_is_pushdown_safe().
|
static |
Definition at line 4264 of file allpaths.c.
References elog, ERROR, TargetEntry::expr, exprType(), lfirst, lfirst_oid, list_head(), lnext(), TargetEntry::resno, UNSAFE_TYPE_MISMATCH, and pushdown_safety_info::unsafeFlags.
Referenced by subquery_is_pushdown_safe().
int compute_parallel_worker | ( | RelOptInfo * | rel, |
double | heap_pages, | ||
double | index_pages, | ||
int | max_workers | ||
) |
Definition at line 4689 of file allpaths.c.
References Max, Min, min_parallel_index_scan_size, min_parallel_table_scan_size, RelOptInfo::rel_parallel_workers, RELOPT_BASEREL, and RelOptInfo::reloptkind.
Referenced by cost_index(), create_partial_bitmap_paths(), create_plain_partial_paths(), and plan_create_index_workers().
void create_partial_bitmap_paths | ( | PlannerInfo * | root, |
RelOptInfo * | rel, | ||
Path * | bitmapqual | ||
) |
Definition at line 4653 of file allpaths.c.
References add_partial_path(), compute_bitmap_pages(), compute_parallel_worker(), create_bitmap_heap_path(), RelOptInfo::lateral_relids, max_parallel_workers_per_gather, and root.
Referenced by create_index_paths().
|
static |
Definition at line 860 of file allpaths.c.
References add_partial_path(), compute_parallel_worker(), create_seqscan_path(), max_parallel_workers_per_gather, RelOptInfo::pages, and root.
Referenced by set_plain_rel_pathlist().
|
static |
Definition at line 2340 of file allpaths.c.
References arg, WindowFuncRunCondition::arg, OpExpr::args, bms_add_member(), OpIndexInterpretation::cmptype, COMPARE_EQ, COMPARE_GE, COMPARE_GT, COMPARE_LE, COMPARE_LT, contain_subplans(), copyObject, DatumGetPointer(), FirstLowInvalidHeapAttributeNumber, get_func_support(), get_op_index_interpretation(), get_opfamily_member_for_cmptype(), InvalidOid, is_pseudo_constant_clause(), IsA, lappend(), lfirst, linitial, list_nth(), lsecond, makeNode, SupportRequestWFuncMonotonic::monotonic, MONOTONICFUNC_BOTH, MONOTONICFUNC_DECREASING, MONOTONICFUNC_INCREASING, MONOTONICFUNC_NONE, OidFunctionCall1, OidIsValid, OpIndexInterpretation::opfamily_id, OpIndexInterpretation::oplefttype, WindowFuncRunCondition::opno, OpExpr::opno, OpIndexInterpretation::oprighttype, PointerGetDatum(), SupportRequestWFuncMonotonic::type, WindowFuncRunCondition::wfunc_left, SupportRequestWFuncMonotonic::window_clause, SupportRequestWFuncMonotonic::window_func, Query::windowClause, WindowFunc::winfnoid, and WindowFunc::winref.
Referenced by check_and_push_window_quals().
void generate_gather_paths | ( | PlannerInfo * | root, |
RelOptInfo * | rel, | ||
bool | override_rows | ||
) |
Definition at line 3175 of file allpaths.c.
References add_path(), compute_gather_rows(), create_gather_merge_path(), create_gather_path(), lfirst, linitial, NIL, RelOptInfo::partial_pathlist, GatherMergePath::path, RelOptInfo::reltarget, root, and subpath().
Referenced by generate_useful_gather_paths().
void generate_grouped_paths | ( | PlannerInfo * | root, |
RelOptInfo * | grouped_rel, | ||
RelOptInfo * | rel | ||
) |
Definition at line 3429 of file allpaths.c.
References add_partial_path(), add_path(), AGG_HASHED, RelOptInfo::agg_info, RelAggInfo::agg_input, AGG_SORTED, RelAggInfo::agg_useful, AGGSPLIT_INITIAL_SERIAL, RelAggInfo::apply_at, Assert(), bms_equal(), RelOptInfo::cheapest_total_path, RelOptInfo::consider_parallel, create_agg_path(), create_incremental_sort_path(), create_projection_path(), create_sort_path(), enable_incremental_sort, estimate_num_groups(), get_agg_clause_costs(), RelAggInfo::group_clauses, RelAggInfo::group_exprs, RelOptInfo::grouped_rel, grouping_is_hashable(), grouping_is_sortable(), IS_DUMMY_REL, IS_OTHER_REL, lfirst, linitial, make_pathkeys_for_sortclauses(), make_tlist_from_pathtarget(), mark_dummy_rel(), MemSet, NIL, RelOptInfo::partial_pathlist, Path::pathkeys, pathkeys_count_contained_in(), RelOptInfo::pathlist, RelOptInfo::relids, root, Path::rows, and RelAggInfo::target.
Referenced by generate_partitionwise_join_paths(), merge_clump(), set_grouped_rel_pathlist(), and standard_join_search().
|
static |
Definition at line 1830 of file allpaths.c.
References accumulate_append_subpath(), add_path(), Assert(), BackwardScanDirection, build_partition_pathkeys(), RelOptInfo::cheapest_total_path, create_append_path(), create_merge_append_path(), ForwardScanDirection, get_cheapest_fractional_path_for_pathkeys(), get_cheapest_path_for_pathkeys(), get_singleton_append_subpath(), i, IS_SIMPLE_REL, lappend(), lfirst, list_length(), list_nth_node, RelOptInfo::live_parts, NIL, partitions_are_ordered(), pathkeys_contained_in(), RelOptInfo::pathlist, root, RelOptInfo::rows, STARTUP_COST, and TOTAL_COST.
Referenced by add_paths_to_append_rel().
void generate_partitionwise_join_paths | ( | PlannerInfo * | root, |
RelOptInfo * | rel | ||
) |
Definition at line 4777 of file allpaths.c.
References add_paths_to_append_rel(), Assert(), bms_equal(), check_stack_depth(), RelOptInfo::consider_partitionwise_join, generate_grouped_paths(), generate_partitionwise_join_paths(), RelOptInfo::grouped_rel, IS_DUMMY_REL, IS_GROUPED_REL, IS_JOIN_REL, IS_OTHER_REL, IS_PARTITIONED_REL, lappend(), list_free(), mark_dummy_rel(), NIL, RelOptInfo::nparts, RelOptInfo::pathlist, pprint(), RelOptInfo::relids, root, set_cheapest(), and RelOptInfo::top_parent_relids.
Referenced by generate_partitionwise_join_paths(), merge_clump(), and standard_join_search().
void generate_useful_gather_paths | ( | PlannerInfo * | root, |
RelOptInfo * | rel, | ||
bool | override_rows | ||
) |
Definition at line 3312 of file allpaths.c.
References add_path(), compute_gather_rows(), create_gather_merge_path(), create_incremental_sort_path(), create_sort_path(), enable_incremental_sort, generate_gather_paths(), get_useful_pathkeys_for_relation(), lfirst, linitial, NIL, RelOptInfo::partial_pathlist, GatherMergePath::path, pathkeys_count_contained_in(), RelOptInfo::reltarget, root, and subpath().
Referenced by apply_scanjoin_target_to_paths(), create_partial_distinct_paths(), create_partial_unique_paths(), gather_grouping_paths(), merge_clump(), set_rel_pathlist(), and standard_join_search().
|
static |
Definition at line 2125 of file allpaths.c.
References Assert(), bms_equal(), bms_is_subset(), compare_path_costs(), get_cheapest_path_for_pathkeys(), lfirst, NIL, PATH_REQ_OUTER, RelOptInfo::pathlist, reparameterize_path(), root, and TOTAL_COST.
Referenced by add_paths_to_append_rel().
Definition at line 2258 of file allpaths.c.
References Assert(), IsA, linitial, list_length(), Path::parallel_aware, AppendPath::subpaths, and MergeAppendPath::subpaths.
Referenced by generate_orderedappend_paths().
|
static |
Definition at line 3244 of file allpaths.c.
References lappend(), lfirst, list_copy_head(), list_length(), NIL, relation_can_be_sorted_early(), and root.
Referenced by generate_useful_gather_paths().
RelOptInfo * make_one_rel | ( | PlannerInfo * | root, |
List * | joinlist | ||
) |
Definition at line 177 of file allpaths.c.
References Assert(), bms_equal(), IS_DUMMY_REL, IS_SIMPLE_REL, make_rel_from_joinlist(), RelOptInfo::pages, RelOptInfo::relid, RelOptInfo::relids, root, set_base_rel_consider_startup(), set_base_rel_pathlists(), set_base_rel_sizes(), and setup_simple_grouped_rels().
Referenced by query_planner().
|
static |
Definition at line 3767 of file allpaths.c.
References elog, enable_geqo, ERROR, find_base_rel(), geqo(), geqo_threshold, IsA, join_search_hook, lappend(), lfirst, linitial, list_length(), make_rel_from_joinlist(), NIL, nodeTag, root, and standard_join_search().
Referenced by make_one_rel(), and make_rel_from_joinlist().
|
static |
Definition at line 4340 of file allpaths.c.
References Assert(), RestrictInfo::clause, contain_leaked_vars(), contain_subplans(), contain_volatile_functions(), if(), IsA, lfirst, list_free(), pull_var_clause(), PUSHDOWN_SAFE, PUSHDOWN_UNSAFE, PUSHDOWN_WINDOWCLAUSE_RUNCOND, PVC_INCLUDE_PLACEHOLDERS, UNSAFE_HAS_SET_FUNC, UNSAFE_HAS_VOLATILE_FUNC, UNSAFE_NOTIN_DISTINCTON_CLAUSE, UNSAFE_TYPE_MISMATCH, pushdown_safety_info::unsafeFlags, pushdown_safety_info::unsafeLeaky, pushdown_safety_info::unsafeVolatile, Var::varattno, and Var::varno.
Referenced by set_subquery_pathlist().
|
static |
Definition at line 4489 of file allpaths.c.
References Assert(), elog, ERROR, IsA, SetOperationStmt::larg, nodeTag, SetOperationStmt::rarg, recurse_push_qual(), rt_fetch, Query::rtable, RangeTblRef::rtindex, RangeTblEntry::subquery, and subquery_push_qual().
Referenced by recurse_push_qual(), and subquery_push_qual().
|
static |
Definition at line 4123 of file allpaths.c.
References Assert(), elog, ERROR, IsA, SetOperationStmt::larg, nodeTag, SetOperationStmt::op, SetOperationStmt::rarg, recurse_pushdown_safe(), rt_fetch, Query::rtable, RangeTblRef::rtindex, SETOP_EXCEPT, RangeTblEntry::subquery, and subquery_is_pushdown_safe().
Referenced by recurse_pushdown_safe(), and subquery_is_pushdown_safe().
|
static |
Definition at line 4541 of file allpaths.c.
References RelOptInfo::baserestrictinfo, bms_is_member(), RestrictInfo::clause, contain_volatile_functions(), Query::distinctClause, TargetEntry::expr, exprCollation(), expression_returns_set(), PathTarget::exprs, exprType(), exprTypmod(), FirstLowInvalidHeapAttributeNumber, if(), lfirst, makeNullConst(), pull_varattnos(), RelOptInfo::relid, RelOptInfo::reltarget, TargetEntry::resno, TargetEntry::ressortgroupref, Query::setOperations, and Query::targetList.
Referenced by set_subquery_pathlist().
|
static |
Definition at line 1305 of file allpaths.c.
References add_paths_to_append_rel(), AppendRelInfo::child_relid, RelOptInfo::consider_parallel, IS_DUMMY_REL, lappend(), lfirst, NIL, AppendRelInfo::parent_relid, root, and set_rel_pathlist().
Referenced by set_rel_pathlist().
|
static |
Definition at line 1010 of file allpaths.c.
References add_child_rel_equivalences(), adjust_appendrel_attrs(), Assert(), bms_is_empty, bms_overlap(), check_stack_depth(), AppendRelInfo::child_relid, RelOptInfo::consider_parallel, RelOptInfo::consider_partitionwise_join, enable_partitionwise_join, PathTarget::exprs, exprType(), exprTypmod(), find_base_rel(), forboth, get_typavgwidth(), RelOptInfo::has_eclass_joins, has_useful_pathkeys(), i, InvalidAttrNumber, IS_DUMMY_REL, IS_SIMPLE_REL, IsA, RelOptInfo::joininfo, lappend(), lfirst, RelOptInfo::max_attr, RelOptInfo::min_attr, NIL, RelOptInfo::nulling_relids, palloc0(), AppendRelInfo::parent_relid, pfree(), relation_excluded_by_constraints(), RelOptInfo::relid, RELOPT_BASEREL, RELOPT_OTHER_MEMBER_REL, RelOptInfo::reloptkind, RelOptInfo::reltarget, root, RelOptInfo::rows, set_dummy_rel_pathlist(), set_rel_consider_parallel(), set_rel_size(), RelOptInfo::tuples, Var::varattno, Var::varno, and PathTarget::width.
Referenced by set_rel_size().
|
static |
Definition at line 259 of file allpaths.c.
References bms_get_singleton_member(), RelOptInfo::consider_param_startup, find_base_rel(), JOIN_ANTI, JOIN_SEMI, SpecialJoinInfo::jointype, lfirst, root, and SpecialJoinInfo::syn_righthand.
Referenced by make_one_rel().
|
static |
Definition at line 378 of file allpaths.c.
References Assert(), RelOptInfo::relid, RELOPT_BASEREL, RelOptInfo::reloptkind, root, and set_rel_pathlist().
Referenced by make_one_rel().
|
static |
Definition at line 302 of file allpaths.c.
References Assert(), RelOptInfo::relid, RELOPT_BASEREL, RelOptInfo::reloptkind, root, set_rel_consider_parallel(), and set_rel_size().
Referenced by make_one_rel().
|
static |
Definition at line 2983 of file allpaths.c.
References add_path(), Assert(), convert_subquery_pathkeys(), create_ctescan_path(), PlannerInfo::cte_plan_ids, RangeTblEntry::ctelevelsup, Query::cteList, RangeTblEntry::ctename, CommonTableExpr::ctename, elog, ERROR, RelOptInfo::lateral_relids, lfirst, list_length(), list_nth(), list_nth_int(), PlannerInfo::parse, Path::pathkeys, Plan::plan_rows, root, set_cte_size_estimates(), and Plan::targetlist.
Referenced by set_rel_size().
|
static |
Definition at line 2292 of file allpaths.c.
References add_path(), create_append_path(), RelOptInfo::lateral_relids, NIL, RelOptInfo::partial_pathlist, RelOptInfo::pathlist, RelOptInfo::reltarget, RelOptInfo::rows, set_cheapest(), and PathTarget::width.
Referenced by set_append_rel_size(), set_rel_size(), and set_subquery_pathlist().
|
static |
Definition at line 992 of file allpaths.c.
References root.
Referenced by set_rel_pathlist().
|
static |
Definition at line 968 of file allpaths.c.
References clamp_row_est(), Max, root, RelOptInfo::rows, set_foreign_size_estimates(), and RelOptInfo::tuples.
Referenced by set_rel_size().
|
static |
Definition at line 2872 of file allpaths.c.
References add_path(), build_expression_pathkey(), create_functionscan_path(), PathTarget::exprs, RangeTblEntry::funcordinality, IsA, RelOptInfo::lateral_relids, lfirst, RelOptInfo::max_attr, NIL, RelOptInfo::relid, RelOptInfo::relids, RelOptInfo::reltarget, root, Var::varattno, Var::varlevelsup, and Var::varno.
Referenced by set_rel_pathlist().
|
static |
Definition at line 1368 of file allpaths.c.
References Assert(), generate_grouped_paths(), RelOptInfo::grouped_rel, IS_GROUPED_REL, NIL, root, and set_cheapest().
Referenced by set_rel_pathlist().
|
static |
Definition at line 3062 of file allpaths.c.
References add_path(), create_namedtuplestorescan_path(), RelOptInfo::lateral_relids, root, and set_namedtuplestore_size_estimates().
Referenced by set_rel_size().
|
static |
Definition at line 822 of file allpaths.c.
References add_path(), RelOptInfo::consider_parallel, create_index_paths(), create_plain_partial_paths(), create_seqscan_path(), create_tidscan_paths(), RelOptInfo::lateral_relids, and root.
Referenced by set_rel_pathlist().
|
static |
Definition at line 626 of file allpaths.c.
References check_index_predicates(), root, and set_baserel_size_estimates().
Referenced by set_rel_size().
|
static |
Definition at line 643 of file allpaths.c.
References TableSampleClause::args, Assert(), RelOptInfo::baserestrictinfo, castNode, RelOptInfo::consider_parallel, PathTarget::exprs, func_parallel(), RangeTblEntry::functions, get_rel_persistence(), is_parallel_safe(), IS_SIMPLE_REL, limit_needed(), RelOptInfo::reltarget, root, RTE_CTE, RTE_FUNCTION, RTE_GROUP, RTE_JOIN, RTE_NAMEDTUPLESTORE, RTE_RELATION, RTE_RESULT, RTE_SUBQUERY, RTE_TABLEFUNC, RTE_VALUES, RangeTblEntry::rtekind, RangeTblEntry::subquery, RangeTblEntry::tablesample, TableSampleClause::tsmhandler, and RangeTblEntry::values_lists.
Referenced by set_append_rel_size(), and set_base_rel_sizes().
|
static |
Definition at line 514 of file allpaths.c.
References bms_equal(), elog, ERROR, generate_useful_gather_paths(), RangeTblEntry::inh, IS_DUMMY_REL, pprint(), RelOptInfo::relids, RELOPT_BASEREL, RelOptInfo::reloptkind, root, RTE_CTE, RTE_FUNCTION, RTE_NAMEDTUPLESTORE, RTE_RELATION, RTE_RESULT, RTE_SUBQUERY, RTE_TABLEFUNC, RTE_VALUES, RelOptInfo::rtekind, set_append_rel_pathlist(), set_cheapest(), set_foreign_pathlist(), set_function_pathlist(), set_grouped_rel_pathlist(), set_plain_rel_pathlist(), set_rel_pathlist_hook, set_tablefunc_pathlist(), set_tablesample_rel_pathlist(), set_values_pathlist(), and RangeTblEntry::tablesample.
Referenced by set_append_rel_pathlist(), and set_base_rel_pathlists().
|
static |
Definition at line 405 of file allpaths.c.
References Assert(), elog, ERROR, RangeTblEntry::inh, IS_DUMMY_REL, relation_excluded_by_constraints(), RELOPT_BASEREL, RelOptInfo::reloptkind, root, RelOptInfo::rows, RTE_CTE, RTE_FUNCTION, RTE_NAMEDTUPLESTORE, RTE_RELATION, RTE_RESULT, RTE_SUBQUERY, RTE_TABLEFUNC, RTE_VALUES, RelOptInfo::rtekind, set_append_rel_size(), set_cte_pathlist(), set_dummy_rel_pathlist(), set_foreign_size(), set_function_size_estimates(), set_namedtuplestore_pathlist(), set_plain_rel_size(), set_result_pathlist(), set_subquery_pathlist(), set_tablefunc_size_estimates(), set_tablesample_rel_size(), set_values_size_estimates(), set_worktable_pathlist(), and RangeTblEntry::tablesample.
Referenced by set_append_rel_size(), and set_base_rel_sizes().
|
static |
Definition at line 3089 of file allpaths.c.
References add_path(), create_resultscan_path(), RelOptInfo::lateral_relids, root, and set_result_size_estimates().
Referenced by set_rel_size().
|
static |
Definition at line 2603 of file allpaths.c.
References add_partial_path(), add_path(), Assert(), RelOptInfo::baserestrictinfo, bms_is_empty, bms_membership(), BMS_MULTIPLE, check_and_push_window_quals(), choose_plan_name(), RestrictInfo::clause, RelOptInfo::consider_parallel, convert_subquery_pathkeys(), copyObject, create_subqueryscan_path(), PathTarget::exprs, fetch_upper_rel(), foreach_current_index, if(), IS_DUMMY_REL, IsA, lappend(), RelOptInfo::lateral_relids, lfirst, list_length(), make_tlist_from_pathtarget(), NIL, palloc0(), parse(), RelOptInfo::partial_pathlist, RelOptInfo::pathlist, pfree(), PUSHDOWN_SAFE, PUSHDOWN_UNSAFE, PUSHDOWN_WINDOWCLAUSE_RUNCOND, qual_is_pushdown_safe(), RelOptInfo::reltarget, remove_unused_subquery_outputs(), root, set_dummy_rel_pathlist(), set_subquery_size_estimates(), subpath(), RelOptInfo::subplan_params, RangeTblEntry::subquery, subquery_is_pushdown_safe(), subquery_planner(), subquery_push_qual(), RelOptInfo::subroot, Query::targetList, pushdown_safety_info::unsafeFlags, pushdown_safety_info::unsafeLeaky, UPPERREL_FINAL, Var::varattno, and Var::varno.
Referenced by set_rel_size().
|
static |
Definition at line 2959 of file allpaths.c.
References add_path(), create_tablefuncscan_path(), RelOptInfo::lateral_relids, and root.
Referenced by set_rel_pathlist().
|
static |
Definition at line 920 of file allpaths.c.
References add_path(), bms_membership(), BMS_SINGLETON, create_material_path(), create_samplescan_path(), GetTsmRoutine(), RelOptInfo::lateral_relids, TsmRoutine::repeatable_across_scans, root, RangeTblEntry::tablesample, and TableSampleClause::tsmhandler.
Referenced by set_rel_pathlist().
|
static |
Definition at line 880 of file allpaths.c.
References TableSampleClause::args, check_index_predicates(), GetTsmRoutine(), RelOptInfo::pages, root, TsmRoutine::SampleScanGetSampleSize, set_baserel_size_estimates(), RangeTblEntry::tablesample, TableSampleClause::tsmhandler, and RelOptInfo::tuples.
Referenced by set_rel_size().
|
static |
Definition at line 2939 of file allpaths.c.
References add_path(), create_valuesscan_path(), RelOptInfo::lateral_relids, and root.
Referenced by set_rel_pathlist().
|
static |
Definition at line 3116 of file allpaths.c.
References add_path(), create_worktablescan_path(), RangeTblEntry::ctelevelsup, RangeTblEntry::ctename, elog, ERROR, RelOptInfo::lateral_relids, PlannerInfo::non_recursive_path, root, Path::rows, and set_cte_size_estimates().
Referenced by set_rel_size().
|
static |
Definition at line 344 of file allpaths.c.
References Assert(), build_simple_grouped_rel(), IS_SIMPLE_REL, NIL, RelOptInfo::relid, and root.
Referenced by make_one_rel().
RelOptInfo * standard_join_search | ( | PlannerInfo * | root, |
int | levels_needed, | ||
List * | initial_rels | ||
) |
Definition at line 3872 of file allpaths.c.
References Assert(), bms_equal(), elog, ERROR, generate_grouped_paths(), generate_partitionwise_join_paths(), generate_useful_gather_paths(), RelOptInfo::grouped_rel, IS_GROUPED_REL, join_search_one_level(), lfirst, linitial, list_length(), NIL, palloc0(), pprint(), RelOptInfo::relids, root, and set_cheapest().
Referenced by make_rel_from_joinlist().
|
static |
Definition at line 4067 of file allpaths.c.
References Assert(), castNode, check_output_expressions(), compare_tlist_datatypes(), Query::distinctClause, Query::groupClause, Query::groupingSets, Query::limitCount, Query::limitOffset, recurse_pushdown_safe(), Query::setOperations, Query::targetList, and pushdown_safety_info::unsafeVolatile.
Referenced by recurse_pushdown_safe(), and set_subquery_pathlist().
|
static |
Definition at line 4441 of file allpaths.c.
References Query::groupClause, Query::groupingSets, Query::havingQual, Query::jointree, make_and_qual(), FromExpr::quals, recurse_push_qual(), REPLACEVARS_REPORT_ERROR, ReplaceVarsFromTargetList(), Query::setOperations, and Query::targetList.
Referenced by recurse_push_qual(), and set_subquery_pathlist().
|
static |
Definition at line 4297 of file allpaths.c.
References InvalidOid, lfirst, WindowClause::partitionClause, targetIsInSortList(), and Query::windowClause.
Referenced by check_output_expressions().
bool enable_eager_aggregate = true |
Definition at line 82 of file allpaths.c.
Referenced by setup_eager_aggregation().
bool enable_geqo = false |
Definition at line 81 of file allpaths.c.
Referenced by make_rel_from_joinlist().
int geqo_threshold |
Definition at line 83 of file allpaths.c.
Referenced by make_rel_from_joinlist().
join_search_hook_type join_search_hook = NULL |
Definition at line 92 of file allpaths.c.
Referenced by make_rel_from_joinlist().
double min_eager_agg_group_size |
Definition at line 84 of file allpaths.c.
Referenced by create_rel_agg_info().
int min_parallel_index_scan_size |
Definition at line 86 of file allpaths.c.
Referenced by compute_parallel_worker(), and parallel_vacuum_compute_workers().
int min_parallel_table_scan_size |
Definition at line 85 of file allpaths.c.
Referenced by compute_parallel_worker().
set_rel_pathlist_hook_type set_rel_pathlist_hook = NULL |
Definition at line 89 of file allpaths.c.
Referenced by set_rel_pathlist().