/usr/include/postgresql/9.6/server/distributed/multi_logical_planner.h is in postgresql-9.6-citus 6.0.1.PGDG-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | /*-------------------------------------------------------------------------
*
* multi_logical_planner.h
* Type declarations for multi-relational algebra operators, and function
* declarations for building logical plans over distributed relations.
*
* Copyright (c) 2012-2016, Citus Data, Inc.
*
* $Id$
*
*-------------------------------------------------------------------------
*/
#ifndef MULTI_LOGICAL_PLANNER_H
#define MULTI_LOGICAL_PLANNER_H
#include "distributed/citus_nodes.h"
#include "distributed/multi_join_order.h"
#include "nodes/nodes.h"
#include "nodes/primnodes.h"
#include "nodes/parsenodes.h"
#include "nodes/pg_list.h"
#define SUBQUERY_RANGE_TABLE_ID -1
#define SUBQUERY_RELATION_ID 10000
#define HEAP_ANALYTICS_SUBQUERY_RELATION_ID 10001
/*
* MultiNode represents the base node type for all multi-relational algebra
* nodes. By creating this base node, we can simulate inheritance and represent
* derived operator nodes as a MultiNode type. A similar structure to simulate
* inheritance is also used in PostgreSQL's plan nodes.
*/
typedef struct MultiNode
{
CitusNode type;
struct MultiNode *parentNode;
/* child node(s) are defined in unary and binary nodes */
} MultiNode;
/* Represents unary nodes that have only one child */
typedef struct MultiUnaryNode
{
MultiNode node;
struct MultiNode *childNode;
} MultiUnaryNode;
/* Represents binary nodes that have two children */
typedef struct MultiBinaryNode
{
MultiNode node;
struct MultiNode *leftChildNode;
struct MultiNode *rightChildNode;
} MultiBinaryNode;
/*
* MultiTreeRoot keeps a pointer to the root node in the multi-relational
* operator tree. This node is always on the top of every logical plan.
*/
typedef struct MultiTreeRoot
{
MultiUnaryNode unaryNode;
} MultiTreeRoot;
/*
* MultiTable represents a partitioned table in a logical query plan. Note that
* this node does not represent a query operator, and differs from the nodes
* that follow in that sense.
*/
typedef struct MultiTable
{
MultiUnaryNode unaryNode;
Oid relationId;
int rangeTableId;
Var *partitionColumn;
Alias *alias;
Alias *referenceNames;
Query *subquery; /* this field is only valid for non-relation subquery types */
} MultiTable;
/* Defines the columns to project in multi-relational algebra */
typedef struct MultiProject
{
MultiUnaryNode unaryNode;
List *columnList;
} MultiProject;
/*
* MultiCollect defines the Collect operator in multi-relational algebra. This
* operator collects data from remote nodes; the collected data are output from
* the query operator that is beneath this Collect in the logical query tree.
*/
typedef struct MultiCollect
{
MultiUnaryNode unaryNode;
} MultiCollect;
/*
* MultiSelect defines the MultiSelect operator in multi-relational algebra.
* This operator contains select predicates which apply to a selected logical
* relation.
*/
typedef struct MultiSelect
{
MultiUnaryNode unaryNode;
List *selectClauseList;
} MultiSelect;
/*
* MultiJoin joins the output of two query operators that are beneath it in the
* query tree. The operator also keeps the join rule that applies between the
* two operators, and the partition key to use if the join is distributed.
*/
typedef struct MultiJoin
{
MultiBinaryNode binaryNode;
List *joinClauseList;
JoinRuleType joinRuleType;
JoinType joinType;
} MultiJoin;
/* Defines the (re-)Partition operator in multi-relational algebra */
typedef struct MultiPartition
{
MultiUnaryNode unaryNode;
Var *partitionColumn;
uint32 splitPointTableId;
} MultiPartition;
/* Defines the CartesianProduct operator in multi-relational algebra */
typedef struct MultiCartesianProduct
{
MultiBinaryNode binaryNode;
} MultiCartesianProduct;
/*
* MultiExtendedOp defines a set of extended operators that operate on columns
* in relational algebra. This node allows us to distinguish between operations
* in the master and worker nodes, and also captures the following:
*
* (1) Aggregate functions such as sums or averages;
* (2) Grouping of attributes; these groupings may also be tied to aggregates;
* (3) Extended projection expressions including columns, arithmetic and string
* functions;
* (4) User's intented display information, such as column display order;
* (5) Sort clauses on columns, expressions, or aggregates; and
* (6) Limit count and offset clause.
*/
typedef struct MultiExtendedOp
{
MultiUnaryNode unaryNode;
List *targetList;
List *groupClauseList;
List *sortClauseList;
Node *limitCount;
Node *limitOffset;
Node *havingQual;
} MultiExtendedOp;
/* Config variables managed via guc.c */
extern bool SubqueryPushdown;
/* Function declarations for building logical plans */
extern MultiTreeRoot * MultiLogicalPlanCreate(Query *queryTree);
extern bool NeedsDistributedPlanning(Query *queryTree);
extern int GetRTEIdentity(RangeTblEntry *rte);
extern void IdentifyRTE(RangeTblEntry *rte, int identifier);
extern MultiNode * ParentNode(MultiNode *multiNode);
extern MultiNode * ChildNode(MultiUnaryNode *multiNode);
extern MultiNode * GrandChildNode(MultiUnaryNode *multiNode);
extern void SetChild(MultiUnaryNode *parent, MultiNode *child);
extern void SetLeftChild(MultiBinaryNode *parent, MultiNode *leftChild);
extern void SetRightChild(MultiBinaryNode *parent, MultiNode *rightChild);
extern bool UnaryOperator(MultiNode *node);
extern bool BinaryOperator(MultiNode *node);
extern List * OutputTableIdList(MultiNode *multiNode);
extern List * FindNodesOfType(MultiNode *node, int type);
extern List * JoinClauseList(List *whereClauseList);
extern bool IsJoinClause(Node *clause);
extern List * SubqueryEntryList(Query *queryTree);
extern bool ExtractRangeTableIndexWalker(Node *node, List **rangeTableIndexList);
extern List * WhereClauseList(FromExpr *fromExpr);
extern List * QualifierList(FromExpr *fromExpr);
extern List * TableEntryList(List *rangeTableList);
extern bool ExtractRangeTableRelationWalker(Node *node, List **rangeTableList);
extern bool ExtractRangeTableEntryWalker(Node *node, List **rangeTableList);
extern List * pull_var_clause_default(Node *node);
extern bool OperatorImplementsEquality(Oid opno);
#endif /* MULTI_LOGICAL_PLANNER_H */
|