PostgreSQL Source Code  git master
pathnodes.h File Reference
#include "access/sdir.h"
#include "lib/stringinfo.h"
#include "nodes/params.h"
#include "nodes/parsenodes.h"
#include "storage/block.h"
Include dependency graph for pathnodes.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  JoinDomain
 
struct  EquivalenceClass
 
struct  EquivalenceMember
 
struct  PathKey
 
struct  PathKeyInfo
 
struct  PathTarget
 
struct  ParamPathInfo
 
struct  Path
 
struct  IndexPath
 
struct  IndexClause
 
struct  BitmapHeapPath
 
struct  BitmapAndPath
 
struct  BitmapOrPath
 
struct  TidPath
 
struct  TidRangePath
 
struct  SubqueryScanPath
 
struct  ForeignPath
 
struct  CustomPath
 
struct  AppendPath
 
struct  MergeAppendPath
 
struct  GroupResultPath
 
struct  MaterialPath
 
struct  MemoizePath
 
struct  UniquePath
 
struct  GatherPath
 
struct  GatherMergePath
 
struct  JoinPath
 
struct  NestPath
 
struct  MergePath
 
struct  HashPath
 
struct  ProjectionPath
 
struct  ProjectSetPath
 
struct  SortPath
 
struct  IncrementalSortPath
 
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  OuterJoinClauseInfo
 
struct  AppendRelInfo
 
struct  RowIdentityVarInfo
 
struct  PlaceHolderInfo
 
struct  MinMaxAggInfo
 
struct  PlannerParamItem
 
struct  SemiAntiJoinFactors
 
struct  JoinPathExtraData
 
struct  GroupPathExtraData
 
struct  FinalPathExtraData
 
struct  JoinCostWorkspace
 
struct  AggInfo
 
struct  AggTransInfo
 
struct  UniqueRelInfo
 

Macros

#define planner_subplan_get_plan(root, subplan)    ((Plan *) list_nth((root)->glob->subplans, (subplan)->plan_id - 1))
 
#define HAVE_PLANNERINFO_TYPEDEF   1
 
#define planner_rt_fetch(rti, root)
 
#define AMFLAG_HAS_TID_RANGE   (1 << 0)
 
#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 HAVE_INDEXOPTINFO_TYPEDEF   1
 
#define EC_MUST_BE_REDUNDANT(eclass)    ((eclass)->ec_has_const)
 
#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_APPEND(p)    (IsA((p), AppendPath) && ((AppendPath *) (p))->subpaths == NIL)
 
#define IS_DUMMY_REL(r)   is_dummy_rel(r)
 
#define RINFO_IS_PUSHED_DOWN(rinfo, joinrelids)
 
#define HAVE_SPECIALJOININFO_TYPEDEF   1
 
#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 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 JoinDomain JoinDomain
 
typedef struct EquivalenceClass EquivalenceClass
 
typedef struct EquivalenceMember EquivalenceMember
 
typedef struct PathKey PathKey
 
typedef struct PathKeyInfo PathKeyInfo
 
typedef enum VolatileFunctionStatus VolatileFunctionStatus
 
typedef struct PathTarget PathTarget
 
typedef struct ParamPathInfo ParamPathInfo
 
typedef struct Path Path
 
typedef struct IndexPath IndexPath
 
typedef struct IndexClause IndexClause
 
typedef struct BitmapHeapPath BitmapHeapPath
 
typedef struct BitmapAndPath BitmapAndPath
 
typedef struct BitmapOrPath BitmapOrPath
 
typedef struct TidPath TidPath
 
typedef struct TidRangePath TidRangePath
 
typedef struct SubqueryScanPath SubqueryScanPath
 
typedef struct ForeignPath ForeignPath
 
typedef struct CustomPath CustomPath
 
typedef struct AppendPath AppendPath
 
typedef struct MergeAppendPath MergeAppendPath
 
typedef struct GroupResultPath GroupResultPath
 
typedef struct MaterialPath MaterialPath
 
typedef struct MemoizePath MemoizePath
 
typedef enum UniquePathMethod UniquePathMethod
 
typedef struct UniquePath UniquePath
 
typedef struct GatherPath GatherPath
 
typedef struct GatherMergePath GatherMergePath
 
