PostgreSQL Source Code  git master
relation.h File Reference
#include "access/sdir.h"
#include "fmgr.h"
#include "lib/stringinfo.h"
#include "nodes/params.h"
#include "nodes/parsenodes.h"
#include "storage/block.h"
Include dependency graph for relation.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  QualCost
 
struct  AggClauseCosts
 
struct  PlannerGlobal
 
struct  PlannerInfo
 
struct  PartitionSchemeData
 
struct  RelOptInfo
 
struct  IndexOptInfo
 
struct  ForeignKeyOptInfo
 
struct  StatisticExtInfo
 
struct  EquivalenceClass
 
struct  EquivalenceMember
 
struct  PathKey
 
struct  PathTarget
 
struct  ParamPathInfo
 
struct  Path
 
struct  IndexPath
 
struct  BitmapHeapPath
 
struct  BitmapAndPath
 
struct  BitmapOrPath
 
struct  TidPath
 
struct  SubqueryScanPath
 
struct  ForeignPath
 
struct  CustomPath
 
struct  AppendPath
 
struct  MergeAppendPath
 
struct  ResultPath
 
struct  MaterialPath
 
struct  UniquePath
 
struct  GatherPath
 
struct  GatherMergePath
 
struct  JoinPath
 
struct  MergePath
 
struct  HashPath
 
struct  ProjectionPath
 
struct  ProjectSetPath
 
struct  SortPath
 
struct  GroupPath
 
struct  UpperUniquePath
 
struct  AggPath
 
struct  GroupingSetData
 
struct  RollupData
 
struct  GroupingSetsPath
 
struct  MinMaxAggPath
 
struct  WindowAggPath
 
struct  SetOpPath
 
struct  RecursiveUnionPath
 
struct  LockRowsPath
 
struct  ModifyTablePath
 
struct  LimitPath
 
struct  RestrictInfo
 
struct  MergeScanSelCache
 
struct  PlaceHolderVar
 
struct  SpecialJoinInfo
 
struct  AppendRelInfo
 
struct  PlaceHolderInfo
 
struct  MinMaxAggInfo
 
struct  PlannerParamItem
 
struct  SemiAntiJoinFactors
 
struct  JoinPathExtraData
 
struct  GroupPathExtraData
 
struct  JoinCostWorkspace
 

Macros

#define planner_subplan_get_plan(root, subplan)   ((Plan *) list_nth((root)->glob->subplans, (subplan)->plan_id - 1))
 
#define planner_rt_fetch(rti, root)
 
#define IS_SIMPLE_REL(rel)
 
#define IS_JOIN_REL(rel)
 
#define IS_UPPER_REL(rel)
 
#define IS_OTHER_REL(rel)
 
#define IS_PARTITIONED_REL(rel)
 
#define REL_HAS_ALL_PART_PROPS(rel)
 
#define EC_MUST_BE_REDUNDANT(eclass)   ((eclass)->ec_has_const && !(eclass)->ec_below_outer_join)
 
#define get_pathtarget_sortgroupref(target, colno)   ((target)->sortgrouprefs ? (target)->sortgrouprefs[colno] : (Index) 0)
 
#define PATH_REQ_OUTER(path)   ((path)->param_info ? (path)->param_info->ppi_req_outer : (Relids) NULL)
 
#define IS_DUMMY_PATH(p)   (IsA((p), AppendPath) && ((AppendPath *) (p))->subpaths == NIL)
 
#define IS_DUMMY_REL(r)
 
#define RINFO_IS_PUSHED_DOWN(rinfo, joinrelids)
 
#define GROUPING_CAN_USE_SORT   0x0001
 
#define GROUPING_CAN_USE_HASH   0x0002
 
#define GROUPING_CAN_PARTIAL_AGG   0x0004
 

Typedefs

typedef BitmapsetRelids
 
typedef enum CostSelector CostSelector
 
typedef struct QualCost QualCost
 
typedef struct AggClauseCosts AggClauseCosts
 
typedef enum UpperRelationKind UpperRelationKind
 
typedef enum InheritanceKind InheritanceKind
 
