*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.59 1999/02/03 21:16:17 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.60 1999/02/04 01:46:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
}
/* ----------------
- * _copyHInfo
+ * _copyHashInfo
* ----------------
*/
-static HInfo *
-_copyHInfo(HInfo *from)
+static HashInfo *
+_copyHashInfo(HashInfo *from)
{
- HInfo *newnode = makeNode(HInfo);
+ HashInfo *newnode = makeNode(HashInfo);
/* ----------------
* copy remainder of node
case T_JoinMethod:
retval = _copyJoinMethod(from);
break;
- case T_HInfo:
- retval = _copyHInfo(from);
+ case T_HashInfo:
+ retval = _copyHashInfo(from);
break;
case T_MInfo:
retval = _copyMInfo(from);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.22 1999/02/03 20:15:22 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.23 1999/02/04 01:46:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
}
static bool
-_equalHInfo(HInfo *a, HInfo *b)
+_equalHashInfo(HashInfo *a, HashInfo *b)
{
- Assert(IsA(a, HInfo));
- Assert(IsA(b, HInfo));
+ Assert(IsA(a, HashInfo));
+ Assert(IsA(b, HashInfo));
if (a->hashop != b->hashop)
return false;
case T_MergeOrder:
retval = _equalMergeOrder(a, b);
break;
- case T_HInfo:
- retval = _equalHInfo(a, b);
+ case T_HashInfo:
+ retval = _equalHashInfo(a, b);
break;
case T_IndexScan:
retval = _equalIndexScan(a, b);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: outfuncs.c,v 1.63 1999/02/03 20:15:22 momjian Exp $
+ * $Id: outfuncs.c,v 1.64 1999/02/04 01:46:54 momjian Exp $
*
* NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which
}
/*
- * HInfo is a subclass of JoinMethod.
+ * HashInfo is a subclass of JoinMethod.
*/
static void
-_outHInfo(StringInfo str, HInfo *node)
+_outHashInfo(StringInfo str, HashInfo *node)
{
appendStringInfo(str, " HASHINFO :hashop %u :jmkeys ", node->hashop);
_outNode(str, node->jmethod.jmkeys);
case T_JoinMethod:
_outJoinMethod(str, obj);
break;
- case T_HInfo:
- _outHInfo(str, obj);
+ case T_HashInfo:
+ _outHashInfo(str, obj);
break;
case T_JoinInfo:
_outJoinInfo(str, obj);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.46 1999/02/03 21:16:18 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.47 1999/02/04 01:46:54 momjian Exp $
*
* NOTES
* Most of the read functions for plan nodes are tested. (In fact, they
}
/* ----------------
- * _readHInfo
+ * _readHashInfo
*
- * HInfo is a subclass of JoinMethod.
+ * HashInfo is a subclass of JoinMethod.
* ----------------
*/
-static HInfo *
-_readHInfo()
+static HashInfo *
+_readHashInfo()
{
- HInfo *local_node;
+ HashInfo *local_node;
char *token;
int length;
- local_node = makeNode(HInfo);
+ local_node = makeNode(HashInfo);
token = lsptok(NULL, &length); /* get :hashop */
token = lsptok(NULL, &length); /* now read it */
else if (!strncmp(token, "JOININFO", length))
return_value = _readJoinInfo();
else if (!strncmp(token, "HINFO", length))
- return_value = _readHInfo();
+ return_value = _readHashInfo();
else if (!strncmp(token, "ITER", length))
return_value = _readIter();
else if (!strncmp(token, "QUERY", length))
Optimizer Structures
--------------------
-Path - info about every way to access a relation(sequential, index)
- PathOrder - info about every ordering (sort, merge of relations)
-RelOptInfo - info about every relation
- JoinInfo - info about join combinations
-RestrictInfo - info about restrictions
+RelOptInfo - info about every relation
+ RestrictInfo - info about restrictions
+ JoinInfo - info about join combinations
+ Path - info about every way to access a relation(sequential, index)
+ PathOrder - info about every ordering (sort, merge of relations)
+
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/hashutils.c,v 1.9 1999/02/03 21:16:25 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/hashutils.c,v 1.10 1999/02/04 01:46:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "optimizer/clauses.h"
-static HInfo *match_hashop_hashinfo(Oid hashop, List *hashinfo_list);
+static HashInfo *match_hashop_hashinfo(Oid hashop, List *hashinfo_list);
/*
* group-clauses-by-hashop--
*/
if (hashjoinop)
{
- HInfo *xhashinfo = (HInfo *) NULL;
+ HashInfo *xhashinfo = (HashInfo *) NULL;
Expr *clause = restrictinfo->clause;
Var *leftop = get_leftop(clause);
Var *rightop = get_rightop(clause);
if (xhashinfo == NULL)
{
- xhashinfo = makeNode(HInfo);
+ xhashinfo = makeNode(HashInfo);
xhashinfo->hashop = hashjoinop;
xhashinfo->jmethod.jmkeys = NIL;
* Returns the node if it exists.
*
*/
-static HInfo *
+static HashInfo *
match_hashop_hashinfo(Oid hashop, List *hashinfo_list)
{
Oid key = 0;
- HInfo *xhashinfo = (HInfo *) NULL;
+ HashInfo *xhashinfo = (HashInfo *) NULL;
List *i = NIL;
foreach(i, hashinfo_list)
{
- xhashinfo = (HInfo *) lfirst(i);
+ xhashinfo = (HashInfo *) lfirst(i);
key = xhashinfo->hashop;
if (hashop == key)
{ /* found */
return xhashinfo; /* should be a hashinfo node ! */
}
}
- return (HInfo *) NIL;
+ return (HashInfo *) NIL;
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.12 1999/02/03 21:16:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.13 1999/02/04 01:46:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
RelOptInfo * innerrel,
List *hashinfo_list)
{
- HInfo *xhashinfo = (HInfo *) NULL;
+ HashInfo *xhashinfo = (HashInfo *) NULL;
List *hjoin_list = NIL;
HashPath *temp_node = (HashPath *) NULL;
List *i = NIL;
foreach(i, hashinfo_list)
{
- xhashinfo = (HInfo *) lfirst(i);
+ xhashinfo = (HashInfo *) lfirst(i);
outerkeys = extract_path_keys(((JoinMethod *) xhashinfo)->jmkeys,
outerrel->targetlist,
OUTER);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.17 1998/09/01 04:29:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.18 1999/02/04 01:46:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/*
* prune-joinrels--
* Removes any redundant relation entries from a list of rel nodes
- * 'rel-list'. Obviosly, the first relation can't be a duplicate.
+ * 'rel-list'. Obviously, the first relation can't be a duplicate.
*
* Returns the resulting list.
*
*
*/
static List *
-prune_joinrel(RelOptInfo * rel, List *other_rels)
+prune_joinrel(RelOptInfo *rel, List *other_rels)
{
List *i = NIL;
List *result = NIL;
Path *cheapest = set_cheapest(rel, rel->pathlist);
/* don't prune if not pruneable -- JMH, 11/23/92 */
- if (unorderedpath != cheapest
- && rel->pruneable)
+ if (unorderedpath != cheapest && rel->pruneable)
{
rel->unorderedpath = (Path *) NULL;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.16 1999/02/03 21:16:52 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.17 1999/02/04 01:46:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*
*/
Path *
-set_cheapest(RelOptInfo * parent_rel, List *pathlist)
+set_cheapest(RelOptInfo *parent_rel, List *pathlist)
{
List *p;
Path *cheapest_so_far;
*
*/
List *
-add_pathlist(RelOptInfo * parent_rel, List *unique_paths, List *new_paths)
+add_pathlist(RelOptInfo *parent_rel, List *unique_paths, List *new_paths)
{
List *x;
Path *new_path;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodes.h,v 1.36 1999/02/03 20:15:46 momjian Exp $
+ * $Id: nodes.h,v 1.37 1999/02/04 01:47:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
T_MergeOrder,
T_RestrictInfo,
T_JoinMethod,
- T_HInfo,
+ T_HashInfo,
T_MInfo,
T_JoinInfo,
T_Iter,
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: relation.h,v 1.12 1999/02/03 20:15:46 momjian Exp $
+ * $Id: relation.h,v 1.13 1999/02/04 01:47:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* materialization information */
List *targetlist;
- List *pathlist;
+ List *pathlist; /* Path structures */
struct Path *unorderedpath;
struct Path *cheapestpath;
bool pruneable;
/* used by various scans and joins: */
Oid *ordering; /* OID of operators in sort order */
- List *restrictinfo; /* restriction clauses */
- List *joininfo; /* join clauses */
+ List *restrictinfo; /* RestrictInfo structures */
+ List *joininfo; /* JoinInfo structures */
List *innerjoin;
List *superrels;
-} RelOptInfo;
+} RelOptInfo;
extern Var *get_expr(TargetEntry *foo);
{
Oid *sortop;
MergeOrder *merge;
- } ord;
+ } ord;
} PathOrder;
typedef struct Path
List *clauses;
} JoinMethod;
-typedef struct HInfo
+typedef struct HashInfo
{
JoinMethod jmethod;
Oid hashop;
-} HInfo;
+} HashInfo;
typedef struct MInfo
{
bool mergejoinable;
bool hashjoinable;
bool inactive;
-} JoinInfo;
+} JoinInfo;
typedef struct Iter
{