typedef struct JoinPath JoinPath
 
typedef struct NestPath NestPath
 
typedef struct MergePath MergePath
 
typedef struct HashPath HashPath
 
typedef struct ProjectionPath ProjectionPath
 
typedef struct ProjectSetPath ProjectSetPath
 
typedef struct SortPath SortPath
 
typedef struct IncrementalSortPath IncrementalSortPath
 
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 OuterJoinClauseInfo OuterJoinClauseInfo
 
typedef struct AppendRelInfo AppendRelInfo
 
typedef struct RowIdentityVarInfo RowIdentityVarInfo
 
typedef struct PlaceHolderInfo PlaceHolderInfo
 
typedef struct MinMaxAggInfo MinMaxAggInfo
 
typedef struct PlannerParamItem PlannerParamItem
 
typedef struct SemiAntiJoinFactors SemiAntiJoinFactors
 
typedef struct JoinPathExtraData JoinPathExtraData
 
typedef struct JoinCostWorkspace JoinCostWorkspace
 
typedef struct AggInfo AggInfo
 
typedef struct AggTransInfo AggTransInfo
 
typedef struct UniqueRelInfo UniqueRelInfo
 

Enumerations

enum  CostSelector { STARTUP_COST , TOTAL_COST }
 
enum  UpperRelationKind {
  UPPERREL_SETOP , UPPERREL_PARTIAL_GROUP_AGG , UPPERREL_GROUP_AGG , UPPERREL_WINDOW ,
  UPPERREL_PARTIAL_DISTINCT , UPPERREL_DISTINCT , UPPERREL_ORDERED , UPPERREL_FINAL
}
 
enum  RelOptKind {
  RELOPT_BASEREL , RELOPT_JOINREL , RELOPT_OTHER_MEMBER_REL , RELOPT_OTHER_JOINREL ,
  RELOPT_UPPER_REL , RELOPT_OTHER_UPPER_REL
}
 
enum  VolatileFunctionStatus { VOLATILITY_UNKNOWN = 0 , VOLATILITY_VOLATILE , VOLATILITY_NOVOLATILE }
 
enum  UniquePathMethod { UNIQUE_PATH_NOOP , UNIQUE_PATH_HASH , UNIQUE_PATH_SORT }
 
enum  PartitionwiseAggregateType { PARTITIONWISE_AGGREGATE_NONE , PARTITIONWISE_AGGREGATE_FULL , PARTITIONWISE_AGGREGATE_PARTIAL }
 

Functions

bool is_dummy_rel (RelOptInfo *rel)
 

Macro Definition Documentation

◆ AMFLAG_HAS_TID_RANGE

#define AMFLAG_HAS_TID_RANGE   (1 << 0)

Definition at line 808 of file pathnodes.h.

◆ EC_MUST_BE_REDUNDANT

#define EC_MUST_BE_REDUNDANT (   eclass)     ((eclass)->ec_has_const)

Definition at line 1390 of file pathnodes.h.

◆ get_pathtarget_sortgroupref

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

Definition at line 1529 of file pathnodes.h.

◆ GROUPING_CAN_PARTIAL_AGG

#define GROUPING_CAN_PARTIAL_AGG   0x0004

Definition at line 3229 of file pathnodes.h.

◆ GROUPING_CAN_USE_HASH

#define GROUPING_CAN_USE_HASH   0x0002

Definition at line 3228 of file pathnodes.h.

◆ GROUPING_CAN_USE_SORT

#define GROUPING_CAN_USE_SORT   0x0001

Definition at line 3227 of file pathnodes.h.

◆ HAVE_INDEXOPTINFO_TYPEDEF

#define HAVE_INDEXOPTINFO_TYPEDEF   1

Definition at line 1088 of file pathnodes.h.

◆ HAVE_PLANNERINFO_TYPEDEF

#define HAVE_PLANNERINFO_TYPEDEF   1

Definition at line 189 of file pathnodes.h.

◆ HAVE_SPECIALJOININFO_TYPEDEF

#define HAVE_SPECIALJOININFO_TYPEDEF   1

Definition at line 2860 of file pathnodes.h.

◆ IS_DUMMY_APPEND

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

Definition at line 1918 of file pathnodes.h.

◆ IS_DUMMY_REL

