PostgreSQL Source Code
git master
|
#include "nodes/pathnodes.h"
Go to the source code of this file.
Typedefs | |
typedef void(* | set_rel_pathlist_hook_type) (PlannerInfo *root, RelOptInfo *rel, Index rti, RangeTblEntry *rte) |
typedef void(* | set_join_pathlist_hook_type) (PlannerInfo *root, RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel, JoinType jointype, JoinPathExtraData *extra) |
typedef RelOptInfo *(* | join_search_hook_type) (PlannerInfo *root, int levels_needed, List *initial_rels) |
typedef bool(* | ec_matches_callback_type) (PlannerInfo *root, RelOptInfo *rel, EquivalenceClass *ec, EquivalenceMember *em, void *arg) |
Enumerations | |
enum | PathKeysComparison { PATHKEYS_EQUAL, PATHKEYS_BETTER1, PATHKEYS_BETTER2, PATHKEYS_DIFFERENT } |
typedef bool(* ec_matches_callback_type) (PlannerInfo *root, RelOptInfo *rel, EquivalenceClass *ec, EquivalenceMember *em, void *arg) |
typedef RelOptInfo*(* join_search_hook_type) (PlannerInfo *root, int levels_needed, List *initial_rels) |
typedef void(* set_join_pathlist_hook_type) (PlannerInfo *root, RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel, JoinType jointype, JoinPathExtraData *extra) |
typedef void(* set_rel_pathlist_hook_type) (PlannerInfo *root, RelOptInfo *rel, Index rti, RangeTblEntry *rte) |
enum PathKeysComparison |
Enumerator | |
---|---|
PATHKEYS_EQUAL | |
PATHKEYS_BETTER1 | |
PATHKEYS_BETTER2 | |
PATHKEYS_DIFFERENT |
void add_child_join_rel_equivalences | ( | PlannerInfo * | root, |
int | nappinfos, | ||
AppendRelInfo ** | appinfos, | ||
RelOptInfo * | parent_rel, | ||
RelOptInfo * | child_rel | ||
) |
Definition at line 2519 of file equivclass.c.
References add_eq_member(), adjust_appendrel_attrs(), adjust_appendrel_attrs_multilevel(), adjust_child_relids_multilevel(), Assert, bms_add_members(), bms_difference(), bms_membership(), BMS_MULTIPLE, bms_next_member(), bms_overlap(), EquivalenceClass::ec_has_volatile, EquivalenceClass::ec_members, EquivalenceClass::ec_relids, EquivalenceMember::em_datatype, EquivalenceMember::em_expr, EquivalenceMember::em_is_child, EquivalenceMember::em_is_const, EquivalenceMember::em_nullable_relids, EquivalenceMember::em_relids, PlannerInfo::eq_classes, get_eclass_indexes_for_relids(), i, IS_JOIN_REL, list_length(), list_nth(), MemoryContextSwitchTo(), PlannerInfo::planner_cxt, RelOptInfo::relids, RELOPT_JOINREL, RELOPT_OTHER_JOINREL, RelOptInfo::reloptkind, and RelOptInfo::top_parent_relids.
Referenced by build_child_join_rel().
void add_child_rel_equivalences | ( | PlannerInfo * | root, |
AppendRelInfo * | appinfo, | ||
RelOptInfo * | parent_rel, | ||
RelOptInfo * | child_rel | ||
) |
Definition at line 2391 of file equivclass.c.
References add_eq_member(), adjust_appendrel_attrs(), adjust_appendrel_attrs_multilevel(), Assert, bms_add_member(), bms_add_members(), bms_difference(), bms_is_subset(), bms_next_member(), bms_overlap(), EquivalenceClass::ec_has_volatile, EquivalenceClass::ec_members, PlannerInfo::ec_merging_done, EquivalenceClass::ec_relids, RelOptInfo::eclass_indexes, EquivalenceMember::em_datatype, EquivalenceMember::em_expr, EquivalenceMember::em_is_child, EquivalenceMember::em_is_const, EquivalenceMember::em_nullable_relids, EquivalenceMember::em_relids, PlannerInfo::eq_classes, i, IS_SIMPLE_REL, list_length(), list_nth(), RelOptInfo::relids, RELOPT_BASEREL, RelOptInfo::reloptkind, and RelOptInfo::top_parent_relids.
Referenced by set_append_rel_size().
void add_paths_to_append_rel | ( | PlannerInfo * | root, |
RelOptInfo * | rel, | ||
List * | live_childrels | ||
) |
Definition at line 1289 of file allpaths.c.
References accumulate_append_subpath(), add_partial_path(), add_path(), Assert, bms_equal(), bms_make_singleton(), RelOptInfo::cheapest_total_path, compare_pathkeys(), RelOptInfo::consider_parallel, create_append_path(), enable_parallel_append, fls(), for_each_from, generate_orderedappend_paths(), 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, Path::param_info, RelOptInfo::part_scheme, RelOptInfo::partial_pathlist, AppendPath::path, PATH_REQ_OUTER, Path::pathkeys, PATHKEYS_EQUAL, RelOptInfo::pathlist, RelOptInfo::relid, RELOPT_JOINREL, RelOptInfo::reloptkind, Path::rows, RTE_SUBQUERY, RelOptInfo::rtekind, 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().
void add_paths_to_joinrel | ( | PlannerInfo * | root, |
RelOptInfo * | joinrel, | ||
RelOptInfo * | outerrel, | ||
RelOptInfo * | innerrel, | ||
JoinType | jointype, | ||
SpecialJoinInfo * | sjinfo, | ||
List * | restrictlist | ||
) |
Definition at line 117 of file joinpath.c.
References PlannerInfo::all_baserels, bms_add_members(), bms_difference(), bms_is_subset(), bms_join(), bms_overlap(), compute_semi_anti_join_factors(), enable_hashjoin, enable_mergejoin, RelOptInfo::fdwroutine, FdwRoutine::GetForeignJoinPaths, hash_inner_and_outer(), JoinPathExtraData::inner_unique, innerrel_is_unique(), JOIN_ANTI, JOIN_FULL, PlannerInfo::join_info_list, JOIN_INNER, JOIN_SEMI, JOIN_UNIQUE_INNER, JOIN_UNIQUE_OUTER, SpecialJoinInfo::jointype, RelOptInfo::lateral_relids, lfirst, match_unsorted_outer(), JoinPathExtraData::mergeclause_list, SpecialJoinInfo::min_lefthand, SpecialJoinInfo::min_righthand, NIL, JoinPathExtraData::param_source_rels, RelOptInfo::relids, RELOPT_OTHER_JOINREL, RelOptInfo::reloptkind, JoinPathExtraData::restrictlist, select_mergejoin_clauses(), JoinPathExtraData::semifactors, set_join_pathlist_hook, JoinPathExtraData::sjinfo, sort_inner_and_outer(), and RelOptInfo::top_parent_relids.
Referenced by populate_joinrel_with_paths().
List* build_expression_pathkey | ( | PlannerInfo * | root, |
Expr * | expr, | ||
Relids | nullable_relids, | ||
Oid | opno, | ||
Relids | rel, | ||
bool | create_it | ||
) |
Definition at line 782 of file pathkeys.c.
References BTGreaterStrategyNumber, elog, ERROR, exprCollation(), get_ordering_op_properties(), list_make1, make_pathkey_from_sortinfo(), and NIL.
Referenced by set_function_pathlist().
List* build_index_pathkeys | ( | PlannerInfo * | root, |
IndexOptInfo * | index, | ||
ScanDirection | scandir | ||
) |
Definition at line 523 of file pathkeys.c.
References TargetEntry::expr, i, indexcol_is_bool_constant_for_query(), IndexOptInfo::indexcollations, IndexOptInfo::indextlist, lappend(), lfirst, make_pathkey_from_sortinfo(), NIL, IndexOptInfo::nkeycolumns, IndexOptInfo::nulls_first, IndexOptInfo::opcintype, pathkey_is_redundant(), IndexOptInfo::rel, RelOptInfo::relids, IndexOptInfo::reverse_sort, ScanDirectionIsBackward, and IndexOptInfo::sortopfamily.
Referenced by build_index_paths().
List* build_join_pathkeys | ( | PlannerInfo * | root, |
RelOptInfo * | joinrel, | ||
JoinType | jointype, | ||
List * | outer_pathkeys | ||
) |
Definition at line 1082 of file pathkeys.c.
References JOIN_FULL, JOIN_RIGHT, NIL, and truncate_useless_pathkeys().
Referenced by consider_parallel_mergejoin(), consider_parallel_nestloop(), match_unsorted_outer(), and sort_inner_and_outer().
List* build_partition_pathkeys | ( | PlannerInfo * | root, |
RelOptInfo * | partrel, | ||
ScanDirection | scandir, | ||
bool * | partialkeys | ||
) |
Definition at line 699 of file pathkeys.c.
References Assert, RelOptInfo::boundinfo, i, IS_SIMPLE_REL, lappend(), linitial, make_pathkey_from_sortinfo(), NIL, RelOptInfo::nparts, RelOptInfo::part_scheme, PartitionSchemeData::partcollation, RelOptInfo::partexprs, partitions_are_ordered(), partkey_is_bool_constant_for_query(), PartitionSchemeData::partnatts, PartitionSchemeData::partopcintype, PartitionSchemeData::partopfamily, pathkey_is_redundant(), RelOptInfo::relids, and ScanDirectionIsBackward.
Referenced by generate_orderedappend_paths().
Definition at line 498 of file equivclass.c.
References applyRelabelType(), COERCE_IMPLICIT_CAST, exprCollation(), exprType(), and exprTypmod().
Referenced by convert_subquery_pathkeys(), get_eclass_for_sort_expr(), and process_equivalence().
void check_index_predicates | ( | PlannerInfo * | root, |
RelOptInfo * | rel | ||
) |
Definition at line 3308 of file indxpath.c.
References PlannerInfo::all_baserels, Assert, RelOptInfo::baserestrictinfo, bms_difference(), bms_is_empty(), bms_union(), RestrictInfo::clause, contain_mutable_functions(), find_childrel_parents(), generate_join_implied_equalities(), get_plan_rowmark(), RelOptInfo::indexlist, IndexOptInfo::indpred, IndexOptInfo::indrestrictinfo, IS_SIMPLE_REL, join_clause_is_movable_to(), RelOptInfo::joininfo, lappend(), lfirst, list_concat(), list_copy(), list_make1, NIL, PlannerInfo::parse, predicate_implied_by(), IndexOptInfo::predOK, RelOptInfo::relid, RelOptInfo::relids, RELOPT_OTHER_MEMBER_REL, RelOptInfo::reloptkind, Query::resultRelation, and PlannerInfo::rowMarks.
Referenced by set_plain_rel_size(), and set_tablesample_rel_size().
PathKeysComparison compare_pathkeys | ( | List * | keys1, |
List * | keys2 | ||
) |
Definition at line 285 of file pathkeys.c.
References forboth, lfirst, PATHKEYS_BETTER1, PATHKEYS_BETTER2, PATHKEYS_DIFFERENT, and PATHKEYS_EQUAL.
Referenced by add_partial_path(), add_partial_path_precheck(), add_path(), add_path_precheck(), add_paths_to_append_rel(), pathkeys_contained_in(), and set_cheapest().
int compute_parallel_worker | ( | RelOptInfo * | rel, |
double | heap_pages, | ||
double | index_pages, | ||
int | max_workers | ||
) |
Definition at line 3884 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().
List* convert_subquery_pathkeys | ( | PlannerInfo * | root, |
RelOptInfo * | rel, | ||
List * | subquery_pathkeys, | ||
List * | subquery_tlist | ||
) |
Definition at line 838 of file pathkeys.c.
References Assert, canonicalize_ec_expression(), EquivalenceClass::ec_collation, EquivalenceClass::ec_has_volatile, EquivalenceClass::ec_members, EquivalenceClass::ec_opfamilies, EquivalenceClass::ec_sortref, elog, EquivalenceMember::em_datatype, EquivalenceMember::em_expr, EquivalenceMember::em_is_child, equal(), ERROR, TargetEntry::expr, find_var_for_subquery_tle(), get_eclass_for_sort_expr(), get_sortgroupref_tle(), i, lappend(), lfirst, linitial, list_length(), list_nth(), make_canonical_pathkey(), NIL, pathkey_is_redundant(), PathKey::pk_eclass, PathKey::pk_nulls_first, PathKey::pk_opfamily, PathKey::pk_strategy, PlannerInfo::query_pathkeys, and RelOptInfo::relids.
Referenced by set_subquery_pathlist().
void create_index_paths | ( | PlannerInfo * | root, |
RelOptInfo * | rel | ||
) |
Definition at line 231 of file indxpath.c.
References add_path(), Assert, RelOptInfo::baserestrictinfo, bms_equal_any(), bms_is_subset(), choose_bitmap_and(), consider_index_join_clauses(), RelOptInfo::consider_parallel, create_bitmap_heap_path(), create_partial_bitmap_paths(), generate_bitmap_or_paths(), get_index_paths(), get_loop_count(), INDEX_MAX_KEYS, RelOptInfo::indexlist, IndexOptInfo::indpred, lappend(), RelOptInfo::lateral_relids, lfirst, list_concat(), match_eclass_clauses_to_index(), match_join_clauses_to_index(), match_restriction_clauses_to_index(), MemSet, NIL, IndexOptInfo::nkeycolumns, IndexClauseSet::nonempty, PATH_REQ_OUTER, IndexOptInfo::predOK, and RelOptInfo::relid.
Referenced by set_plain_rel_pathlist().
void create_partial_bitmap_paths | ( | PlannerInfo * | root, |
RelOptInfo * | rel, | ||
Path * | bitmapqual | ||
) |
Definition at line 3848 of file allpaths.c.
References add_partial_path(), compute_bitmap_pages(), compute_parallel_worker(), create_bitmap_heap_path(), RelOptInfo::lateral_relids, and max_parallel_workers_per_gather.
Referenced by create_index_paths().
void create_tidscan_paths | ( | PlannerInfo * | root, |
RelOptInfo * | rel | ||
) |
Definition at line 385 of file tidpath.c.
References add_path(), RelOptInfo::baserestrictinfo, BuildParameterizedTidPaths(), create_tidscan_path(), ec_member_matches_ctid(), generate_implied_equalities_for_column(), RelOptInfo::has_eclass_joins, RelOptInfo::joininfo, RelOptInfo::lateral_referencers, RelOptInfo::lateral_relids, and TidQualFromRestrictInfoList().
Referenced by set_plain_rel_pathlist().
bool eclass_useful_for_merging | ( | PlannerInfo * | root, |
EquivalenceClass * | eclass, | ||
RelOptInfo * | rel | ||
) |
Definition at line 2914 of file equivclass.c.
References Assert, bms_is_empty(), bms_is_subset(), bms_overlap(), EquivalenceClass::ec_has_const, EquivalenceClass::ec_members, EquivalenceClass::ec_merged, EquivalenceClass::ec_relids, EquivalenceMember::em_is_child, EquivalenceMember::em_relids, IS_OTHER_REL, lfirst, list_length(), RelOptInfo::relids, and RelOptInfo::top_parent_relids.
Referenced by get_useful_ecs_for_relation(), and pathkeys_useful_for_merging().
bool exprs_known_equal | ( | PlannerInfo * | root, |
Node * | item1, | ||
Node * | item2 | ||
) |
Definition at line 2209 of file equivclass.c.
References EquivalenceClass::ec_has_volatile, EquivalenceClass::ec_members, EquivalenceMember::em_expr, EquivalenceMember::em_is_child, PlannerInfo::eq_classes, equal(), and lfirst.
Referenced by add_unique_group_var().
RestrictInfo* find_derived_clause_for_ec_member | ( | EquivalenceClass * | ec, |
EquivalenceMember * | em | ||
) |
Definition at line 2351 of file equivclass.c.
References Assert, EquivalenceClass::ec_derives, EquivalenceClass::ec_has_const, EquivalenceMember::em_is_const, RestrictInfo::left_em, and lfirst.
Referenced by get_foreign_key_join_selectivity().
Expr* find_em_expr_for_rel | ( | EquivalenceClass * | ec, |
RelOptInfo * | rel | ||
) |
Definition at line 776 of file equivclass.c.
References bms_is_empty(), bms_is_subset(), EquivalenceClass::ec_members, EquivalenceMember::em_expr, EquivalenceMember::em_relids, lfirst, and RelOptInfo::relids.
Expr* find_em_expr_usable_for_sorting_rel | ( | PlannerInfo * | root, |
EquivalenceClass * | ec, | ||
RelOptInfo * | rel, | ||
bool | require_parallel_safe | ||
) |
Definition at line 808 of file equivclass.c.
References bms_is_subset(), EquivalenceClass::ec_has_volatile, EquivalenceClass::ec_members, EquivalenceMember::em_expr, EquivalenceMember::em_is_const, EquivalenceMember::em_relids, is_parallel_safe(), IS_SRF_CALL, lfirst, and RelOptInfo::relids.
Referenced by get_useful_pathkeys_for_relation().
List* find_mergeclauses_for_outer_pathkeys | ( | PlannerInfo * | root, |
List * | pathkeys, | ||
List * | restrictinfos | ||
) |
Definition at line 1262 of file pathkeys.c.
References i, lappend(), RestrictInfo::left_ec, lfirst, list_concat(), NIL, RestrictInfo::outer_is_left, PathKey::pk_eclass, RestrictInfo::right_ec, and update_mergeclause_eclasses().
Referenced by generate_mergejoin_paths(), and sort_inner_and_outer().
void generate_base_implied_equalities | ( | PlannerInfo * | root | ) |
Definition at line 915 of file equivclass.c.
References Assert, bms_add_member(), bms_membership(), BMS_MULTIPLE, bms_next_member(), EquivalenceClass::ec_broken, EquivalenceClass::ec_has_const, EquivalenceClass::ec_members, EquivalenceClass::ec_merged, PlannerInfo::ec_merging_done, EquivalenceClass::ec_relids, RelOptInfo::eclass_indexes, PlannerInfo::eq_classes, generate_base_implied_equalities_broken(), generate_base_implied_equalities_const(), generate_base_implied_equalities_no_const(), RelOptInfo::has_eclass_joins, i, lfirst, list_length(), RELOPT_BASEREL, RelOptInfo::reloptkind, and PlannerInfo::simple_rel_array.
Referenced by query_planner().
void generate_gather_paths | ( | PlannerInfo * | root, |
RelOptInfo * | rel, | ||
bool | override_rows | ||
) |
Definition at line 2745 of file allpaths.c.
References add_path(), create_gather_merge_path(), create_gather_path(), lfirst, linitial, NIL, Path::parallel_workers, RelOptInfo::partial_pathlist, GatherMergePath::path, Path::pathkeys, RelOptInfo::reltarget, Path::rows, and subpath().
Referenced by generate_useful_gather_paths().
List* generate_implied_equalities_for_column | ( | PlannerInfo * | root, |
RelOptInfo * | rel, | ||
ec_matches_callback_type | callback, | ||
void * | callback_arg, | ||
Relids | prohibited_rels | ||
) |
Definition at line 2673 of file equivclass.c.
References Assert, bms_equal(), bms_is_subset(), bms_next_member(), bms_overlap(), callback(), create_join_clause(), EquivalenceClass::ec_has_const, EquivalenceClass::ec_members, PlannerInfo::ec_merging_done, EquivalenceClass::ec_relids, RelOptInfo::eclass_indexes, EquivalenceMember::em_datatype, EquivalenceMember::em_is_child, EquivalenceMember::em_relids, PlannerInfo::eq_classes, find_childrel_parents(), i, IS_SIMPLE_REL, lappend(), lfirst, list_length(), list_nth(), NIL, OidIsValid, RelOptInfo::relids, RELOPT_OTHER_MEMBER_REL, RelOptInfo::reloptkind, and select_equality_operator().
Referenced by create_tidscan_paths(), match_eclass_clauses_to_index(), and postgresGetForeignPaths().
List* generate_join_implied_equalities | ( | PlannerInfo * | root, |
Relids | join_relids, | ||
Relids | outer_relids, | ||
RelOptInfo * | inner_rel | ||
) |
Definition at line 1248 of file equivclass.c.
References Assert, bms_is_empty(), bms_next_member(), bms_overlap(), bms_union(), EquivalenceClass::ec_broken, EquivalenceClass::ec_has_const, EquivalenceClass::ec_members, EquivalenceClass::ec_relids, PlannerInfo::eq_classes, generate_join_implied_equalities_broken(), generate_join_implied_equalities_normal(), get_common_eclass_indexes(), i, IS_OTHER_REL, list_concat(), list_length(), list_nth(), NIL, RelOptInfo::relids, and RelOptInfo::top_parent_relids.
Referenced by build_joinrel_restrictlist(), check_index_predicates(), get_baserel_parampathinfo(), get_joinrel_parampathinfo(), and reduce_unique_semijoins().
List* generate_join_implied_equalities_for_ecs | ( | PlannerInfo * | root, |
List * | eclasses, | ||
Relids | join_relids, | ||
Relids | outer_relids, | ||
RelOptInfo * | inner_rel | ||
) |
Definition at line 1326 of file equivclass.c.
References Assert, bms_is_empty(), bms_overlap(), bms_union(), EquivalenceClass::ec_broken, EquivalenceClass::ec_has_const, EquivalenceClass::ec_members, EquivalenceClass::ec_relids, generate_join_implied_equalities_broken(), generate_join_implied_equalities_normal(), IS_OTHER_REL, lfirst, list_concat(), list_length(), NIL, RelOptInfo::relids, and RelOptInfo::top_parent_relids.
Referenced by get_joinrel_parampathinfo().
void generate_partitionwise_join_paths | ( | PlannerInfo * | root, |
RelOptInfo * | rel | ||
) |
Definition at line 3972 of file allpaths.c.
References add_paths_to_append_rel(), Alias::aliasname, Assert, RelOptInfo::baserestrictinfo, bms_next_member(), RelOptInfo::cheapest_parameterized_paths, RelOptInfo::cheapest_startup_path, RelOptInfo::cheapest_total_path, check_stack_depth(), RestrictInfo::clause, RelOptInfo::consider_partitionwise_join, RangeTblEntry::eref, generate_partitionwise_join_paths(), i, JoinPath::innerjoinpath, MergePath::innersortkeys, IS_DUMMY_REL, IS_JOIN_REL, IS_PARTITIONED_REL, IsA, RelOptInfo::joininfo, JoinPath::joinrestrictinfo, lappend(), lfirst, list_free(), lnext(), mark_dummy_rel(), MergePath::materialize_inner, NIL, nodeTag, RelOptInfo::nparts, JoinPath::outerjoinpath, MergePath::outersortkeys, Path::param_info, Path::parent, PlannerInfo::parse, RelOptInfo::part_rels, Path::pathkeys, RelOptInfo::pathlist, Path::pathtype, ParamPathInfo::ppi_req_outer, print_expr(), print_pathkeys(), printf, RelOptInfo::relids, RelOptInfo::reltarget, RelOptInfo::rows, Path::rows, Query::rtable, set_cheapest(), PlannerInfo::simple_rte_array, Path::startup_cost, generate_unaccent_rules::stdout, subpath(), T_AggPath, T_AppendPath, T_BitmapAndPath, T_BitmapHeapPath, T_BitmapOrPath, T_CteScan, T_CustomPath, T_ForeignPath, T_FunctionScan, T_GatherMergePath, T_GatherPath, T_GroupingSetsPath, T_GroupPath, T_GroupResultPath, T_HashPath, T_IncrementalSortPath, T_IndexPath, T_LimitPath, T_LockRowsPath, T_MaterialPath, T_MergeAppendPath, T_MergePath, T_MinMaxAggPath, T_ModifyTablePath, T_NamedTuplestoreScan, T_NestPath, T_Path, T_ProjectionPath, T_ProjectSetPath, T_RecursiveUnionPath, T_Result, T_SampleScan, T_SeqScan, T_SetOpPath, T_SortPath, T_SubqueryScanPath, T_TableFuncScan, T_TidPath, T_UniquePath, T_UpperUniquePath, T_ValuesScan, T_WindowAggPath, T_WorkTableScan, Path::total_cost, and PathTarget::width.
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 2884 of file allpaths.c.
References add_path(), Assert, create_gather_merge_path(), create_incremental_sort_path(), create_sort_path(), enable_incremental_sort, generate_gather_paths(), get_useful_pathkeys_for_relation(), lfirst, linitial, list_length(), NIL, Path::parallel_workers, RelOptInfo::partial_pathlist, GatherMergePath::path, Path::pathkeys, pathkeys_count_contained_in(), RelOptInfo::reltarget, Path::rows, and subpath().
Referenced by apply_scanjoin_target_to_paths(), gather_grouping_paths(), merge_clump(), set_rel_pathlist(), and standard_join_search().
Path* get_cheapest_fractional_path_for_pathkeys | ( | List * | paths, |
List * | pathkeys, | ||
Relids | required_outer, | ||
double | fraction | ||
) |
Definition at line 449 of file pathkeys.c.
References bms_is_subset(), compare_fractional_path_costs(), lfirst, PATH_REQ_OUTER, Path::pathkeys, and pathkeys_contained_in().
Referenced by build_minmax_path().
Definition at line 482 of file pathkeys.c.
References bms_is_empty(), lfirst, Path::parallel_safe, and PATH_REQ_OUTER.
Referenced by add_paths_to_append_rel(), hash_inner_and_outer(), match_unsorted_outer(), and sort_inner_and_outer().
Path* get_cheapest_path_for_pathkeys | ( | List * | paths, |
List * | pathkeys, | ||
Relids | required_outer, | ||
CostSelector | cost_criterion, | ||
bool | require_parallel_safe | ||
) |
Definition at line 404 of file pathkeys.c.
References bms_is_subset(), compare_path_costs(), lfirst, Path::parallel_safe, PATH_REQ_OUTER, Path::pathkeys, and pathkeys_contained_in().
Referenced by generate_mergejoin_paths(), generate_orderedappend_paths(), and get_cheapest_parameterized_child_path().
EquivalenceClass* get_eclass_for_sort_expr | ( | PlannerInfo * | root, |
Expr * | expr, | ||
Relids | nullable_relids, | ||
List * | opfamilies, | ||
Oid | opcintype, | ||
Oid | collation, | ||
Index | sortref, | ||
Relids | rel, | ||
bool | create_it | ||
) |
Definition at line 619 of file equivclass.c.
References add_eq_member(), Assert, bms_add_member(), bms_equal(), bms_intersect(), bms_next_member(), canonicalize_ec_expression(), contain_agg_clause(), contain_volatile_functions(), contain_window_function(), copyObject, EquivalenceClass::ec_below_outer_join, EquivalenceClass::ec_broken, EquivalenceClass::ec_collation, EquivalenceClass::ec_derives, EquivalenceClass::ec_has_const, EquivalenceClass::ec_has_volatile, EquivalenceClass::ec_max_security, EquivalenceClass::ec_members, EquivalenceClass::ec_merged, PlannerInfo::ec_merging_done, EquivalenceClass::ec_min_security, EquivalenceClass::ec_opfamilies, EquivalenceClass::ec_relids, EquivalenceClass::ec_sortref, EquivalenceClass::ec_sources, RelOptInfo::eclass_indexes, elog, EquivalenceMember::em_datatype, EquivalenceMember::em_expr, EquivalenceMember::em_is_child, EquivalenceMember::em_is_const, EquivalenceMember::em_relids, PlannerInfo::eq_classes, equal(), ERROR, expression_returns_set(), i, lappend(), lfirst, list_copy(), list_length(), makeNode, MemoryContextSwitchTo(), NIL, PlannerInfo::planner_cxt, pull_varnos(), RELOPT_BASEREL, RELOPT_DEADREL, RelOptInfo::reloptkind, and PlannerInfo::simple_rel_array.
Referenced by convert_subquery_pathkeys(), initialize_mergeclause_eclasses(), and make_pathkey_from_sortinfo().
bool has_relevant_eclass_joinclause | ( | PlannerInfo * | root, |
RelOptInfo * | rel1 | ||
) |
Definition at line 2870 of file equivclass.c.
References bms_is_subset(), bms_next_member(), EquivalenceClass::ec_members, EquivalenceClass::ec_relids, PlannerInfo::eq_classes, get_eclass_indexes_for_relids(), i, list_length(), list_nth(), and RelOptInfo::relids.
Referenced by build_join_rel().
bool has_useful_pathkeys | ( | PlannerInfo * | root, |
RelOptInfo * | rel | ||
) |
Definition at line 1910 of file pathkeys.c.
References RelOptInfo::has_eclass_joins, RelOptInfo::joininfo, NIL, and PlannerInfo::query_pathkeys.
Referenced by build_child_join_rel(), build_index_paths(), and set_append_rel_size().
bool have_dangerous_phv | ( | PlannerInfo * | root, |
Relids | outer_relids, | ||
Relids | inner_params | ||
) |
Definition at line 1184 of file joinrels.c.
References bms_is_subset(), bms_overlap(), lfirst, PlaceHolderInfo::ph_eval_at, and PlannerInfo::placeholder_list.
Referenced by join_is_legal(), and try_nestloop_path().
bool have_join_order_restriction | ( | PlannerInfo * | root, |
RelOptInfo * | rel1, | ||
RelOptInfo * | rel2 | ||
) |
Definition at line 951 of file joinrels.c.
References bms_is_subset(), bms_overlap(), RelOptInfo::direct_lateral_relids, has_legal_joinclause(), JOIN_FULL, PlannerInfo::join_info_list, SpecialJoinInfo::jointype, lfirst, SpecialJoinInfo::min_lefthand, SpecialJoinInfo::min_righthand, PlaceHolderInfo::ph_eval_at, PlannerInfo::placeholder_list, and RelOptInfo::relids.
Referenced by desirable_join(), join_search_one_level(), and make_rels_by_clause_joins().
bool have_relevant_eclass_joinclause | ( | PlannerInfo * | root, |
RelOptInfo * | rel1, | ||
RelOptInfo * | rel2 | ||
) |
Definition at line 2803 of file equivclass.c.
References Assert, bms_next_member(), bms_overlap(), EquivalenceClass::ec_members, EquivalenceClass::ec_relids, PlannerInfo::eq_classes, get_common_eclass_indexes(), i, list_length(), list_nth(), and RelOptInfo::relids.
Referenced by have_relevant_joinclause().
bool indexcol_is_bool_constant_for_query | ( | IndexOptInfo * | index, |
int | indexcol | ||
) |
Definition at line 3670 of file indxpath.c.
References RelOptInfo::baserestrictinfo, lfirst, match_boolean_index_clause(), IndexOptInfo::opfamily, RestrictInfo::pseudoconstant, and IndexOptInfo::rel.
Referenced by build_index_pathkeys().
void initialize_mergeclause_eclasses | ( | PlannerInfo * | root, |
RestrictInfo * | restrictinfo | ||
) |
Definition at line 1179 of file pathkeys.c.
References Assert, RestrictInfo::clause, get_eclass_for_sort_expr(), get_leftop(), get_rightop(), RestrictInfo::left_ec, RestrictInfo::mergeopfamilies, NIL, RestrictInfo::nullable_relids, op_input_types(), and RestrictInfo::right_ec.
Referenced by distribute_qual_to_rels().
bool is_redundant_derived_clause | ( | RestrictInfo * | rinfo, |
List * | clauselist | ||
) |
Definition at line 2972 of file equivclass.c.
References lfirst, and RestrictInfo::parent_ec.
Referenced by create_tidscan_plan().
bool is_redundant_with_indexclauses | ( | RestrictInfo * | rinfo, |
List * | indexclauses | ||
) |
Definition at line 2999 of file equivclass.c.
References lfirst_node, IndexClause::lossy, RestrictInfo::parent_ec, and IndexClause::rinfo.
Referenced by create_indexscan_plan(), extract_nonindex_conditions(), and has_indexed_join_quals().
void join_search_one_level | ( | PlannerInfo * | root, |
int | level | ||
) |
Definition at line 71 of file joinrels.c.
References Assert, bms_overlap(), elog, ERROR, for_each_cell, RelOptInfo::has_eclass_joins, has_join_restriction(), PlannerInfo::hasLateralRTEs, have_join_order_restriction(), have_relevant_joinclause(), PlannerInfo::join_cur_level, PlannerInfo::join_info_list, PlannerInfo::join_rel_level, RelOptInfo::joininfo, lfirst, list_head(), lnext(), make_join_rel(), make_rels_by_clause_joins(), make_rels_by_clauseless_joins(), NIL, and RelOptInfo::relids.
Referenced by standard_join_search().
PathKey* make_canonical_pathkey | ( | PlannerInfo * | root, |
EquivalenceClass * | eclass, | ||
Oid | opfamily, | ||
int | strategy, | ||
bool | nulls_first | ||
) |
Definition at line 54 of file pathkeys.c.
References PlannerInfo::canon_pathkeys, EquivalenceClass::ec_merged, PlannerInfo::ec_merging_done, eclass(), elog, ERROR, lappend(), lfirst, makeNode, MemoryContextSwitchTo(), PathKey::pk_eclass, PathKey::pk_nulls_first, PathKey::pk_opfamily, PathKey::pk_strategy, and PlannerInfo::planner_cxt.
Referenced by convert_subquery_pathkeys(), get_useful_pathkeys_for_relation(), make_inner_pathkeys_for_merge(), make_pathkey_from_sortinfo(), and select_outer_pathkeys_for_merge().
List* make_inner_pathkeys_for_merge | ( | PlannerInfo * | root, |
List * | mergeclauses, | ||
List * | outer_pathkeys | ||
) |
Definition at line 1547 of file pathkeys.c.
References elog, ERROR, lappend(), RestrictInfo::left_ec, lfirst, list_head(), lnext(), make_canonical_pathkey(), NIL, RestrictInfo::outer_is_left, pathkey_is_redundant(), PathKey::pk_eclass, PathKey::pk_nulls_first, PathKey::pk_opfamily, PathKey::pk_strategy, RestrictInfo::right_ec, and update_mergeclause_eclasses().
Referenced by generate_mergejoin_paths(), and sort_inner_and_outer().