diff options
Diffstat (limited to 'src/include/nodes')
-rw-r--r-- | src/include/nodes/execnodes.h | 10 | ||||
-rw-r--r-- | src/include/nodes/makefuncs.h | 4 | ||||
-rw-r--r-- | src/include/nodes/nodes.h | 5 | ||||
-rw-r--r-- | src/include/nodes/parsenodes.h | 130 | ||||
-rw-r--r-- | src/include/nodes/pg_list.h | 8 | ||||
-rw-r--r-- | src/include/nodes/plannodes.h | 29 | ||||
-rw-r--r-- | src/include/nodes/primnodes.h | 48 | ||||
-rw-r--r-- | src/include/nodes/relation.h | 89 |
8 files changed, 175 insertions, 148 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 827bb75a9c8..044cee23eab 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: execnodes.h,v 1.40 2000/01/27 18:11:44 tgl Exp $ + * $Id: execnodes.h,v 1.41 2000/04/12 17:16:39 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -89,7 +89,7 @@ typedef struct ExprContext ParamListInfo ecxt_param_list_info; ParamExecData *ecxt_param_exec_vals; /* this is for subselects */ List *ecxt_range_table; - Datum *ecxt_aggvalues; /* precomputed values for Aggref nodes */ + Datum *ecxt_aggvalues; /* precomputed values for Aggref nodes */ bool *ecxt_aggnulls; /* null flags for Aggref nodes */ } ExprContext; @@ -443,8 +443,8 @@ typedef struct TidScanState int tss_NumTids; int tss_TidPtr; int tss_MarkTidPtr; - ItemPointer *tss_TidList; - HeapTupleData tss_htup; + ItemPointer *tss_TidList; + HeapTupleData tss_htup; } TidScanState; /* ---------------------------------------------------------------- @@ -602,7 +602,7 @@ typedef struct MaterialState * during evaluation of an Agg node's output tuple(s). * ------------------------- */ -typedef struct AggStatePerAggData *AggStatePerAgg; /* private in nodeAgg.c */ +typedef struct AggStatePerAggData *AggStatePerAgg; /* private in nodeAgg.c */ typedef struct AggState { diff --git a/src/include/nodes/makefuncs.h b/src/include/nodes/makefuncs.h index f934eb5e63a..3b470b150a2 100644 --- a/src/include/nodes/makefuncs.h +++ b/src/include/nodes/makefuncs.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: makefuncs.h,v 1.23 2000/02/15 03:38:13 thomas Exp $ + * $Id: makefuncs.h,v 1.24 2000/04/12 17:16:40 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -47,6 +47,6 @@ extern Const *makeConst(Oid consttype, bool constiscast); extern Attr * -makeAttr(char *relname, char *attname); + makeAttr(char *relname, char *attname); #endif /* MAKEFUNC_H */ diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index f42f615c7a6..a8fe032ba51 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: nodes.h,v 1.66 2000/02/20 21:32:16 tgl Exp $ + * $Id: nodes.h,v 1.67 2000/04/12 17:16:40 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -301,7 +301,8 @@ extern bool equal(void *a, void *b); * These could have gone into plannodes.h or some such, but many files * depend on them... */ -typedef double Selectivity; /* fraction of tuples a qualifier will pass */ +typedef double Selectivity; /* fraction of tuples a qualifier will + * pass */ typedef double Cost; /* execution cost (in page-access units) */ diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index cbbe77c333a..15c370a64a6 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: parsenodes.h,v 1.103 2000/03/24 23:26:45 tgl Exp $ + * $Id: parsenodes.h,v 1.104 2000/04/12 17:16:40 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -54,7 +54,7 @@ typedef struct Query Node *qual; /* qualifications applied to tuples */ List *rowMark; /* list of RowMark entries */ - List *distinctClause; /* a list of SortClause's */ + List *distinctClause; /* a list of SortClause's */ List *sortClause; /* a list of SortClause's */ @@ -72,7 +72,8 @@ typedef struct Query /* internal to planner */ List *base_rel_list; /* list of base-relation RelOptInfos */ List *join_rel_list; /* list of join-relation RelOptInfos */ - List *equi_key_list; /* list of lists of equijoined PathKeyItems */ + List *equi_key_list; /* list of lists of equijoined + * PathKeyItems */ List *query_pathkeys; /* pathkeys for query_planner()'s result */ } Query; @@ -94,12 +95,13 @@ typedef struct Query typedef struct AlterTableStmt { NodeTag type; - char subtype; /* A = add, T = alter, D = drop, C = add constr, X = drop constr */ - char *relname; /* table to work on */ + char subtype; /* A = add, T = alter, D = drop, C = add + * constr, X = drop constr */ + char *relname; /* table to work on */ bool inh; /* recursively on children? */ - char *name; /* column or constraint name to act on */ - Node *def; /* definition of new column or constraint */ - int behavior; /* CASCADE or RESTRICT drop behavior */ + char *name; /* column or constraint name to act on */ + Node *def; /* definition of new column or constraint */ + int behavior; /* CASCADE or RESTRICT drop behavior */ } AlterTableStmt; /* ---------------------- @@ -137,7 +139,7 @@ typedef struct CopyStmt int direction; /* TO or FROM */ char *filename; /* if NULL, use stdin/stdout */ char *delimiter; /* delimiter character, \t by default */ - char *null_print; /* how to print NULLs, `\N' by default */ + char *null_print; /* how to print NULLs, `\N' by default */ } CopyStmt; /* ---------------------- @@ -177,7 +179,8 @@ typedef struct CreateStmt typedef enum ConstrType /* types of constraints */ { - CONSTR_NULL, /* not SQL92, but a lot of people expect it */ + CONSTR_NULL, /* not SQL92, but a lot of people expect + * it */ CONSTR_NOTNULL, CONSTR_DEFAULT, CONSTR_CHECK, @@ -219,14 +222,14 @@ typedef struct Constraint typedef struct FkConstraint { NodeTag type; - char *constr_name; /* Constraint name */ - char *pktable_name; /* Primary key table name */ - List *fk_attrs; /* Attributes of foreign key */ - List *pk_attrs; /* Corresponding attrs in PK table */ - char *match_type; /* FULL or PARTIAL */ - int32 actions; /* ON DELETE/UPDATE actions */ - bool deferrable; /* DEFERRABLE */ - bool initdeferred; /* INITIALLY DEFERRED */ + char *constr_name; /* Constraint name */ + char *pktable_name; /* Primary key table name */ + List *fk_attrs; /* Attributes of foreign key */ + List *pk_attrs; /* Corresponding attrs in PK table */ + char *match_type; /* FULL or PARTIAL */ + int32 actions; /* ON DELETE/UPDATE actions */ + bool deferrable; /* DEFERRABLE */ + bool initdeferred; /* INITIALLY DEFERRED */ } FkConstraint; @@ -250,8 +253,8 @@ typedef struct CreateTrigStmt List *attr; /* UPDATE OF a, b,... (NI) or NULL */ char *when; /* WHEN 'a > 10 ...' (NI) or NULL */ - /* The following are used for referential */ - /* integrity constraint triggers */ + /* The following are used for referential */ + /* integrity constraint triggers */ bool isconstraint; /* This is an RI trigger */ bool deferrable; /* [NOT] DEFERRABLE */ bool initdeferred; /* INITIALLY {DEFERRED|IMMEDIATE} */ @@ -295,9 +298,9 @@ typedef struct CreateUserStmt NodeTag type; char *user; /* PostgreSQL user login */ char *password; /* PostgreSQL user password */ - int sysid; /* PgSQL system id (-1 if don't care) */ - bool createdb; /* Can the user create databases? */ - bool createuser; /* Can this user create users? */ + int sysid; /* PgSQL system id (-1 if don't care) */ + bool createdb; /* Can the user create databases? */ + bool createuser; /* Can this user create users? */ List *groupElts; /* The groups the user is a member of */ char *validUntil; /* The time the login is valid until */ } CreateUserStmt; @@ -307,43 +310,43 @@ typedef struct AlterUserStmt NodeTag type; char *user; /* PostgreSQL user login */ char *password; /* PostgreSQL user password */ - int createdb; /* Can the user create databases? */ - int createuser; /* Can this user create users? */ + int createdb; /* Can the user create databases? */ + int createuser; /* Can this user create users? */ char *validUntil; /* The time the login is valid until */ } AlterUserStmt; typedef struct DropUserStmt { NodeTag type; - List *users; /* List of users to remove */ + List *users; /* List of users to remove */ } DropUserStmt; /* ---------------------- - * Create/Alter/Drop Group Statements + * Create/Alter/Drop Group Statements * ---------------------- */ typedef struct CreateGroupStmt { - NodeTag type; - char *name; /* name of the new group */ - int sysid; /* group id (-1 if pick default) */ - List *initUsers; /* list of initial users */ + NodeTag type; + char *name; /* name of the new group */ + int sysid; /* group id (-1 if pick default) */ + List *initUsers; /* list of initial users */ } CreateGroupStmt; typedef struct AlterGroupStmt { - NodeTag type; - char *name; /* name of group to alter */ - int action; /* +1 = add, -1 = drop user */ - int sysid; /* sysid change */ - List *listUsers; /* list of users to add/drop */ + NodeTag type; + char *name; /* name of group to alter */ + int action; /* +1 = add, -1 = drop user */ + int sysid; /* sysid change */ + List *listUsers; /* list of users to add/drop */ } AlterGroupStmt; typedef struct DropGroupStmt { - NodeTag type; - char *name; + NodeTag type; + char *name; } DropGroupStmt; @@ -396,29 +399,29 @@ typedef struct DropStmt } DropStmt; /* ---------------------- - * Truncate Table Statement + * Truncate Table Statement * ---------------------- */ typedef struct TruncateStmt { - NodeTag type; - char *relName; /* relation to be truncated */ + NodeTag type; + char *relName; /* relation to be truncated */ } TruncateStmt; /* ---------------------- - * Comment On Statement + * Comment On Statement * ---------------------- */ typedef struct CommentStmt { - NodeTag type; - int objtype; /* Object's type */ - char *objname; /* Name of the object */ - char *objproperty; /* Property Id (such as column) */ - List *objlist; /* Arguments for VAL objects */ - char *comment; /* The comment to insert */ + NodeTag type; + int objtype; /* Object's type */ + char *objname; /* Name of the object */ + char *objproperty; /* Property Id (such as column) */ + List *objlist; /* Arguments for VAL objects */ + char *comment; /* The comment to insert */ } CommentStmt; - + /* ---------------------- * Extend Index Statement * ---------------------- @@ -738,7 +741,7 @@ typedef struct LockStmt typedef struct ConstraintsSetStmt { NodeTag type; - List *constraints; + List *constraints; bool deferred; } ConstraintsSetStmt; @@ -749,8 +752,8 @@ typedef struct ConstraintsSetStmt typedef struct ReindexStmt { NodeTag type; - int reindexType; /* INDEX|TABLE|DATABASE */ - const char *name; /* name to reindex */ + int reindexType; /* INDEX|TABLE|DATABASE */ + const char *name; /* name to reindex */ bool force; bool all; } ReindexStmt; @@ -768,8 +771,9 @@ typedef struct InsertStmt { NodeTag type; char *relname; /* relation to insert into */ - List *distinctClause; /* NULL, list of DISTINCT ON exprs, or - * lcons(NIL,NIL) for all (SELECT DISTINCT) */ + List *distinctClause; /* NULL, list of DISTINCT ON exprs, or + * lcons(NIL,NIL) for all (SELECT + * DISTINCT) */ List *cols; /* names of the columns */ List *targetList; /* the target list (of ResTarget) */ List *fromClause; /* the from clause */ @@ -813,8 +817,9 @@ typedef struct UpdateStmt typedef struct SelectStmt { NodeTag type; - List *distinctClause; /* NULL, list of DISTINCT ON exprs, or - * lcons(NIL,NIL) for all (SELECT DISTINCT) */ + List *distinctClause; /* NULL, list of DISTINCT ON exprs, or + * lcons(NIL,NIL) for all (SELECT + * DISTINCT) */ char *into; /* name of table (for select into table) */ List *targetList; /* the target list (of ResTarget) */ List *fromClause; /* the from clause */ @@ -839,7 +844,7 @@ typedef struct SelectStmt * Supporting data structures for Parse Trees * * Most of these node types appear in raw parsetrees output by the grammar, - * and get transformed to something else by the analyzer. A few of them + * and get transformed to something else by the analyzer. A few of them * are used as-is in transformed querytrees. ****************************************************************************/ @@ -951,7 +956,7 @@ typedef struct CaseWhen * in either "raw" form (an untransformed parse tree) or "cooked" form * (the nodeToString representation of an executable expression tree), * depending on how this ColumnDef node was created (by parsing, or by - * inheritance from an existing relation). We should never have both + * inheritance from an existing relation). We should never have both * in the same node! * * The constraints list may contain a CONSTR_DEFAULT item in a raw @@ -966,8 +971,9 @@ typedef struct ColumnDef TypeName *typename; /* type of column */ bool is_not_null; /* flag to NOT NULL constraint */ bool is_sequence; /* is a sequence? */ - Node *raw_default; /* default value (untransformed parse tree) */ - char *cooked_default; /* nodeToString representation */ + Node *raw_default; /* default value (untransformed parse + * tree) */ + char *cooked_default; /* nodeToString representation */ List *constraints; /* other constraints on column */ } ColumnDef; @@ -1141,7 +1147,7 @@ typedef struct TargetEntry * inFromCl marks those range variables that are listed in the FROM clause. * In SQL, the query can only refer to range variables listed in the * FROM clause, but POSTQUEL allows you to refer to tables not listed, - * in which case a range table entry will be generated. We still support + * in which case a range table entry will be generated. We still support * this POSTQUEL feature, although there is some doubt whether it's * convenient or merely confusing. The flag is needed since an * implicitly-added RTE shouldn't change the namespace for unqualified @@ -1156,7 +1162,7 @@ typedef struct TargetEntry * Here we should get the product of the sizes of tx and ty. However, * the query optimizer can simplify the WHERE clause to "TRUE", so * ty will no longer be referred to explicitly; without a flag forcing - * it to be included in the join, we will get the wrong answer. So, + * it to be included in the join, we will get the wrong answer. So, * a POSTQUEL implicit RTE must be marked inJoinSet but not inFromCl. *-------------------- */ diff --git a/src/include/nodes/pg_list.h b/src/include/nodes/pg_list.h index 9f05bc7985f..c68f0659fa1 100644 --- a/src/include/nodes/pg_list.h +++ b/src/include/nodes/pg_list.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_list.h,v 1.16 2000/02/21 18:47:12 tgl Exp $ + * $Id: pg_list.h,v 1.17 2000/04/12 17:16:40 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -27,12 +27,12 @@ * The same Value struct is used for three node types: T_Integer, * T_Float, and T_String. Integral values are actually represented * by a machine integer, but both floats and strings are represented - * as strings. Using T_Float as the node type simply indicates that + * as strings. Using T_Float as the node type simply indicates that * the contents of the string look like a valid numeric literal. * * (Before Postgres 7.0, we used a double to represent T_Float, * but that creates loss-of-precision problems when the value is - * ultimately destined to be converted to NUMERIC. Since Value nodes + * ultimately destined to be converted to NUMERIC. Since Value nodes * are only used in the parsing process, not for runtime data, it's * better to use the more general representation.) * @@ -105,7 +105,7 @@ extern bool intMember(int datum, List *list); extern Value *makeInteger(long i); extern Value *makeFloat(char *numericStr); extern Value *makeString(char *str); -extern List *makeList(void *elem, ...); +extern List *makeList(void *elem,...); extern List *lappend(List *list, void *datum); extern List *lappendi(List *list, int datum); extern List *lremove(void *elem, List *list); diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h index 2731c57948c..1cab6e03fc0 100644 --- a/src/include/nodes/plannodes.h +++ b/src/include/nodes/plannodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: plannodes.h,v 1.38 2000/02/15 20:49:25 tgl Exp $ + * $Id: plannodes.h,v 1.39 2000/04/12 17:16:40 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -66,10 +66,13 @@ typedef struct Plan NodeTag type; /* estimated execution costs for plan (see costsize.c for more info) */ - Cost startup_cost; /* cost expended before fetching any tuples */ - Cost total_cost; /* total cost (assuming all tuples fetched) */ + Cost startup_cost; /* cost expended before fetching any + * tuples */ + Cost total_cost; /* total cost (assuming all tuples + * fetched) */ - /* planner's estimate of result size (note: LIMIT, if any, is not + /* + * planner's estimate of result size (note: LIMIT, if any, is not * considered in setting plan_rows) */ double plan_rows; /* number of rows plan is expected to emit */ @@ -183,12 +186,12 @@ typedef struct IndexScan List *indxid; List *indxqual; List *indxqualorig; - ScanDirection indxorderdir; + ScanDirection indxorderdir; IndexScanState *indxstate; } IndexScan; /* ---------------- - * tid scan node + * tid scan node * ---------------- */ typedef struct TidScan @@ -199,7 +202,7 @@ typedef struct TidScan TidScanState *tidstate; } TidScan; -/* +/* * ========== * Join nodes * ========== @@ -319,7 +322,8 @@ typedef struct Unique Plan plan; /* noname node flattened out */ Oid nonameid; int keycount; - int numCols; /* number of columns to check for uniqueness */ + int numCols; /* number of columns to check for + * uniqueness */ AttrNumber *uniqColIdx; /* indexes into the target list */ UniqueState *uniquestate; } Unique; @@ -375,10 +379,13 @@ typedef struct SubPlan List *setParam; /* non-correlated EXPR & EXISTS subqueries * have to set some Params for paren Plan */ List *parParam; /* indices of corr. Vars from parent plan */ - SubLink *sublink; /* SubLink node from parser; holds info about - * what to do with subselect's results */ + SubLink *sublink; /* SubLink node from parser; holds info + * about what to do with subselect's + * results */ + /* - * Remaining fields are working state for executor; not used in planning + * Remaining fields are working state for executor; not used in + * planning */ bool shutdown; /* TRUE = need to shutdown plan */ HeapTuple curTuple; /* copy of most recent tuple from subplan */ diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h index 7c3e0c6c4b8..926513e0af2 100644 --- a/src/include/nodes/primnodes.h +++ b/src/include/nodes/primnodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: primnodes.h,v 1.40 2000/02/20 21:32:16 tgl Exp $ + * $Id: primnodes.h,v 1.41 2000/04/12 17:16:40 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -29,7 +29,7 @@ * restype - type of the value * restypmod - type-specific modifier of the value * resname - name of the resdom (could be NULL) - * ressortgroupref - nonzero if referenced by a sort/group clause + * ressortgroupref - nonzero if referenced by a sort/group clause * reskey - order of key in a sort (for those > 0) * reskeyop - sort operator's regproc Oid * resjunk - set to true to eliminate the attribute @@ -37,12 +37,12 @@ * * Notes: * ressortgroupref is the parse/plan-time representation of ORDER BY and - * GROUP BY items. Targetlist entries with ressortgroupref=0 are not + * GROUP BY items. Targetlist entries with ressortgroupref=0 are not * sort/group items. If ressortgroupref>0, then this item is an ORDER BY or - * GROUP BY value. No two entries in a targetlist may have the same nonzero + * GROUP BY value. No two entries in a targetlist may have the same nonzero * ressortgroupref --- but there is no particular meaning to the nonzero - * values, except as tags. (For example, one must not assume that lower - * ressortgroupref means a more significant sort key.) The order of the + * values, except as tags. (For example, one must not assume that lower + * ressortgroupref means a more significant sort key.) The order of the * associated SortClause or GroupClause lists determine the semantics. * * reskey and reskeyop are the execution-time representation of sorting. @@ -329,7 +329,7 @@ typedef struct Aggref * subselect - subselect as Query* or parsetree * * A SubLink represents a subselect appearing in an expression, and in some - * cases also the combining operator(s) just above it. The subLinkType + * cases also the combining operator(s) just above it. The subLinkType * indicates the form of the expression represented: * EXISTS_SUBLINK EXISTS(SELECT ...) * ALL_SUBLINK (lefthand) op ALL (SELECT ...) @@ -350,21 +350,21 @@ typedef struct Aggref * NOTE: lefthand and oper have varying meanings depending on where you look * in the parse/plan pipeline: * 1. gram.y delivers a list of the (untransformed) lefthand expressions in - * lefthand, and sets oper to a one-element list containing the string - * name of the operator. + * lefthand, and sets oper to a one-element list containing the string + * name of the operator. * 2. The parser's expression transformation transforms lefthand normally, - * and replaces oper with a list of Oper nodes, one per lefthand - * expression. These nodes represent the parser's resolution of exactly - * which operator to apply to each pair of lefthand and targetlist - * expressions. However, we have not constructed actual Expr trees for - * these operators yet. This is the representation seen in saved rules - * and in the rewriter. + * and replaces oper with a list of Oper nodes, one per lefthand + * expression. These nodes represent the parser's resolution of exactly + * which operator to apply to each pair of lefthand and targetlist + * expressions. However, we have not constructed actual Expr trees for + * these operators yet. This is the representation seen in saved rules + * and in the rewriter. * 3. Finally, the planner converts the oper list to a list of normal Expr - * nodes representing the application of the operator(s) to the lefthand - * expressions and values from the inner targetlist. The inner - * targetlist items are represented by placeholder Param or Const nodes. - * The lefthand field is set to NIL, since its expressions are now in - * the Expr list. This representation is passed to the executor. + * nodes representing the application of the operator(s) to the lefthand + * expressions and values from the inner targetlist. The inner + * targetlist items are represented by placeholder Param or Const nodes. + * The lefthand field is set to NIL, since its expressions are now in + * the Expr list. This representation is passed to the executor. * * Planner routines that might see either representation 2 or 3 can tell * the difference by checking whether lefthand is NIL or not. Also, @@ -372,7 +372,7 @@ typedef struct Aggref * found in SubLinks that are children of SubPlan nodes. * * In EXISTS and EXPR SubLinks, both lefthand and oper are unused and are - * always NIL. useor is not significant either for these sublink types. + * always NIL. useor is not significant either for these sublink types. * ---------------- */ typedef enum SubLinkType @@ -432,12 +432,12 @@ typedef struct Array * refelemlength - length of the array element type * refelembyval - is the element type pass-by-value? * refupperindexpr - expressions that evaluate to upper array indexes - * reflowerindexpr - expressions that evaluate to lower array indexes + * reflowerindexpr - expressions that evaluate to lower array indexes * refexpr - the expression that evaluates to an array value * refassgnexpr - expression for the source value, or NULL if fetch * * If reflowerindexpr = NIL, then we are fetching or storing a single array - * element at the subscripts given by refupperindexpr. Otherwise we are + * element at the subscripts given by refupperindexpr. Otherwise we are * fetching or storing an array slice, that is a rectangular subarray * with lower and upper bounds given by the index expressions. * reflowerindexpr must be the same length as refupperindexpr when it @@ -445,7 +445,7 @@ typedef struct Array * * Note: array types can be fixed-length (refattrlength > 0), but only * when the element type is itself fixed-length. Otherwise they are - * varlena structures and have refattrlength = -1. In any case, + * varlena structures and have refattrlength = -1. In any case, * an array type is never pass-by-value. * * Note: currently, refelemtype is NOT the element type, but the array type, diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h index f01877a9e89..b7d65131066 100644 --- a/src/include/nodes/relation.h +++ b/src/include/nodes/relation.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: relation.h,v 1.46 2000/03/22 22:08:29 tgl Exp $ + * $Id: relation.h,v 1.47 2000/04/12 17:16:40 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -30,7 +30,10 @@ typedef List *Relids; * When looking for a "cheapest path", this enum specifies whether we want * cheapest startup cost or cheapest total cost. */ -typedef enum CostSelector { STARTUP_COST, TOTAL_COST } CostSelector; +typedef enum CostSelector +{ + STARTUP_COST, TOTAL_COST +} CostSelector; /* * RelOptInfo @@ -82,7 +85,7 @@ typedef enum CostSelector { STARTUP_COST, TOTAL_COST } CostSelector; * (For example, in a 3-base-rel join, a clause relating rels 1 and 2 must be * treated as a restrictclause if we join {1} and {2 3} to make {1 2 3}; but * if we join {1 2} and {3} then that clause will be a restrictclause in {1 2} - * and should not be processed again at the level of {1 2 3}.) Therefore, + * and should not be processed again at the level of {1 2 3}.) Therefore, * the restrictinfo list in the join case appears in individual JoinPaths * (field joinrestrictinfo), not in the parent relation. But it's OK for * the RelOptInfo to store the joininfo lists, because those are the same @@ -98,7 +101,8 @@ typedef struct RelOptInfo NodeTag type; /* all relations included in this RelOptInfo */ - Relids relids; /* integer list of base relids (RT indexes) */ + Relids relids; /* integer list of base relids (RT + * indexes) */ /* size estimates generated by planner */ double rows; /* estimated number of result tuples */ @@ -117,11 +121,14 @@ typedef struct RelOptInfo double tuples; /* used by various scans and joins: */ - List *baserestrictinfo; /* RestrictInfo structures (if base rel) */ - Cost baserestrictcost; /* cost of evaluating the above */ + List *baserestrictinfo; /* RestrictInfo structures (if + * base rel) */ + Cost baserestrictcost; /* cost of evaluating the above */ List *joininfo; /* JoinInfo structures */ List *innerjoin; /* potential indexscans for nestloop joins */ - /* innerjoin indexscans are not in the main pathlist because they are + + /* + * innerjoin indexscans are not in the main pathlist because they are * not usable except in specific join contexts; we have to test before * seeing whether they can be used. */ @@ -143,8 +150,8 @@ typedef struct RelOptInfo * ordering - List of PG_OPERATOR OIDs which order the indexscan result * relam - the OID of the pg_am of the index * amcostestimate - OID of the relam's cost estimator - * indproc - OID of the function if a functional index, else 0 - * indpred - index predicate if a partial index, else NULL + * indproc - OID of the function if a functional index, else 0 + * indpred - index predicate if a partial index, else NULL * lossy - true if index is lossy (may return non-matching tuples) * * NB. the last element of the arrays classlist, indexkeys and ordering @@ -167,7 +174,7 @@ typedef struct IndexOptInfo Oid *ordering; /* OIDs of sort operators for each key */ Oid relam; /* OID of the access method (in pg_am) */ - RegProcedure amcostestimate; /* OID of the access method's cost fcn */ + RegProcedure amcostestimate;/* OID of the access method's cost fcn */ Oid indproc; /* if a functional index */ List *indpred; /* if a partial index */ @@ -178,11 +185,11 @@ typedef struct IndexOptInfo * PathKeys * * The sort ordering of a path is represented by a list of sublists of - * PathKeyItem nodes. An empty list implies no known ordering. Otherwise + * PathKeyItem nodes. An empty list implies no known ordering. Otherwise * the first sublist represents the primary sort key, the second the - * first secondary sort key, etc. Each sublist contains one or more + * first secondary sort key, etc. Each sublist contains one or more * PathKeyItem nodes, each of which can be taken as the attribute that - * appears at that sort position. (See the top of optimizer/path/pathkeys.c + * appears at that sort position. (See the top of optimizer/path/pathkeys.c * for more information.) */ @@ -192,11 +199,12 @@ typedef struct PathKeyItem Node *key; /* the item that is ordered */ Oid sortop; /* the ordering operator ('<' op) */ + /* - * key typically points to a Var node, ie a relation attribute, - * but it can also point to a Func clause representing the value - * indexed by a functional index. Someday we might allow arbitrary - * expressions as path keys, so don't assume more than you must. + * key typically points to a Var node, ie a relation attribute, but it + * can also point to a Func clause representing the value indexed by a + * functional index. Someday we might allow arbitrary expressions as + * path keys, so don't assume more than you must. */ } PathKeyItem; @@ -212,8 +220,10 @@ typedef struct Path RelOptInfo *parent; /* the relation this path can build */ /* estimated execution costs for path (see costsize.c for more info) */ - Cost startup_cost; /* cost expended before fetching any tuples */ - Cost total_cost; /* total cost (assuming all tuples fetched) */ + Cost startup_cost; /* cost expended before fetching any + * tuples */ + Cost total_cost; /* total cost (assuming all tuples + * fetched) */ NodeTag pathtype; /* tag identifying scan/join method */ /* XXX why is pathtype separate from the NodeTag? */ @@ -223,10 +233,10 @@ typedef struct Path } Path; /*---------- - * IndexPath represents an index scan. Although an indexscan can only read + * IndexPath represents an index scan. Although an indexscan can only read * a single relation, it can scan it more than once, potentially using a * different index during each scan. The result is the union (OR) of all the - * tuples matched during any scan. (The executor is smart enough not to return + * tuples matched during any scan. (The executor is smart enough not to return * the same tuple more than once, even if it is matched in multiple scans.) * * 'indexid' is a list of index relation OIDs, one per scan to be performed. @@ -272,10 +282,10 @@ typedef struct IndexPath typedef struct TidPath { - Path path; - List *tideval; - Relids unjoined_relids; /* some rels not yet part of my Path */ -} TidPath; + Path path; + List *tideval; + Relids unjoined_relids;/* some rels not yet part of my Path */ +} TidPath; /* * All join-type paths share these fields. @@ -287,8 +297,10 @@ typedef struct JoinPath Path *outerjoinpath; /* path for the outer side of the join */ Path *innerjoinpath; /* path for the inner side of the join */ - List *joinrestrictinfo; /* RestrictInfos to apply to join */ - /* See the notes for RelOptInfo to understand why joinrestrictinfo is + List *joinrestrictinfo; /* RestrictInfos to apply to join */ + + /* + * See the notes for RelOptInfo to understand why joinrestrictinfo is * needed in JoinPath, and can't be merged into the parent RelOptInfo. */ } JoinPath; @@ -303,7 +315,7 @@ typedef JoinPath NestPath; * A mergejoin path has these fields. * * path_mergeclauses lists the clauses (in the form of RestrictInfos) - * that will be used in the merge. (Before 7.0, this was a list of + * that will be used in the merge. (Before 7.0, this was a list of * bare clause expressions, but we can save on list memory by leaving * it in the form of a RestrictInfo list.) * @@ -321,7 +333,8 @@ typedef JoinPath NestPath; typedef struct MergePath { JoinPath jpath; - List *path_mergeclauses; /* join clauses to be used for merge */ + List *path_mergeclauses; /* join clauses to be used for + * merge */ List *outersortkeys; /* keys for explicit sort, if any */ List *innersortkeys; /* keys for explicit sort, if any */ } MergePath; @@ -340,14 +353,14 @@ typedef struct MergePath typedef struct HashPath { JoinPath jpath; - List *path_hashclauses; /* join clauses used for hashing */ + List *path_hashclauses; /* join clauses used for hashing */ } HashPath; /* * Restriction clause info. * * We create one of these for each AND sub-clause of a restriction condition - * (WHERE clause). Since the restriction clauses are logically ANDed, we + * (WHERE clause). Since the restriction clauses are logically ANDed, we * can use any one of them or any subset of them to filter out tuples, * without having to evaluate the rest. The RestrictInfo node itself stores * data used by the optimizer while choosing the best query plan. @@ -376,7 +389,7 @@ typedef struct HashPath * sequence we use. So, these clauses cannot be associated directly with * the join RelOptInfo, but must be kept track of on a per-join-path basis. * - * In general, the referenced clause might be arbitrarily complex. The + * In general, the referenced clause might be arbitrarily complex. The * kinds of clauses we can handle as indexscan quals, mergejoin clauses, * or hashjoin clauses are fairly limited --- the code for each kind of * path is responsible for identifying the restrict clauses it can use @@ -395,16 +408,16 @@ typedef struct RestrictInfo Expr *clause; /* the represented clause of WHERE cond */ /* only used if clause is an OR clause: */ - List *subclauseindices; /* indexes matching subclauses */ + List *subclauseindices; /* indexes matching subclauses */ /* subclauseindices is a List of Lists of IndexOptInfos */ /* valid if clause is mergejoinable, else InvalidOid: */ - Oid mergejoinoperator; /* copy of clause operator */ + Oid mergejoinoperator; /* copy of clause operator */ Oid left_sortop; /* leftside sortop needed for mergejoin */ Oid right_sortop; /* rightside sortop needed for mergejoin */ /* valid if clause is hashjoinable, else InvalidOid: */ - Oid hashjoinoperator; /* copy of clause operator */ + Oid hashjoinoperator; /* copy of clause operator */ } RestrictInfo; /* @@ -424,8 +437,8 @@ typedef struct RestrictInfo typedef struct JoinInfo { NodeTag type; - Relids unjoined_relids; /* some rels not yet part of my RelOptInfo */ - List *jinfo_restrictinfo; /* relevant RestrictInfos */ + Relids unjoined_relids;/* some rels not yet part of my RelOptInfo */ + List *jinfo_restrictinfo; /* relevant RestrictInfos */ } JoinInfo; /* @@ -463,7 +476,7 @@ typedef struct Stream StreamPtr downstream; bool groupup; Cost groupcost; - Selectivity groupsel; + Selectivity groupsel; } Stream; #endif /* RELATION_H */ |