PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "miscadmin.h"
#include "optimizer/appendinfo.h"
#include "optimizer/joininfo.h"
#include "optimizer/pathnode.h"
#include "optimizer/paths.h"
#include "partitioning/partbounds.h"
#include "utils/memutils.h"
Go to the source code of this file.
Relids add_outer_joins_to_relids | ( | PlannerInfo * | root, |
Relids | input_relids, | ||
SpecialJoinInfo * | sjinfo, | ||
List ** | pushed_down_joins | ||
) |
Definition at line 783 of file joinrels.c.
References bms_add_member(), bms_add_members(), bms_copy(), bms_is_member(), bms_is_subset(), SpecialJoinInfo::commute_above_l, SpecialJoinInfo::commute_below_l, PlannerInfo::join_info_list, JOIN_LEFT, SpecialJoinInfo::jointype, lappend(), lfirst, SpecialJoinInfo::min_lefthand, SpecialJoinInfo::min_righthand, and SpecialJoinInfo::ojrelid.
Referenced by generate_join_implied_equalities(), and make_join_rel().
|
static |
Definition at line 1671 of file joinrels.c.
References adjust_appendrel_attrs(), adjust_child_relids(), find_appinfos_by_relids(), makeNode, SpecialJoinInfo::min_lefthand, SpecialJoinInfo::min_righthand, pfree(), SpecialJoinInfo::semi_rhs_exprs, SpecialJoinInfo::syn_lefthand, and SpecialJoinInfo::syn_righthand.
Referenced by try_partitionwise_join().
|
static |
Definition at line 1713 of file joinrels.c.
References Assert(), get_matching_part_pairs(), SpecialJoinInfo::jointype, list_length(), RelOptInfo::nparts, palloc0(), RelOptInfo::partbounds_merged, PartitionSchemeData::partcollation, partition_bounds_equal(), partition_bounds_merge(), PartitionSchemeData::partnatts, PartitionSchemeData::partsupfunc, PartitionSchemeData::parttypbyval, and PartitionSchemeData::parttyplen.
Referenced by try_partitionwise_join().
|
static |
Definition at line 1804 of file joinrels.c.
References RelOptInfo::all_partrels, Assert(), bms_intersect(), bms_num_members(), bms_singleton_member(), find_base_rel(), find_join_rel(), IS_SIMPLE_REL, lappend(), NIL, RelOptInfo::nparts, and RelOptInfo::relids.
Referenced by compute_partition_bounds().
|
static |
Definition at line 1166 of file joinrels.c.
References bms_equal(), bms_is_subset(), bms_overlap(), JOIN_FULL, PlannerInfo::join_info_list, SpecialJoinInfo::jointype, RelOptInfo::lateral_referencers, RelOptInfo::lateral_relids, lfirst, SpecialJoinInfo::min_lefthand, SpecialJoinInfo::min_righthand, PlaceHolderInfo::ph_eval_at, PlannerInfo::placeholder_list, and RelOptInfo::relids.
Referenced by join_search_one_level().
|
static |
Definition at line 1222 of file joinrels.c.
References bms_free(), bms_overlap(), bms_union(), have_relevant_joinclause(), join_is_legal(), lfirst, and RelOptInfo::relids.
Referenced by have_join_order_restriction().
bool have_dangerous_phv | ( | PlannerInfo * | root, |
Relids | outer_relids, | ||
Relids | inner_params | ||
) |
Definition at line 1286 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 1053 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 is_dummy_rel | ( | RelOptInfo * | rel | ) |
Definition at line 1314 of file joinrels.c.
References IS_DUMMY_APPEND, IsA, linitial, NIL, RelOptInfo::pathlist, and subpath().
Referenced by make_join_rel(), mark_dummy_rel(), and populate_joinrel_with_paths().
|
static |
Definition at line 348 of file joinrels.c.
References bms_add_members(), bms_copy(), bms_equal(), bms_is_subset(), bms_overlap(), RelOptInfo::cheapest_total_path, create_unique_path(), RelOptInfo::direct_lateral_relids, PlannerInfo::hasLateralRTEs, have_dangerous_phv(), JOIN_FULL, PlannerInfo::join_info_list, JOIN_LEFT, JOIN_SEMI, SpecialJoinInfo::jointype, RelOptInfo::lateral_relids, lfirst, SpecialJoinInfo::lhs_strict, min_join_parameterization(), SpecialJoinInfo::min_lefthand, SpecialJoinInfo::min_righthand, RelOptInfo::relids, and SpecialJoinInfo::syn_righthand.
Referenced by has_legal_joinclause(), and make_join_rel().
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_from, foreach_current_index, RelOptInfo::has_eclass_joins, has_join_restriction(), PlannerInfo::hasLateralRTEs, have_join_order_restriction(), have_relevant_joinclause(), PlannerInfo::join_cur_level, PlannerInfo::join_info_list, RelOptInfo::joininfo, lfirst, make_join_rel(), make_rels_by_clause_joins(), make_rels_by_clauseless_joins(), NIL, and RelOptInfo::relids.
Referenced by standard_join_search().
RelOptInfo* make_join_rel | ( | PlannerInfo * | root, |
RelOptInfo * | rel1, | ||
RelOptInfo * | rel2 | ||
) |
Definition at line 670 of file joinrels.c.
References add_outer_joins_to_relids(), Assert(), bms_free(), bms_overlap(), bms_union(), build_join_rel(), SpecialJoinInfo::commute_above_l, SpecialJoinInfo::commute_above_r, SpecialJoinInfo::commute_below_l, SpecialJoinInfo::commute_below_r, is_dummy_rel(), JOIN_INNER, join_is_legal(), SpecialJoinInfo::jointype, SpecialJoinInfo::lhs_strict, SpecialJoinInfo::min_lefthand, SpecialJoinInfo::min_righthand, NIL, SpecialJoinInfo::ojrelid, populate_joinrel_with_paths(), RelOptInfo::relids, SpecialJoinInfo::semi_can_btree, SpecialJoinInfo::semi_can_hash, SpecialJoinInfo::semi_operators, SpecialJoinInfo::semi_rhs_exprs, SpecialJoinInfo::syn_lefthand, and SpecialJoinInfo::syn_righthand.
Referenced by join_search_one_level(), make_rels_by_clause_joins(), make_rels_by_clauseless_joins(), and merge_clump().
|
static |
Definition at line 278 of file joinrels.c.
References bms_overlap(), for_each_from, have_join_order_restriction(), have_relevant_joinclause(), lfirst, make_join_rel(), and RelOptInfo::relids.
Referenced by join_search_one_level().
|
static |
Definition at line 312 of file joinrels.c.
References bms_overlap(), lfirst, make_join_rel(), and RelOptInfo::relids.
Referenced by join_search_one_level().
void mark_dummy_rel | ( | RelOptInfo * | rel | ) |
Definition at line 1363 of file joinrels.c.
References add_path(), create_append_path(), GetMemoryChunkContext(), is_dummy_rel(), RelOptInfo::lateral_relids, MemoryContextSwitchTo(), NIL, RelOptInfo::partial_pathlist, RelOptInfo::pathlist, RelOptInfo::rows, and set_cheapest().
Referenced by build_simple_rel(), generate_partitionwise_join_paths(), and populate_joinrel_with_paths().
|
static |
Definition at line 875 of file joinrels.c.
References add_paths_to_joinrel(), bms_equal(), bms_is_subset(), RelOptInfo::cheapest_total_path, create_unique_path(), elog(), ereport, errcode(), errmsg(), ERROR, is_dummy_rel(), JOIN_ANTI, JOIN_FULL, JOIN_INNER, JOIN_LEFT, JOIN_RIGHT, JOIN_RIGHT_ANTI, JOIN_SEMI, JOIN_UNIQUE_INNER, JOIN_UNIQUE_OUTER, SpecialJoinInfo::jointype, mark_dummy_rel(), SpecialJoinInfo::min_lefthand, SpecialJoinInfo::min_righthand, NIL, RelOptInfo::pathlist, RelOptInfo::relids, restriction_is_constant_false(), SpecialJoinInfo::syn_righthand, and try_partitionwise_join().
Referenced by make_join_rel(), and try_partitionwise_join().
|
static |
Definition at line 1406 of file joinrels.c.
References RestrictInfo::clause, DatumGetBool(), if(), IsA, lfirst_node, RelOptInfo::relids, and RINFO_IS_PUSHED_DOWN.
Referenced by populate_joinrel_with_paths().
|
static |
Definition at line 1460 of file joinrels.c.
References adjust_appendrel_attrs(), adjust_child_relids(), RelOptInfo::all_partrels, Assert(), bms_add_member(), bms_add_members(), bms_equal(), bms_overlap(), bms_union(), build_child_join_rel(), build_child_join_sjinfo(), check_stack_depth(), compute_partition_bounds(), RelOptInfo::consider_partitionwise_join, elog(), ERROR, find_appinfos_by_relids(), IS_DUMMY_REL, IS_PARTITIONED_REL, IS_SIMPLE_REL, JOIN_ANTI, JOIN_FULL, JOIN_INNER, JOIN_LEFT, JOIN_SEMI, SpecialJoinInfo::jointype, lfirst_node, list_head(), RelOptInfo::live_parts, lnext(), NIL, RelOptInfo::nparts, RelOptInfo::partbounds_merged, pfree(), populate_joinrel_with_paths(), REL_HAS_ALL_PART_PROPS, RelOptInfo::relids, RELOPT_OTHER_MEMBER_REL, and RelOptInfo::reloptkind.
Referenced by populate_joinrel_with_paths().