#define IS_DUMMY_REL (   r)    is_dummy_rel(r)

Definition at line 1926 of file pathnodes.h.

◆ IS_JOIN_REL

#define IS_JOIN_REL (   rel)
Value:
((rel)->reloptkind == RELOPT_JOINREL || \
(rel)->reloptkind == RELOPT_OTHER_JOINREL)
@ RELOPT_JOINREL
Definition: pathnodes.h:813
@ RELOPT_OTHER_JOINREL
Definition: pathnodes.h:815

Definition at line 829 of file pathnodes.h.

◆ IS_OTHER_REL

#define IS_OTHER_REL (   rel)
Value:
((rel)->reloptkind == RELOPT_OTHER_MEMBER_REL || \
(rel)->reloptkind == RELOPT_OTHER_JOINREL || \
(rel)->reloptkind == RELOPT_OTHER_UPPER_REL)
@ RELOPT_OTHER_MEMBER_REL
Definition: pathnodes.h:814
@ RELOPT_OTHER_UPPER_REL
Definition: pathnodes.h:817

Definition at line 839 of file pathnodes.h.

◆ 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: pathnodes.h:1926

Definition at line 1043 of file pathnodes.h.

◆ IS_SIMPLE_REL

#define IS_SIMPLE_REL (   rel)
Value:
((rel)->reloptkind == RELOPT_BASEREL || \
(rel)->reloptkind == RELOPT_OTHER_MEMBER_REL)
@ RELOPT_BASEREL
Definition: pathnodes.h:812

Definition at line 824 of file pathnodes.h.

◆ IS_UPPER_REL

#define IS_UPPER_REL (   rel)
Value:
((rel)->reloptkind == RELOPT_UPPER_REL || \
(rel)->reloptkind == RELOPT_OTHER_UPPER_REL)
@ RELOPT_UPPER_REL
Definition: pathnodes.h:816

Definition at line 834 of file pathnodes.h.

◆ PATH_REQ_OUTER

#define PATH_REQ_OUTER (   path)     ((path)->param_info ? (path)->param_info->ppi_req_outer : (Relids) NULL)

Definition at line 1649 of file pathnodes.h.

◆ planner_rt_fetch

#define planner_rt_fetch (   rti,
  root 
)
Value:
((root)->simple_rte_array ? (root)->simple_rte_array[rti] : \
rt_fetch(rti, (root)->parse->rtable))
static struct subre * parse(struct vars *v, int stopper, int type, struct state *init, struct state *final)
Definition: regcomp.c:715

Definition at line 555 of file pathnodes.h.

◆ planner_subplan_get_plan

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

Definition at line 166 of file pathnodes.h.

◆ 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 1051 of file pathnodes.h.

◆ RINFO_IS_PUSHED_DOWN

#define RINFO_IS_PUSHED_DOWN (   rinfo,
  joinrelids 
)
Value:
((rinfo)->is_pushed_down || \
!bms_is_subset((rinfo)->required_relids, joinrelids))
bool bms_is_subset(const Bitmapset *a, const Bitmapset *b)
Definition: bitmapset.c:412

Definition at line 2698 of file pathnodes.h.

Typedef Documentation

◆ AggClauseCosts

◆ AggInfo

typedef struct AggInfo AggInfo

◆ AggPath

typedef struct AggPath AggPath

◆ AggTransInfo

typedef struct AggTransInfo AggTransInfo

◆ AppendPath

typedef struct AppendPath AppendPath

◆ AppendRelInfo

typedef struct AppendRelInfo AppendRelInfo

◆ BitmapAndPath

typedef struct BitmapAndPath BitmapAndPath

◆ BitmapHeapPath

◆ BitmapOrPath

typedef struct BitmapOrPath BitmapOrPath

◆ CostSelector

typedef enum CostSelector CostSelector

◆ CustomPath

typedef struct CustomPath CustomPath

◆ EquivalenceClass

◆ EquivalenceMember

◆ ForeignKeyOptInfo

◆ ForeignPath

typedef struct ForeignPath ForeignPath

◆ GatherMergePath

◆ GatherPath

typedef struct GatherPath GatherPath

◆ GroupingSetData

◆ GroupingSetsPath

◆ GroupPath

typedef struct GroupPath GroupPath

