|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "executor/executor.h"#include "foreign/fdwapi.h"#include "nodes/nodeFuncs.h"#include "optimizer/cost.h"#include "optimizer/optimizer.h"#include "optimizer/pathnode.h"#include "optimizer/paths.h"#include "optimizer/placeholder.h"#include "optimizer/planmain.h"#include "optimizer/restrictinfo.h"#include "utils/lsyscache.h"#include "utils/typcache.h"
Go to the source code of this file.
Macros | |
| #define | PATH_PARAM_BY_PARENT(path, rel) |
| #define | PATH_PARAM_BY_REL_SELF(path, rel) ((path)->param_info && bms_overlap(PATH_REQ_OUTER(path), (rel)->relids)) |
| #define | PATH_PARAM_BY_REL(path, rel) (PATH_PARAM_BY_REL_SELF(path, rel) || PATH_PARAM_BY_PARENT(path, rel)) |
Variables | |
| set_join_pathlist_hook_type | set_join_pathlist_hook = NULL |
| join_path_setup_hook_type | join_path_setup_hook = NULL |
| #define PATH_PARAM_BY_PARENT | ( | path, | |
| rel | |||
| ) |
Definition at line 39 of file joinpath.c.
| #define PATH_PARAM_BY_REL | ( | path, | |
| rel | |||
| ) | (PATH_PARAM_BY_REL_SELF(path, rel) || PATH_PARAM_BY_PARENT(path, rel)) |
Definition at line 45 of file joinpath.c.
| #define PATH_PARAM_BY_REL_SELF | ( | path, | |
| rel | |||
| ) | ((path)->param_info && bms_overlap(PATH_REQ_OUTER(path), (rel)->relids)) |
Definition at line 42 of file joinpath.c.
| void add_paths_to_joinrel | ( | PlannerInfo * | root, |
| RelOptInfo * | joinrel, | ||
| RelOptInfo * | outerrel, | ||
| RelOptInfo * | innerrel, | ||
| JoinType | jointype, | ||
| SpecialJoinInfo * | sjinfo, | ||
| List * | restrictlist | ||
| ) |
Definition at line 123 of file joinpath.c.
References bms_add_members(), bms_difference(), bms_is_subset(), bms_join(), bms_overlap(), compute_semi_anti_join_factors(), fb(), hash_inner_and_outer(), JoinPathExtraData::inner_unique, innerrel_is_unique(), JOIN_ANTI, JOIN_FULL, JOIN_INNER, join_path_setup_hook, JOIN_SEMI, JOIN_UNIQUE_INNER, JOIN_UNIQUE_OUTER, RelOptInfo::lateral_relids, lfirst, match_unsorted_outer(), JoinPathExtraData::mergeclause_list, SpecialJoinInfo::min_lefthand, NIL, JoinPathExtraData::param_source_rels, PGS_FOREIGNJOIN, PGS_HASHJOIN, RelOptInfo::pgs_mask, JoinPathExtraData::pgs_mask, PGS_MERGEJOIN_ANY, RelOptInfo::relids, RELOPT_OTHER_JOINREL, RelOptInfo::reloptkind, JoinPathExtraData::restrictlist, root, 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().
|
inlinestatic |
Definition at line 400 of file joinpath.c.
References bms_nonempty_difference(), bms_overlap(), and fb().
Referenced by try_nestloop_path().
|
static |
Definition at line 2039 of file joinpath.c.
References build_join_pathkeys(), fb(), generate_mergejoin_paths(), lfirst, RelOptInfo::partial_pathlist, and root.
Referenced by match_unsorted_outer().
|
static |
Definition at line 2079 of file joinpath.c.
References Assert, build_join_pathkeys(), RelOptInfo::cheapest_parameterized_paths, RelOptInfo::cheapest_total_path, create_material_path(), ExecMaterializesOutput(), fb(), get_memoize_path(), lfirst, RelOptInfo::partial_pathlist, PATH_PARAM_BY_REL, JoinPathExtraData::pgs_mask, PGS_NESTLOOP_MATERIALIZE, PGS_NESTLOOP_MEMOIZE, PGS_NESTLOOP_PLAIN, root, and try_partial_nestloop_path().
Referenced by match_unsorted_outer().
|
static |
Definition at line 621 of file joinpath.c.
References Assert, bms_equal(), bms_is_member(), bms_is_subset(), bms_membership(), BMS_MULTIPLE, bms_overlap(), fb(), find_placeholder_info(), IsA, lappend(), lfirst, list_free(), NIL, PlaceHolderInfo::ph_lateral, pull_varnos(), pull_vars_of_level(), root, Var::varlevelsup, and Var::varno.
Referenced by get_memoize_path().
|
static |
Definition at line 1586 of file joinpath.c.
References Assert, compare_path_costs(), fb(), find_mergeclauses_for_outer_pathkeys(), get_cheapest_path_for_pathkeys(), JOIN_FULL, list_copy(), list_length(), list_truncate(), make_inner_pathkeys_for_merge(), JoinPathExtraData::mergeclause_list, NIL, pathkeys_contained_in(), RelOptInfo::pathlist, root, STARTUP_COST, TOTAL_COST, trim_mergeclauses_for_inner_pathkeys(), and try_mergejoin_path().
Referenced by consider_parallel_mergejoin(), and match_unsorted_outer().
|
static |
Definition at line 712 of file joinpath.c.
References RelOptInfo::baserestrictinfo, bms_is_member(), contain_volatile_functions(), create_memoize_path(), extract_lateral_vars_from_PHVs(), fb(), foreach_node, JoinPathExtraData::inner_unique, JOIN_ANTI, JOIN_SEMI, RelOptInfo::lateral_vars, lfirst, NIL, paraminfo_get_equal_hashops(), JoinPathExtraData::pgs_mask, PGS_NESTLOOP_MEMOIZE, RelOptInfo::relids, RelOptInfo::reltarget, JoinPathExtraData::restrictlist, and root.
Referenced by consider_parallel_nestloop(), and match_unsorted_outer().
|
static |
Definition at line 2168 of file joinpath.c.
References bms_is_empty, castNode, RelOptInfo::cheapest_parameterized_paths, RelOptInfo::cheapest_startup_path, RelOptInfo::cheapest_total_path, clause_sides_match_join(), RelOptInfo::consider_parallel, enable_parallel_hash, fb(), get_cheapest_parallel_safe_total_inner(), get_commutator(), InvalidOid, IS_OUTER_JOIN, JOIN_FULL, JOIN_RIGHT, JOIN_RIGHT_ANTI, JOIN_RIGHT_SEMI, lappend(), RelOptInfo::lateral_relids, lfirst, linitial, NIL, OidIsValid, RelOptInfo::partial_pathlist, PATH_PARAM_BY_REL, RelOptInfo::pathlist, RelOptInfo::relids, JoinPathExtraData::restrictlist, RINFO_IS_PUSHED_DOWN, root, try_hashjoin_path(), and try_partial_hashjoin_path().
Referenced by add_paths_to_joinrel().
|
static |
Definition at line 1826 of file joinpath.c.
References bms_is_empty, build_join_pathkeys(), RelOptInfo::cheapest_parameterized_paths, RelOptInfo::cheapest_total_path, RelOptInfo::consider_parallel, consider_parallel_mergejoin(), consider_parallel_nestloop(), create_material_path(), elog, ERROR, ExecMaterializesOutput(), fb(), generate_mergejoin_paths(), get_cheapest_parallel_safe_total_inner(), get_memoize_path(), JOIN_ANTI, JOIN_FULL, JOIN_INNER, JOIN_LEFT, JOIN_RIGHT, JOIN_RIGHT_ANTI, JOIN_RIGHT_SEMI, JOIN_SEMI, RelOptInfo::lateral_relids, lfirst, NIL, RelOptInfo::partial_pathlist, PATH_PARAM_BY_REL, RelOptInfo::pathlist, JoinPathExtraData::pgs_mask, PGS_NESTLOOP_MATERIALIZE, PGS_NESTLOOP_MEMOIZE, PGS_NESTLOOP_PLAIN, RELATION_WAS_MADE_UNIQUE, root, JoinPathExtraData::sjinfo, and try_nestloop_path().
Referenced by add_paths_to_joinrel().
|
static |
Definition at line 476 of file joinpath.c.
References OpExpr::args, RestrictInfo::clause, clause_sides_match_join(), contain_volatile_functions(), TypeCacheEntry::eq_opr, exprType(), fb(), TypeCacheEntry::hash_proc, IsA, lappend(), lappend_oid(), RelOptInfo::lateral_vars, lfirst, linitial, list_concat(), list_free(), list_length(), list_member(), lookup_type_cache(), lsecond, NIL, OidIsValid, RelOptInfo::relids, TYPECACHE_EQ_OPR, and TYPECACHE_HASH_PROC.
Referenced by get_memoize_path().
|
static |
Definition at line 2395 of file joinpath.c.
References castNode, clause_sides_match_join(), EC_MUST_BE_REDUNDANT, fb(), get_commutator(), IS_OUTER_JOIN, IsA, JOIN_FULL, JOIN_RIGHT, JOIN_RIGHT_ANTI, JOIN_RIGHT_SEMI, lappend(), lfirst, NIL, OidIsValid, RelOptInfo::relids, RINFO_IS_PUSHED_DOWN, root, and update_mergeclause_eclasses().
Referenced by add_paths_to_joinrel().
|
static |
Definition at line 1402 of file joinpath.c.
References Assert, bms_is_empty, build_join_pathkeys(), RelOptInfo::cheapest_total_path, RelOptInfo::consider_parallel, fb(), find_mergeclauses_for_outer_pathkeys(), foreach_current_index, get_cheapest_parallel_safe_total_inner(), JOIN_FULL, JOIN_RIGHT, JOIN_RIGHT_ANTI, RelOptInfo::lateral_relids, lcons(), lfirst, linitial, list_copy(), list_delete_nth_cell(), list_head(), list_length(), make_inner_pathkeys_for_merge(), JoinPathExtraData::mergeclause_list, NIL, RelOptInfo::partial_pathlist, PATH_PARAM_BY_REL, RelOptInfo::pathlist, root, select_outer_pathkeys_for_merge(), try_mergejoin_path(), and try_partial_mergejoin_path().
Referenced by add_paths_to_joinrel().
|
static |
Definition at line 1267 of file joinpath.c.
References add_path(), add_path_precheck(), bms_free(), bms_is_member(), bms_overlap(), calc_non_nestloop_required_outer(), create_hashjoin_path(), JoinCostWorkspace::disabled_nodes, fb(), initial_cost_hashjoin(), NIL, SpecialJoinInfo::ojrelid, JoinPathExtraData::param_source_rels, PATH_REQ_OUTER, JoinPathExtraData::restrictlist, root, JoinPathExtraData::sjinfo, JoinCostWorkspace::startup_cost, and JoinCostWorkspace::total_cost.
Referenced by hash_inner_and_outer().
|
static |
Definition at line 1074 of file joinpath.c.
References add_path(), add_path_precheck(), bms_free(), bms_is_member(), bms_overlap(), calc_non_nestloop_required_outer(), create_mergejoin_path(), JoinCostWorkspace::disabled_nodes, fb(), initial_cost_mergejoin(), NIL, SpecialJoinInfo::ojrelid, JoinPathExtraData::param_source_rels, PATH_REQ_OUTER, pathkeys_contained_in(), pathkeys_count_contained_in(), JoinPathExtraData::restrictlist, root, JoinPathExtraData::sjinfo, JoinCostWorkspace::startup_cost, JoinCostWorkspace::total_cost, and try_partial_mergejoin_path().
Referenced by generate_mergejoin_paths(), and sort_inner_and_outer().
|
static |
Definition at line 873 of file joinpath.c.
References add_path(), add_path_precheck(), allow_star_schema_join(), Assert, bms_free(), bms_is_member(), bms_overlap(), calc_nestloop_required_outer(), create_nestloop_path(), JoinCostWorkspace::disabled_nodes, fb(), initial_cost_nestloop(), SpecialJoinInfo::ojrelid, JoinPathExtraData::param_source_rels, path_is_reparameterizable_by_child(), PATH_PARAM_BY_PARENT, PATH_REQ_OUTER, PGS_CONSIDER_NONPARTIAL, RelOptInfo::relids, JoinPathExtraData::restrictlist, root, JoinPathExtraData::sjinfo, JoinCostWorkspace::startup_cost, RelOptInfo::top_parent_relids, and JoinCostWorkspace::total_cost.
Referenced by match_unsorted_outer().
|
static |
Definition at line 1344 of file joinpath.c.
References add_partial_path(), add_partial_path_precheck(), Assert, bms_is_empty, create_hashjoin_path(), JoinCostWorkspace::disabled_nodes, fb(), initial_cost_hashjoin(), RelOptInfo::lateral_relids, NIL, PATH_REQ_OUTER, JoinPathExtraData::restrictlist, root, and JoinCostWorkspace::total_cost.
Referenced by hash_inner_and_outer().
|
static |
Definition at line 1190 of file joinpath.c.
References add_partial_path(), add_partial_path_precheck(), Assert, bms_is_empty, create_mergejoin_path(), JoinCostWorkspace::disabled_nodes, fb(), initial_cost_mergejoin(), RelOptInfo::lateral_relids, NIL, PATH_REQ_OUTER, pathkeys_contained_in(), pathkeys_count_contained_in(), JoinPathExtraData::restrictlist, root, and JoinCostWorkspace::total_cost.
Referenced by sort_inner_and_outer(), and try_mergejoin_path().
|
static |
Definition at line 994 of file joinpath.c.
References add_partial_path(), add_partial_path_precheck(), Assert, bms_is_empty, bms_is_subset(), create_nestloop_path(), JoinCostWorkspace::disabled_nodes, fb(), initial_cost_nestloop(), RelOptInfo::lateral_relids, path_is_reparameterizable_by_child(), PATH_PARAM_BY_PARENT, PATH_REQ_OUTER, RelOptInfo::relids, JoinPathExtraData::restrictlist, root, RelOptInfo::top_parent_relids, and JoinCostWorkspace::total_cost.
Referenced by consider_parallel_nestloop().
| join_path_setup_hook_type join_path_setup_hook = NULL |
Definition at line 32 of file joinpath.c.
Referenced by add_paths_to_joinrel().
| set_join_pathlist_hook_type set_join_pathlist_hook = NULL |
Definition at line 31 of file joinpath.c.
Referenced by add_paths_to_joinrel().