136 #define planner_subplan_get_plan(root, subplan) \
137 ((Plan *) list_nth((root)->glob->subplans, (subplan)->plan_id - 1))
153 #ifndef HAVE_PLANNERINFO_TYPEDEF
155 #define HAVE_PLANNERINFO_TYPEDEF 1
397 #define planner_rt_fetch(rti, root) \
398 ((root)->simple_rte_array ? (root)->simple_rte_array[rti] : \
399 rt_fetch(rti, (root)->parse->rtable))
646 #define AMFLAG_HAS_TID_RANGE (1 << 0)
663 #define IS_SIMPLE_REL(rel) \
664 ((rel)->reloptkind == RELOPT_BASEREL || \
665 (rel)->reloptkind == RELOPT_OTHER_MEMBER_REL)
668 #define IS_JOIN_REL(rel) \
669 ((rel)->reloptkind == RELOPT_JOINREL || \
670 (rel)->reloptkind == RELOPT_OTHER_JOINREL)
673 #define IS_UPPER_REL(rel) \
674 ((rel)->reloptkind == RELOPT_UPPER_REL || \
675 (rel)->reloptkind == RELOPT_OTHER_UPPER_REL)
678 #define IS_OTHER_REL(rel) \
679 ((rel)->reloptkind == RELOPT_OTHER_MEMBER_REL || \
680 (rel)->reloptkind == RELOPT_OTHER_JOINREL || \
681 (rel)->reloptkind == RELOPT_OTHER_UPPER_REL)
864 #define IS_PARTITIONED_REL(rel) \
865 ((rel)->part_scheme && (rel)->boundinfo && (rel)->nparts > 0 && \
866 (rel)->part_rels && !IS_DUMMY_REL(rel))
872 #define REL_HAS_ALL_PART_PROPS(rel) \
873 ((rel)->part_scheme && (rel)->boundinfo && (rel)->nparts > 0 && \
874 (rel)->part_rels && (rel)->partexprs && (rel)->nullable_partexprs)
907 #ifndef HAVE_INDEXOPTINFO_TYPEDEF
909 #define HAVE_INDEXOPTINFO_TYPEDEF 1
1151 #define EC_MUST_BE_REDUNDANT(eclass) \
1152 ((eclass)->ec_has_const && !(eclass)->ec_below_outer_join)
1281 #define get_pathtarget_sortgroupref(target, colno) \
1282 ((target)->sortgrouprefs ? (target)->sortgrouprefs[colno] : (Index) 0)
1371 #define PATH_REQ_OUTER(path) \
1372 ((path)->param_info ? (path)->param_info->ppi_req_outer : (Relids) NULL)
1628 #define IS_DUMMY_APPEND(p) \
1629 (IsA((p), AppendPath) && ((AppendPath *) (p))->subpaths == NIL)
1636 #define IS_DUMMY_REL(r) is_dummy_rel(r)
2363 #define RINFO_IS_PUSHED_DOWN(rinfo, joinrelids) \
2364 ((rinfo)->is_pushed_down || \
2365 !bms_is_subset((rinfo)->required_relids, joinrelids))
2476 #ifndef HAVE_SPECIALJOININFO_TYPEDEF
2478 #define HAVE_SPECIALJOININFO_TYPEDEF 1
2808 #define GROUPING_CAN_USE_SORT 0x0001
2809 #define GROUPING_CAN_USE_HASH 0x0002
2810 #define GROUPING_CAN_PARTIAL_AGG 0x0004
struct AggTransInfo AggTransInfo
struct MergeScanSelCache MergeScanSelCache
struct IndexPath IndexPath
struct TidRangePath TidRangePath
struct JoinCostWorkspace JoinCostWorkspace
bool is_dummy_rel(RelOptInfo *rel)
PartitionwiseAggregateType
@ PARTITIONWISE_AGGREGATE_PARTIAL
@ PARTITIONWISE_AGGREGATE_FULL
@ PARTITIONWISE_AGGREGATE_NONE
struct ForeignPath ForeignPath
struct StatisticExtInfo StatisticExtInfo
struct SetOpPath SetOpPath
struct RollupData RollupData
struct BitmapOrPath BitmapOrPath
struct PlannerGlobal PlannerGlobal
struct ParamPathInfo ParamPathInfo
struct SubqueryScanPath SubqueryScanPath
struct UniquePath UniquePath
struct AggClauseCosts AggClauseCosts
struct EquivalenceClass EquivalenceClass
struct RecursiveUnionPath RecursiveUnionPath
struct EquivalenceMember EquivalenceMember
struct MaterialPath MaterialPath
struct AppendRelInfo AppendRelInfo
struct PartitionSchemeData PartitionSchemeData
struct ProjectionPath ProjectionPath
struct CustomPath CustomPath
struct BitmapAndPath BitmapAndPath
struct PartitionSchemeData * PartitionScheme
struct WindowAggPath WindowAggPath
struct MinMaxAggInfo MinMaxAggInfo
struct RelOptInfo RelOptInfo
struct GroupingSetsPath GroupingSetsPath
struct IncrementalSortPath IncrementalSortPath
struct ProjectSetPath ProjectSetPath
struct MergePath MergePath
struct LockRowsPath LockRowsPath
struct MergeAppendPath MergeAppendPath
struct GroupPath GroupPath
struct GroupResultPath GroupResultPath
struct MemoizePath MemoizePath
@ UPPERREL_PARTIAL_GROUP_AGG
@ UPPERREL_PARTIAL_DISTINCT
struct PlaceHolderVar PlaceHolderVar
@ RELOPT_OTHER_MEMBER_REL
struct RestrictInfo RestrictInfo
struct JoinPathExtraData JoinPathExtraData
struct ModifyTablePath ModifyTablePath
struct LimitPath LimitPath
struct PathKeyInfo PathKeyInfo
struct GroupingSetData GroupingSetData
struct UpperUniquePath UpperUniquePath
struct MinMaxAggPath MinMaxAggPath
struct PlannerParamItem PlannerParamItem
struct ForeignKeyOptInfo ForeignKeyOptInfo
struct PathTarget PathTarget
struct IndexClause IndexClause
struct PlaceHolderInfo PlaceHolderInfo
struct GatherPath GatherPath
struct SemiAntiJoinFactors SemiAntiJoinFactors
struct RowIdentityVarInfo RowIdentityVarInfo
struct AppendPath AppendPath
struct GatherMergePath GatherMergePath
struct BitmapHeapPath BitmapHeapPath
Aggref * representative_aggref
AttrNumber * parent_colnos
Selectivity bitmapselectivity
Selectivity bitmapselectivity
const struct CustomPathMethods * methods
struct EquivalenceClass * ec_merged
Relids em_nullable_relids
Oid conpfeqop[INDEX_MAX_KEYS]
AttrNumber confkey[INDEX_MAX_KEYS]
struct EquivalenceClass * eclass[INDEX_MAX_KEYS]
List * rinfos[INDEX_MAX_KEYS]
AttrNumber conkey[INDEX_MAX_KEYS]
struct EquivalenceMember * fk_eclass_member[INDEX_MAX_KEYS]
Cardinality inner_rows_total
struct RestrictInfo * rinfo
ScanDirection indexscandir
Selectivity indexselectivity
Cost inner_rescan_run_cost
Cardinality inner_skip_rows
Cardinality inner_rows_total
Cardinality outer_skip_rows
Selectivity rightstartsel
List * withCheckOptionLists
OnConflictExpr * onconflict
struct FmgrInfo * partsupfunc
EquivalenceClass * pk_eclass
VolatileFunctionStatus has_volatile_expr
ParamPathInfo * param_info
PartitionDirectory partition_directory
Bitmapset * rewindPlanIDs
ParamListInfo boundParams
struct HTAB * join_rel_hash
MemoryContext planner_cxt
struct PathTarget * upper_targets[UPPERREL_FINAL+1]
int simple_rel_array_size
Index qual_security_level
AttrNumber * grouping_map
void * join_search_private
struct AppendRelInfo ** append_rel_array
struct Path * non_recursive_path
List * upper_rels[UPPERREL_FINAL+1]
struct RelOptInfo ** simple_rel_array
RangeTblEntry ** simple_rte_array
bool hasAlternativeSubPlans
List * right_join_clauses
PlannerInfo * parent_root
Cardinality total_table_pages
Selectivity tuple_fraction
bool hasPseudoConstantQuals
Relids leaf_result_relids
bool consider_param_startup
struct PathTarget * reltarget
struct FdwRoutine * fdwroutine
struct PartitionBoundInfoData * boundinfo
PartitionScheme part_scheme
List * cheapest_parameterized_paths
struct Path * cheapest_unique_path
Relids lateral_referencers
struct Path * cheapest_startup_path
QualCost baserestrictcost
struct Path * cheapest_total_path
List * non_unique_for_rels
Bitmapset * eclass_indexes
struct RelOptInfo ** part_rels
Relids direct_lateral_relids
List ** nullable_partexprs
bool consider_partitionwise_join
Index baserestrict_min_security
EquivalenceClass * left_ec
Selectivity right_bucketsize
VolatileFunctionStatus has_volatile
Selectivity left_bucketsize
EquivalenceMember * left_em
EquivalenceClass * parent_ec
EquivalenceClass * right_ec
EquivalenceMember * right_em
Selectivity right_mcvfreq
Selectivity outer_match_frac