typedef struct PlannerGlobal PlannerGlobal
 
typedef struct PlannerInfo PlannerInfo
 
typedef struct PartitionSchemeData PartitionSchemeData
 
typedef struct PartitionSchemeDataPartitionScheme
 
typedef enum RelOptKind RelOptKind
 
typedef struct RelOptInfo RelOptInfo
 
typedef struct IndexOptInfo IndexOptInfo
 
typedef struct ForeignKeyOptInfo ForeignKeyOptInfo
 
typedef struct StatisticExtInfo StatisticExtInfo
 
typedef struct EquivalenceClass EquivalenceClass
 
typedef struct EquivalenceMember EquivalenceMember
 
typedef struct PathKey PathKey
 
typedef struct PathTarget PathTarget
 
typedef struct ParamPathInfo ParamPathInfo
 
typedef struct Path Path
 
typedef struct IndexPath IndexPath
 
typedef struct BitmapHeapPath BitmapHeapPath
 
typedef struct BitmapAndPath BitmapAndPath
 
typedef struct BitmapOrPath BitmapOrPath
 
typedef struct TidPath TidPath
 
typedef struct SubqueryScanPath SubqueryScanPath
 
typedef struct ForeignPath ForeignPath
 
typedef struct CustomPath CustomPath
 
typedef struct AppendPath AppendPath
 
typedef struct MergeAppendPath MergeAppendPath
 
typedef struct ResultPath ResultPath
 
typedef struct MaterialPath MaterialPath
 
typedef struct UniquePath UniquePath
 
typedef struct GatherPath GatherPath
 
typedef struct GatherMergePath GatherMergePath
 
typedef struct JoinPath JoinPath
 
typedef JoinPath NestPath
 
typedef struct MergePath MergePath
 
typedef struct HashPath HashPath
 
typedef struct ProjectionPath ProjectionPath
 
typedef struct ProjectSetPath ProjectSetPath
 
typedef struct SortPath SortPath
 
typedef struct GroupPath GroupPath
 
typedef struct UpperUniquePath UpperUniquePath
 
typedef struct AggPath AggPath
 
typedef struct GroupingSetData GroupingSetData
 
typedef struct RollupData RollupData
 
typedef struct GroupingSetsPath GroupingSetsPath
 
typedef struct MinMaxAggPath MinMaxAggPath
 
typedef struct WindowAggPath WindowAggPath
 
typedef struct SetOpPath SetOpPath
 
typedef struct RecursiveUnionPath RecursiveUnionPath
 
typedef struct LockRowsPath LockRowsPath
 
typedef struct ModifyTablePath ModifyTablePath
 
typedef struct LimitPath LimitPath
 
typedef struct RestrictInfo RestrictInfo
 
typedef struct MergeScanSelCache MergeScanSelCache
 
typedef struct PlaceHolderVar PlaceHolderVar
 
typedef struct SpecialJoinInfo SpecialJoinInfo
 
typedef struct AppendRelInfo AppendRelInfo
 
typedef struct PlaceHolderInfo PlaceHolderInfo
 
typedef struct MinMaxAggInfo MinMaxAggInfo
 
typedef struct PlannerParamItem PlannerParamItem
 
typedef struct SemiAntiJoinFactors SemiAntiJoinFactors
 
typedef struct JoinPathExtraData JoinPathExtraData
 
typedef struct JoinCostWorkspace JoinCostWorkspace
 

Enumerations

enum  CostSelector { STARTUP_COST, TOTAL_COST }
 
enum  UpperRelationKind {
  UPPERREL_SETOP, UPPERREL_PARTIAL_GROUP_AGG, UPPERREL_GROUP_AGG, UPPERREL_WINDOW,
  UPPERREL_DISTINCT, UPPERREL_ORDERED, UPPERREL_FINAL
}
 
enum  InheritanceKind { INHKIND_NONE, INHKIND_INHERITED, INHKIND_PARTITIONED }
 
enum  RelOptKind {
  RELOPT_BASEREL, RELOPT_JOINREL, RELOPT_OTHER_MEMBER_REL, RELOPT_OTHER_JOINREL,
  RELOPT_UPPER_REL, RELOPT_OTHER_UPPER_REL, RELOPT_DEADREL
}
 
