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 801 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, JOIN_LEFT, SpecialJoinInfo::jointype, lappend(), lfirst, SpecialJoinInfo::min_lefthand, SpecialJoinInfo::min_righthand, SpecialJoinInfo::ojrelid, and root.
Referenced by generate_join_implied_equalities(), and make_join_rel().
|
static |
Definition at line 1703 of file joinrels.c.
References adjust_appendrel_attrs(), adjust_child_relids(), Assert, find_appinfos_by_relids(), init_dummy_sjinfo(), JOIN_INNER, SpecialJoinInfo::jointype, makeNode, SpecialJoinInfo::min_lefthand, SpecialJoinInfo::min_righthand, SpecialJoinInfo::ojrelid, pfree(), root, SpecialJoinInfo::semi_rhs_exprs, SpecialJoinInfo::syn_lefthand, and SpecialJoinInfo::syn_righthand.
Referenced by try_partitionwise_join().
|
static |
Definition at line 1784 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, PartitionSchemeData::parttyplen, and root.
Referenced by try_partitionwise_join().
|
static |
Definition at line 1757 of file joinrels.c.
References bms_free(), JOIN_INNER, SpecialJoinInfo::jointype, SpecialJoinInfo::min_lefthand, SpecialJoinInfo::min_righthand, pfree(), SpecialJoinInfo::syn_lefthand, and SpecialJoinInfo::syn_righthand.
Referenced by try_partitionwise_join().
|
static |
Definition at line 1875 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, RelOptInfo::relids, and root.
Referenced by compute_partition_bounds().
|
static |
Definition at line 1187 of file joinrels.c.
References bms_equal(), bms_is_subset(), bms_overlap(), JOIN_FULL, SpecialJoinInfo::jointype, RelOptInfo::lateral_referencers, RelOptInfo::lateral_relids, lfirst, SpecialJoinInfo::min_lefthand, SpecialJoinInfo::min_righthand, PlaceHolderInfo::ph_eval_at, RelOptInfo::relids, and root.
Referenced by join_search_one_level().
|
static |
Definition at line 1243 of file joinrels.c.
References bms_free(), bms_overlap(), bms_union(), have_relevant_joinclause(), join_is_legal(), lfirst, RelOptInfo::relids, and root.
Referenced by have_join_order_restriction().
bool have_dangerous_phv | ( | PlannerInfo * | root, |
Relids | outer_relids, | ||
Relids | inner_params | ||
) |
Definition at line 1307 of file joinrels.c.
References bms_is_subset(), bms_overlap(), lfirst, PlaceHolderInfo::ph_eval_at, and root.
Referenced by join_is_legal(), and try_nestloop_path().
bool have_join_order_restriction | ( | PlannerInfo * | root, |
RelOptInfo * | rel1, | ||
RelOptInfo * | rel2 | ||
) |
Definition at line 1074 of file joinrels.c.
References bms_is_subset(), bms_overlap(), RelOptInfo::direct_lateral_relids, has_legal_joinclause(), JOIN_FULL, SpecialJoinInfo::jointype, lfirst, SpecialJoinInfo::min_lefthand, SpecialJoinInfo::min_righthand, PlaceHolderInfo::ph_eval_at, RelOptInfo::relids, and root.
Referenced by desirable_join(), join_search_one_level(), and make_rels_by_clause_joins().
void init_dummy_sjinfo | ( | SpecialJoinInfo * | sjinfo, |
Relids | left_relids, | ||
Relids | right_relids | ||
) |
Definition at line 669 of file joinrels.c.
References SpecialJoinInfo::commute_above_l, SpecialJoinInfo::commute_above_r, SpecialJoinInfo::commute_below_l, SpecialJoinInfo::commute_below_r, JOIN_INNER, SpecialJoinInfo::jointype, SpecialJoinInfo::lhs_strict, SpecialJoinInfo::min_lefthand, SpecialJoinInfo::min_righthand, NIL, SpecialJoinInfo::ojrelid, SpecialJoinInfo::semi_can_btree, SpecialJoinInfo::semi_can_hash, SpecialJoinInfo::semi_operators, SpecialJoinInfo::semi_rhs_exprs, SpecialJoinInfo::syn_lefthand, and SpecialJoinInfo::syn_righthand.
Referenced by approx_tuple_count(), build_child_join_sjinfo(), compute_semi_anti_join_factors(), consider_new_or_clause(), and make_join_rel().
bool is_dummy_rel | ( | RelOptInfo * | rel | ) |
Definition at line 1335 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 349 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, have_dangerous_phv(), JOIN_FULL, JOIN_LEFT, JOIN_SEMI, SpecialJoinInfo::jointype, RelOptInfo::lateral_relids, lfirst, SpecialJoinInfo::lhs_strict, min_join_parameterization(), SpecialJoinInfo::min_lefthand, SpecialJoinInfo::min_righthand, RelOptInfo::relids, root, 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 72 of file joinrels.c.
References Assert, bms_overlap(), elog, ERROR, for_each_from, foreach_current_index, RelOptInfo::has_eclass_joins, has_join_restriction(), have_join_order_restriction(), have_relevant_joinclause(), RelOptInfo::joininfo, lfirst, make_join_rel(), make_rels_by_clause_joins(), make_rels_by_clauseless_joins(), NIL, RelOptInfo::relids, and root.
Referenced by standard_join_search().
RelOptInfo* make_join_rel | ( | PlannerInfo * | root, |
RelOptInfo * | rel1, | ||
RelOptInfo * | rel2 | ||
) |
Definition at line 704 of file joinrels.c.
References add_outer_joins_to_relids(), Assert, bms_free(), bms_overlap(), bms_union(), build_join_rel(), init_dummy_sjinfo(), is_dummy_rel(), join_is_legal(), NIL, populate_joinrel_with_paths(), RelOptInfo::relids, and root.
Referenced by join_search_one_level(), make_rels_by_clause_joins(), make_rels_by_clauseless_joins(), and merge_clump().
|
static |
Definition at line 279 of file joinrels.c.
References bms_overlap(), for_each_from, have_join_order_restriction(), have_relevant_joinclause(), lfirst, make_join_rel(), RelOptInfo::relids, and root.
Referenced by join_search_one_level().
|
static |
Definition at line 313 of file joinrels.c.
References bms_overlap(), lfirst, make_join_rel(), RelOptInfo::relids, and root.
Referenced by join_search_one_level().
void mark_dummy_rel | ( | RelOptInfo * | rel | ) |
Definition at line 1384 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 893 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_RIGHT_SEMI, 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(), root, SpecialJoinInfo::syn_righthand, and try_partitionwise_join().
Referenced by make_join_rel(), and try_partitionwise_join().
|
static |
Definition at line 1427 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 1481 of file joinrels.c.
References adjust_appendrel_attrs(), adjust_child_relids(), RelOptInfo::all_partrels, Assert, bms_add_member(), bms_add_members(), bms_equal(), bms_free(), 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(), free_child_join_sjinfo(), 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, RelOptInfo::reloptkind, and root.
Referenced by populate_joinrel_with_paths().