◆ GroupResultPath

◆ HashPath

typedef struct HashPath HashPath

◆ IncrementalSortPath

◆ IndexClause

typedef struct IndexClause IndexClause

◆ IndexOptInfo

typedef struct IndexOptInfo IndexOptInfo

Definition at line 589 of file pathnodes.h.

◆ IndexPath

typedef struct IndexPath IndexPath

◆ JoinCostWorkspace

◆ JoinDomain

typedef struct JoinDomain JoinDomain

◆ JoinPath

typedef struct JoinPath JoinPath

◆ JoinPathExtraData

◆ LimitPath

typedef struct LimitPath LimitPath

◆ LockRowsPath

typedef struct LockRowsPath LockRowsPath

◆ MaterialPath

typedef struct MaterialPath MaterialPath

◆ MemoizePath

typedef struct MemoizePath MemoizePath

◆ MergeAppendPath

◆ MergePath

typedef struct MergePath MergePath

◆ MergeScanSelCache

◆ MinMaxAggInfo

typedef struct MinMaxAggInfo MinMaxAggInfo

◆ MinMaxAggPath

typedef struct MinMaxAggPath MinMaxAggPath

◆ ModifyTablePath

◆ NestPath

typedef struct NestPath NestPath

◆ OuterJoinClauseInfo

◆ ParamPathInfo

typedef struct ParamPathInfo ParamPathInfo

◆ PartitionScheme

Definition at line 589 of file pathnodes.h.

◆ PartitionSchemeData

◆ Path

typedef struct Path Path

◆ PathKey

typedef struct PathKey PathKey

◆ PathKeyInfo

typedef struct PathKeyInfo PathKeyInfo

◆ PathTarget

typedef struct PathTarget PathTarget

◆ PlaceHolderInfo

◆ PlaceHolderVar

◆ PlannerGlobal

typedef struct PlannerGlobal PlannerGlobal

◆ PlannerInfo

typedef struct PlannerInfo PlannerInfo

Definition at line 30 of file pathnodes.h.

◆ PlannerParamItem

◆ ProjectionPath

◆ ProjectSetPath

◆ QualCost

typedef struct QualCost QualCost

◆ RecursiveUnionPath

◆ Relids

typedef Bitmapset* Relids

Definition at line 30 of file pathnodes.h.

◆ RelOptInfo

typedef struct RelOptInfo RelOptInfo

◆ RelOptKind

typedef enum RelOptKind RelOptKind

◆ RestrictInfo

typedef struct RestrictInfo RestrictInfo

◆ RollupData

typedef struct RollupData RollupData

◆ RowIdentityVarInfo

◆ SemiAntiJoinFactors

◆ SetOpPath

typedef struct SetOpPath SetOpPath

◆ SortPath

typedef struct SortPath SortPath

◆ SpecialJoinInfo

Definition at line 1927 of file pathnodes.h.

◆ StatisticExtInfo

◆ SubqueryScanPath

◆ TidPath

typedef struct TidPath TidPath

◆ TidRangePath

typedef struct TidRangePath TidRangePath

◆ UniquePath

typedef struct UniquePath UniquePath

◆ UniquePathMethod

◆ UniqueRelInfo

typedef struct UniqueRelInfo UniqueRelInfo

◆ UpperRelationKind

◆ UpperUniquePath

◆ VolatileFunctionStatus

◆ WindowAggPath

typedef struct WindowAggPath WindowAggPath

Enumeration Type Documentation

◆ CostSelector

Enumerator
STARTUP_COST 
TOTAL_COST 

Definition at line 36 of file pathnodes.h.

37 {
39 } CostSelector;
CostSelector
Definition: pathnodes.h:37
@ TOTAL_COST
Definition: pathnodes.h:38
@ STARTUP_COST
Definition: pathnodes.h:38

◆ PartitionwiseAggregateType

Enumerator
PARTITIONWISE_AGGREGATE_NONE 
PARTITIONWISE_AGGREGATE_FULL 
PARTITIONWISE_AGGREGATE_PARTIAL 

Definition at line 3242 of file pathnodes.h.