enum  UniquePathMethod { UNIQUE_PATH_NOOP, UNIQUE_PATH_HASH, UNIQUE_PATH_SORT }
 
enum  PartitionwiseAggregateType { PARTITIONWISE_AGGREGATE_NONE, PARTITIONWISE_AGGREGATE_FULL, PARTITIONWISE_AGGREGATE_PARTIAL }
 

Macro Definition Documentation

◆ EC_MUST_BE_REDUNDANT

#define EC_MUST_BE_REDUNDANT (   eclass)    ((eclass)->ec_has_const && !(eclass)->ec_below_outer_join)

Definition at line 917 of file relation.h.

Referenced by pathkey_is_redundant(), and select_mergejoin_clauses().

◆ get_pathtarget_sortgroupref

#define get_pathtarget_sortgroupref (   target,
  colno 
)    ((target)->sortgrouprefs ? (target)->sortgrouprefs[colno] : (Index) 0)

◆ GROUPING_CAN_PARTIAL_AGG

#define GROUPING_CAN_PARTIAL_AGG   0x0004

Definition at line 2335 of file relation.h.

Referenced by create_grouping_paths(), and create_ordinary_grouping_paths().

◆ GROUPING_CAN_USE_HASH

#define GROUPING_CAN_USE_HASH   0x0002

◆ GROUPING_CAN_USE_SORT

#define GROUPING_CAN_USE_SORT   0x0001

◆ IS_DUMMY_PATH

#define IS_DUMMY_PATH (   p)    (IsA((p), AppendPath) && ((AppendPath *) (p))->subpaths == NIL)

Definition at line 1313 of file relation.h.

Referenced by inheritance_planner(), and is_projection_capable_path().

◆ IS_DUMMY_REL

◆ IS_JOIN_REL

◆ IS_OTHER_REL

◆ IS_PARTITIONED_REL

#define IS_PARTITIONED_REL (   rel)
Value:
((rel)->part_scheme && (rel)->boundinfo && (rel)->nparts > 0 && \
(rel)->part_rels && !(IS_DUMMY_REL(rel)))
#define IS_DUMMY_REL(r)
Definition: relation.h:1317

Definition at line 706 of file relation.h.

Referenced by build_joinrel_partition_info(), generate_partitionwise_join_paths(), and try_partitionwise_join().

◆ IS_SIMPLE_REL

◆ IS_UPPER_REL

◆ PATH_REQ_OUTER

◆ planner_rt_fetch

◆ planner_subplan_get_plan

#define planner_subplan_get_plan (   root,
  subplan 
)    ((Plan *) list_nth((root)->glob->subplans, (subplan)->plan_id - 1))

Definition at line 151 of file relation.h.

Referenced by finalize_plan(), and finalize_primnode().

◆ REL_HAS_ALL_PART_PROPS

#define REL_HAS_ALL_PART_PROPS (   rel)
Value:
((rel)->part_scheme && (rel)->boundinfo && (rel)->nparts > 0 && \
(rel)->part_rels && (rel)->partexprs && (rel)->nullable_partexprs)

Definition at line 714 of file relation.h.

Referenced by build_joinrel_partition_info(), and try_partitionwise_join().

◆ RINFO_IS_PUSHED_DOWN

#define RINFO_IS_PUSHED_DOWN (   rinfo,
  joinrelids 
)

Typedef Documentation

◆ AggClauseCosts

◆ AggPath

◆ AppendPath

◆ AppendRelInfo

◆ BitmapAndPath

◆ BitmapHeapPath

◆ BitmapOrPath

◆ CostSelector

◆ CustomPath

◆ EquivalenceClass

◆ EquivalenceMember

◆ ForeignKeyOptInfo

◆ ForeignPath

◆ GatherMergePath

◆ GatherPath

◆ GroupingSetData

◆ GroupingSetsPath

◆ GroupPath

◆ HashPath

◆ IndexOptInfo

◆ IndexPath

◆ InheritanceKind

◆ JoinCostWorkspace

◆ JoinPath

◆ JoinPathExtraData

◆ LimitPath

◆ LockRowsPath

◆ MaterialPath

◆ MergeAppendPath

◆ MergePath

◆ MergeScanSelCache

◆ MinMaxAggInfo

◆ MinMaxAggPath

◆ ModifyTablePath

◆ NestPath

Definition at line 1442 of file relation.h.

◆ ParamPathInfo

◆ PartitionScheme

Definition at line 378 of file relation.h.

◆ PartitionSchemeData

◆ Path

typedef struct Path Path

◆ PathKey

◆ PathTarget

◆ PlaceHolderInfo

◆ PlaceHolderVar

◆ PlannerGlobal

◆ PlannerInfo

◆ PlannerParamItem

◆ ProjectionPath

◆ ProjectSetPath

◆ QualCost

◆ RecursiveUnionPath

◆ Relids

Definition at line 29 of file relation.h.

◆ RelOptInfo

◆ RelOptKind

◆ RestrictInfo

◆ ResultPath

◆ RollupData

◆ SemiAntiJoinFactors

◆ SetOpPath

◆ SortPath

◆ SpecialJoinInfo

◆ StatisticExtInfo

◆ SubqueryScanPath

◆ TidPath

◆ UniquePath

◆ UpperRelationKind

◆ UpperUniquePath

◆ WindowAggPath

Enumeration Type Documentation

◆ CostSelector

Enumerator
STARTUP_COST 
TOTAL_COST 

Definition at line 35 of file relation.h.

36 {
38 } CostSelector;
CostSelector
Definition: relation.h:35

◆ InheritanceKind

Enumerator
INHKIND_NONE 
INHKIND_INHERITED 
INHKIND_PARTITIONED 

Definition at line 90 of file relation.h.

◆ PartitionwiseAggregateType

Enumerator
PARTITIONWISE_AGGREGATE_NONE 
PARTITIONWISE_AGGREGATE_FULL 
PARTITIONWISE_AGGREGATE_PARTIAL 

Definition at line 2348 of file relation.h.

◆ RelOptKind

enum RelOptKind
Enumerator
RELOPT_BASEREL 
RELOPT_JOINREL 
RELOPT_OTHER_MEMBER_REL 
RELOPT_OTHER_JOINREL 
RELOPT_UPPER_REL 
RELOPT_OTHER_UPPER_REL 
RELOPT_DEADREL 

Definition at line 570 of file relation.h.

◆ UniquePathMethod

Enumerator
UNIQUE_PATH_NOOP 
UNIQUE_PATH_HASH 
UNIQUE_PATH_SORT 

Definition at line 1371 of file relation.h.

1372 {
1373  UNIQUE_PATH_NOOP, /* input is known unique already */
1374  UNIQUE_PATH_HASH, /* use hashing */
1375  UNIQUE_PATH_SORT /* use sorting */
UniquePathMethod
Definition: relation.h:1371

◆ UpperRelationKind

Enumerator
UPPERREL_SETOP 
UPPERREL_PARTIAL_GROUP_AGG 
UPPERREL_GROUP_AGG 
UPPERREL_WINDOW 
UPPERREL_DISTINCT 
UPPERREL_ORDERED 
UPPERREL_FINAL 

Definition at line 72 of file relation.h.

73 {
74  UPPERREL_SETOP, /* result of UNION/INTERSECT/EXCEPT, if any */
75  UPPERREL_PARTIAL_GROUP_AGG, /* result of partial grouping/aggregation, if
76  * any */
77  UPPERREL_GROUP_AGG, /* result of grouping/aggregation, if any */
78  UPPERREL_WINDOW, /* result of window functions, if any */
79  UPPERREL_DISTINCT, /* result of "SELECT DISTINCT", if any */
80  UPPERREL_ORDERED, /* result of ORDER BY, if any */
81  UPPERREL_FINAL /* result of any remaining top-level actions */
82  /* NB: UPPERREL_FINAL must be last enum entry; it's used to size arrays */
UpperRelationKind
Definition: relation.h:72