3243 {
PartitionwiseAggregateType
Definition: pathnodes.h:3243
@ PARTITIONWISE_AGGREGATE_PARTIAL
Definition: pathnodes.h:3246
@ PARTITIONWISE_AGGREGATE_FULL
Definition: pathnodes.h:3245
@ PARTITIONWISE_AGGREGATE_NONE
Definition: pathnodes.h:3244

◆ RelOptKind

enum RelOptKind
Enumerator
RELOPT_BASEREL 
RELOPT_JOINREL 
RELOPT_OTHER_MEMBER_REL 
RELOPT_OTHER_JOINREL 
RELOPT_UPPER_REL 
RELOPT_OTHER_UPPER_REL 

Definition at line 810 of file pathnodes.h.

◆ UniquePathMethod

Enumerator
UNIQUE_PATH_NOOP 
UNIQUE_PATH_HASH 
UNIQUE_PATH_SORT 

Definition at line 1998 of file pathnodes.h.

1999 {
2000  UNIQUE_PATH_NOOP, /* input is known unique already */
2001  UNIQUE_PATH_HASH, /* use hashing */
2002  UNIQUE_PATH_SORT, /* use sorting */
UniquePathMethod
Definition: pathnodes.h:1999
@ UNIQUE_PATH_SORT
Definition: pathnodes.h:2002
@ UNIQUE_PATH_NOOP
Definition: pathnodes.h:2000
@ UNIQUE_PATH_HASH
Definition: pathnodes.h:2001

◆ UpperRelationKind

Enumerator
UPPERREL_SETOP 
UPPERREL_PARTIAL_GROUP_AGG 
UPPERREL_GROUP_AGG 
UPPERREL_WINDOW 
UPPERREL_PARTIAL_DISTINCT 
UPPERREL_DISTINCT 
UPPERREL_ORDERED 
UPPERREL_FINAL 

Definition at line 69 of file pathnodes.h.

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

◆ VolatileFunctionStatus

Enumerator
VOLATILITY_UNKNOWN 
VOLATILITY_VOLATILE 
VOLATILITY_NOVOLATILE 

Definition at line 1476 of file pathnodes.h.

1477 {
1478  VOLATILITY_UNKNOWN = 0,
VolatileFunctionStatus
Definition: pathnodes.h:1477
@ VOLATILITY_NOVOLATILE
Definition: pathnodes.h:1480
@ VOLATILITY_UNKNOWN
Definition: pathnodes.h:1478
@ VOLATILITY_VOLATILE
Definition: pathnodes.h:1479

Function Documentation

◆ is_dummy_rel()

bool is_dummy_rel ( RelOptInfo rel)

Definition at line 1314 of file joinrels.c.

1315 {
1316  Path *path;
1317 
1318  /*
1319  * A rel that is known dummy will have just one path that is a childless
1320  * Append. (Even if somehow it has more paths, a childless Append will
1321  * have cost zero and hence should be at the front of the pathlist.)
1322  */
1323  if (rel->pathlist == NIL)
1324  return false;
1325  path = (Path *) linitial(rel->pathlist);
1326 
1327  /*
1328  * Initially, a dummy path will just be a childless Append. But in later
1329  * planning stages we might stick a ProjectSetPath and/or ProjectionPath
1330  * on top, since Append can't project. Rather than make assumptions about
1331  * which combinations can occur, just descend through whatever we find.
1332  */
1333  for (;;)
1334  {
1335  if (IsA(path, ProjectionPath))
1336  path = ((ProjectionPath *) path)->subpath;
1337  else if (IsA(path, ProjectSetPath))
1338  path = ((ProjectSetPath *) path)->subpath;
1339  else
1340  break;
1341  }
1342  if (IS_DUMMY_APPEND(path))
1343  return true;
1344  return false;
1345 }
Datum subpath(PG_FUNCTION_ARGS)
Definition: ltree_op.c:241
#define IsA(nodeptr, _type_)
Definition: nodes.h:158
#define IS_DUMMY_APPEND(p)
Definition: pathnodes.h:1918
#define NIL
Definition: pg_list.h:68
#define linitial(l)
Definition: pg_list.h:178
List * pathlist
Definition: pathnodes.h:883

References IS_DUMMY_APPEND, IsA, linitial, NIL, RelOptInfo::pathlist, and subpath().

Referenced by make_join_rel(), mark_dummy_rel(), and populate_joinrel_with_paths().