mirror of
https://github.com/postgres/postgres.git
synced 2025-05-21 00:02:53 -04:00
JoinPath -> NestPath for nested loop.
This commit is contained in:
parent
3fdb9bb9c7
commit
c0d17c7aee
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.68 1999/02/12 05:56:45 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.69 1999/02/12 06:43:21 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1174,14 +1174,14 @@ _copyIndexPath(IndexPath *from)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* CopyJoinPathFields
|
* CopyNestPathFields
|
||||||
*
|
*
|
||||||
* This function copies the fields of the JoinPath node. It is used by
|
* This function copies the fields of the NestPath node. It is used by
|
||||||
* all the copy functions for classes which inherit from JoinPath.
|
* all the copy functions for classes which inherit from NestPath.
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
CopyJoinPathFields(JoinPath *from, JoinPath *newnode)
|
CopyNestPathFields(NestPath *from, NestPath *newnode)
|
||||||
{
|
{
|
||||||
Node_Copy(from, newnode, pathinfo);
|
Node_Copy(from, newnode, pathinfo);
|
||||||
Node_Copy(from, newnode, outerjoinpath);
|
Node_Copy(from, newnode, outerjoinpath);
|
||||||
@ -1189,20 +1189,20 @@ CopyJoinPathFields(JoinPath *from, JoinPath *newnode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* _copyJoinPath
|
* _copyNestPath
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static JoinPath *
|
static NestPath *
|
||||||
_copyJoinPath(JoinPath *from)
|
_copyNestPath(NestPath *from)
|
||||||
{
|
{
|
||||||
JoinPath *newnode = makeNode(JoinPath);
|
NestPath *newnode = makeNode(NestPath);
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* copy the node superclass fields
|
* copy the node superclass fields
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
CopyPathFields((Path *) from, (Path *) newnode);
|
CopyPathFields((Path *) from, (Path *) newnode);
|
||||||
CopyJoinPathFields(from, newnode);
|
CopyNestPathFields(from, newnode);
|
||||||
|
|
||||||
return newnode;
|
return newnode;
|
||||||
}
|
}
|
||||||
@ -1221,7 +1221,7 @@ _copyMergePath(MergePath *from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
CopyPathFields((Path *) from, (Path *) newnode);
|
CopyPathFields((Path *) from, (Path *) newnode);
|
||||||
CopyJoinPathFields((JoinPath *) from, (JoinPath *) newnode);
|
CopyNestPathFields((NestPath *) from, (NestPath *) newnode);
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* copy the remainder of the node
|
* copy the remainder of the node
|
||||||
@ -1248,7 +1248,7 @@ _copyHashPath(HashPath *from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
CopyPathFields((Path *) from, (Path *) newnode);
|
CopyPathFields((Path *) from, (Path *) newnode);
|
||||||
CopyJoinPathFields((JoinPath *) from, (JoinPath *) newnode);
|
CopyNestPathFields((NestPath *) from, (NestPath *) newnode);
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* copy remainder of node
|
* copy remainder of node
|
||||||
@ -1773,8 +1773,8 @@ copyObject(void *from)
|
|||||||
case T_IndexPath:
|
case T_IndexPath:
|
||||||
retval = _copyIndexPath(from);
|
retval = _copyIndexPath(from);
|
||||||
break;
|
break;
|
||||||
case T_JoinPath:
|
case T_NestPath:
|
||||||
retval = _copyJoinPath(from);
|
retval = _copyNestPath(from);
|
||||||
break;
|
break;
|
||||||
case T_MergePath:
|
case T_MergePath:
|
||||||
retval = _copyMergePath(from);
|
retval = _copyMergePath(from);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.30 1999/02/11 14:58:48 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.31 1999/02/12 06:43:22 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -390,7 +390,7 @@ _equalIndexPath(IndexPath *a, IndexPath *b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
_equalJoinPath(JoinPath *a, JoinPath *b)
|
_equalNestPath(NestPath *a, NestPath *b)
|
||||||
{
|
{
|
||||||
Assert(IsA_JoinPath(a));
|
Assert(IsA_JoinPath(a));
|
||||||
Assert(IsA_JoinPath(b));
|
Assert(IsA_JoinPath(b));
|
||||||
@ -412,7 +412,7 @@ _equalMergePath(MergePath *a, MergePath *b)
|
|||||||
Assert(IsA(a, MergePath));
|
Assert(IsA(a, MergePath));
|
||||||
Assert(IsA(b, MergePath));
|
Assert(IsA(b, MergePath));
|
||||||
|
|
||||||
if (!_equalJoinPath((JoinPath *) a, (JoinPath *) b))
|
if (!_equalNestPath((NestPath *) a, (NestPath *) b))
|
||||||
return false;
|
return false;
|
||||||
if (!equal(a->path_mergeclauses, b->path_mergeclauses))
|
if (!equal(a->path_mergeclauses, b->path_mergeclauses))
|
||||||
return false;
|
return false;
|
||||||
@ -429,7 +429,7 @@ _equalHashPath(HashPath *a, HashPath *b)
|
|||||||
Assert(IsA(a, HashPath));
|
Assert(IsA(a, HashPath));
|
||||||
Assert(IsA(b, HashPath));
|
Assert(IsA(b, HashPath));
|
||||||
|
|
||||||
if (!_equalJoinPath((JoinPath *) a, (JoinPath *) b))
|
if (!_equalNestPath((NestPath *) a, (NestPath *) b))
|
||||||
return false;
|
return false;
|
||||||
if (!equal((a->path_hashclauses), (b->path_hashclauses)))
|
if (!equal((a->path_hashclauses), (b->path_hashclauses)))
|
||||||
return false;
|
return false;
|
||||||
@ -773,8 +773,8 @@ equal(void *a, void *b)
|
|||||||
case T_IndexPath:
|
case T_IndexPath:
|
||||||
retval = _equalIndexPath(a, b);
|
retval = _equalIndexPath(a, b);
|
||||||
break;
|
break;
|
||||||
case T_JoinPath:
|
case T_NestPath:
|
||||||
retval = _equalJoinPath(a, b);
|
retval = _equalNestPath(a, b);
|
||||||
break;
|
break;
|
||||||
case T_MergePath:
|
case T_MergePath:
|
||||||
retval = _equalMergePath(a, b);
|
retval = _equalMergePath(a, b);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.8 1999/02/12 05:56:45 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.9 1999/02/12 06:43:23 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -811,14 +811,14 @@ _freeIndexPath(IndexPath *node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* FreeJoinPathFields
|
* FreeNestPathFields
|
||||||
*
|
*
|
||||||
* This function frees the fields of the JoinPath node. It is used by
|
* This function frees the fields of the NestPath node. It is used by
|
||||||
* all the free functions for classes which inherit node JoinPath.
|
* all the free functions for classes which inherit node NestPath.
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
FreeJoinPathFields(JoinPath *node)
|
FreeNestPathFields(NestPath *node)
|
||||||
{
|
{
|
||||||
freeObject(node->pathinfo);
|
freeObject(node->pathinfo);
|
||||||
freeObject(node->outerjoinpath);
|
freeObject(node->outerjoinpath);
|
||||||
@ -826,18 +826,18 @@ FreeJoinPathFields(JoinPath *node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* _freeJoinPath
|
* _freeNestPath
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_freeJoinPath(JoinPath *node)
|
_freeNestPath(NestPath *node)
|
||||||
{
|
{
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* free the node superclass fields
|
* free the node superclass fields
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
FreePathFields((Path *) node);
|
FreePathFields((Path *) node);
|
||||||
FreeJoinPathFields(node);
|
FreeNestPathFields(node);
|
||||||
|
|
||||||
pfree(node);
|
pfree(node);
|
||||||
}
|
}
|
||||||
@ -854,7 +854,7 @@ _freeMergePath(MergePath *node)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
FreePathFields((Path *) node);
|
FreePathFields((Path *) node);
|
||||||
FreeJoinPathFields((JoinPath *) node);
|
FreeNestPathFields((NestPath *) node);
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* free the remainder of the node
|
* free the remainder of the node
|
||||||
@ -879,7 +879,7 @@ _freeHashPath(HashPath *node)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
FreePathFields((Path *) node);
|
FreePathFields((Path *) node);
|
||||||
FreeJoinPathFields((JoinPath *) node);
|
FreeNestPathFields((NestPath *) node);
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* free remainder of node
|
* free remainder of node
|
||||||
@ -1292,8 +1292,8 @@ freeObject(void *node)
|
|||||||
case T_IndexPath:
|
case T_IndexPath:
|
||||||
_freeIndexPath(node);
|
_freeIndexPath(node);
|
||||||
break;
|
break;
|
||||||
case T_JoinPath:
|
case T_NestPath:
|
||||||
_freeJoinPath(node);
|
_freeNestPath(node);
|
||||||
break;
|
break;
|
||||||
case T_MergePath:
|
case T_MergePath:
|
||||||
_freeMergePath(node);
|
_freeMergePath(node);
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: outfuncs.c,v 1.70 1999/02/12 05:56:46 momjian Exp $
|
* $Id: outfuncs.c,v 1.71 1999/02/12 06:43:24 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Every (plan) node in POSTGRES has an associated "out" routine which
|
* Every (plan) node in POSTGRES has an associated "out" routine which
|
||||||
@ -990,13 +990,13 @@ _outIndexPath(StringInfo str, IndexPath *node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* JoinPath is a subclass of Path
|
* NestPath is a subclass of Path
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outJoinPath(StringInfo str, JoinPath *node)
|
_outNestPath(StringInfo str, NestPath *node)
|
||||||
{
|
{
|
||||||
appendStringInfo(str,
|
appendStringInfo(str,
|
||||||
" JOINPATH :pathtype %d :cost %f :pathkeys ",
|
" NESTPATH :pathtype %d :cost %f :pathkeys ",
|
||||||
node->path.pathtype,
|
node->path.pathtype,
|
||||||
node->path.path_cost);
|
node->path.path_cost);
|
||||||
_outNode(str, node->path.pathkeys);
|
_outNode(str, node->path.pathkeys);
|
||||||
@ -1021,7 +1021,7 @@ _outJoinPath(StringInfo str, JoinPath *node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MergePath is a subclass of JoinPath.
|
* MergePath is a subclass of NestPath.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outMergePath(StringInfo str, MergePath *node)
|
_outMergePath(StringInfo str, MergePath *node)
|
||||||
@ -1061,7 +1061,7 @@ _outMergePath(StringInfo str, MergePath *node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* HashPath is a subclass of JoinPath.
|
* HashPath is a subclass of NestPath.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outHashPath(StringInfo str, HashPath *node)
|
_outHashPath(StringInfo str, HashPath *node)
|
||||||
@ -1600,8 +1600,8 @@ _outNode(StringInfo str, void *obj)
|
|||||||
case T_IndexPath:
|
case T_IndexPath:
|
||||||
_outIndexPath(str, obj);
|
_outIndexPath(str, obj);
|
||||||
break;
|
break;
|
||||||
case T_JoinPath:
|
case T_NestPath:
|
||||||
_outJoinPath(str, obj);
|
_outNestPath(str, obj);
|
||||||
break;
|
break;
|
||||||
case T_MergePath:
|
case T_MergePath:
|
||||||
_outMergePath(str, obj);
|
_outMergePath(str, obj);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.55 1999/02/12 05:56:46 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.56 1999/02/12 06:43:24 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Most of the read functions for plan nodes are tested. (In fact, they
|
* Most of the read functions for plan nodes are tested. (In fact, they
|
||||||
@ -1564,20 +1564,20 @@ _readIndexPath()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* _readJoinPath
|
* _readNestPath
|
||||||
*
|
*
|
||||||
* JoinPath is a subclass of Path
|
* NestPath is a subclass of Path
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static JoinPath *
|
static NestPath *
|
||||||
_readJoinPath()
|
_readNestPath()
|
||||||
{
|
{
|
||||||
JoinPath *local_node;
|
NestPath *local_node;
|
||||||
char *token;
|
char *token;
|
||||||
int length;
|
int length;
|
||||||
|
|
||||||
|
|
||||||
local_node = makeNode(JoinPath);
|
local_node = makeNode(NestPath);
|
||||||
|
|
||||||
token = lsptok(NULL, &length); /* get :pathtype */
|
token = lsptok(NULL, &length); /* get :pathtype */
|
||||||
token = lsptok(NULL, &length); /* now read it */
|
token = lsptok(NULL, &length); /* now read it */
|
||||||
@ -1630,7 +1630,7 @@ _readJoinPath()
|
|||||||
/* ----------------
|
/* ----------------
|
||||||
* _readMergePath
|
* _readMergePath
|
||||||
*
|
*
|
||||||
* MergePath is a subclass of JoinPath.
|
* MergePath is a subclass of NestPath.
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static MergePath *
|
static MergePath *
|
||||||
@ -1704,7 +1704,7 @@ _readMergePath()
|
|||||||
/* ----------------
|
/* ----------------
|
||||||
* _readHashPath
|
* _readHashPath
|
||||||
*
|
*
|
||||||
* HashPath is a subclass of JoinPath.
|
* HashPath is a subclass of NestPath.
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static HashPath *
|
static HashPath *
|
||||||
@ -2110,8 +2110,8 @@ parsePlanString(void)
|
|||||||
return_value = _readPath();
|
return_value = _readPath();
|
||||||
else if (!strncmp(token, "INDEXPATH", length))
|
else if (!strncmp(token, "INDEXPATH", length))
|
||||||
return_value = _readIndexPath();
|
return_value = _readIndexPath();
|
||||||
else if (!strncmp(token, "JOINPATH", length))
|
else if (!strncmp(token, "NESTPATH", length))
|
||||||
return_value = _readJoinPath();
|
return_value = _readNestPath();
|
||||||
else if (!strncmp(token, "MERGEPATH", length))
|
else if (!strncmp(token, "MERGEPATH", length))
|
||||||
return_value = _readMergePath();
|
return_value = _readMergePath();
|
||||||
else if (!strncmp(token, "HASHPATH", length))
|
else if (!strncmp(token, "HASHPATH", length))
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: geqo_misc.c,v 1.14 1999/02/10 21:02:34 momjian Exp $
|
* $Id: geqo_misc.c,v 1.15 1999/02/12 06:43:26 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -158,7 +158,7 @@ void
|
|||||||
geqo_print_path(Query *root, Path *path, int indent)
|
geqo_print_path(Query *root, Path *path, int indent)
|
||||||
{
|
{
|
||||||
char *ptype = NULL;
|
char *ptype = NULL;
|
||||||
JoinPath *jp;
|
NestPath *jp;
|
||||||
bool join = false;
|
bool join = false;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -175,7 +175,7 @@ geqo_print_path(Query *root, Path *path, int indent)
|
|||||||
ptype = "IdxScan";
|
ptype = "IdxScan";
|
||||||
join = false;
|
join = false;
|
||||||
break;
|
break;
|
||||||
case T_JoinPath:
|
case T_NestPath:
|
||||||
ptype = "Nestloop";
|
ptype = "Nestloop";
|
||||||
join = true;
|
join = true;
|
||||||
break;
|
break;
|
||||||
@ -194,7 +194,7 @@ geqo_print_path(Query *root, Path *path, int indent)
|
|||||||
{
|
{
|
||||||
int size = path->parent->size;
|
int size = path->parent->size;
|
||||||
|
|
||||||
jp = (JoinPath *) path;
|
jp = (NestPath *) path;
|
||||||
printf("%s size=%d cost=%f\n", ptype, size, path->path_cost);
|
printf("%s size=%d cost=%f\n", ptype, size, path->path_cost);
|
||||||
switch (nodeTag(path))
|
switch (nodeTag(path))
|
||||||
{
|
{
|
||||||
@ -203,8 +203,7 @@ geqo_print_path(Query *root, Path *path, int indent)
|
|||||||
for (i = 0; i < indent + 1; i++)
|
for (i = 0; i < indent + 1; i++)
|
||||||
printf("\t");
|
printf("\t");
|
||||||
printf(" clauses=(");
|
printf(" clauses=(");
|
||||||
geqo_print_joinclauses(root,
|
geqo_print_joinclauses(root, ((NestPath *) path)->pathinfo);
|
||||||
((JoinPath *) path)->pathinfo);
|
|
||||||
printf(")\n");
|
printf(")\n");
|
||||||
|
|
||||||
if (nodeTag(path) == T_MergePath)
|
if (nodeTag(path) == T_MergePath)
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: geqo_paths.c,v 1.17 1999/02/12 05:56:48 momjian Exp $
|
* $Id: geqo_paths.c,v 1.18 1999/02/12 06:43:26 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -98,7 +98,7 @@ geqo_prune_rel(RelOptInfo *rel, List *other_rels)
|
|||||||
void
|
void
|
||||||
geqo_set_cheapest(RelOptInfo *rel)
|
geqo_set_cheapest(RelOptInfo *rel)
|
||||||
{
|
{
|
||||||
JoinPath *cheapest = (JoinPath *)set_cheapest(rel, rel->pathlist);
|
NestPath *cheapest = (NestPath *)set_cheapest(rel, rel->pathlist);
|
||||||
|
|
||||||
if (IsA_JoinPath(cheapest))
|
if (IsA_JoinPath(cheapest))
|
||||||
rel->size = compute_joinrel_size(cheapest);
|
rel->size = compute_joinrel_size(cheapest);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.28 1999/02/12 05:56:49 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.29 1999/02/12 06:43:28 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -302,7 +302,7 @@ static void
|
|||||||
print_path(Query *root, Path *path, int indent)
|
print_path(Query *root, Path *path, int indent)
|
||||||
{
|
{
|
||||||
char *ptype = NULL;
|
char *ptype = NULL;
|
||||||
JoinPath *jp;
|
NestPath *jp;
|
||||||
bool join = false;
|
bool join = false;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -319,7 +319,7 @@ print_path(Query *root, Path *path, int indent)
|
|||||||
ptype = "IdxScan";
|
ptype = "IdxScan";
|
||||||
join = false;
|
join = false;
|
||||||
break;
|
break;
|
||||||
case T_JoinPath:
|
case T_NestPath:
|
||||||
ptype = "Nestloop";
|
ptype = "Nestloop";
|
||||||
join = true;
|
join = true;
|
||||||
break;
|
break;
|
||||||
@ -338,7 +338,7 @@ print_path(Query *root, Path *path, int indent)
|
|||||||
{
|
{
|
||||||
int size = path->parent->size;
|
int size = path->parent->size;
|
||||||
|
|
||||||
jp = (JoinPath *) path;
|
jp = (NestPath *) path;
|
||||||
printf("%s size=%d cost=%f\n", ptype, size, path->path_cost);
|
printf("%s size=%d cost=%f\n", ptype, size, path->path_cost);
|
||||||
switch (nodeTag(path))
|
switch (nodeTag(path))
|
||||||
{
|
{
|
||||||
@ -347,7 +347,7 @@ print_path(Query *root, Path *path, int indent)
|
|||||||
for (i = 0; i < indent + 1; i++)
|
for (i = 0; i < indent + 1; i++)
|
||||||
printf("\t");
|
printf("\t");
|
||||||
printf(" clauses=(");
|
printf(" clauses=(");
|
||||||
print_joinclauses(root, ((JoinPath *) path)->pathinfo);
|
print_joinclauses(root, ((NestPath *) path)->pathinfo);
|
||||||
printf(")\n");
|
printf(")\n");
|
||||||
|
|
||||||
if (nodeTag(path) == T_MergePath)
|
if (nodeTag(path) == T_MergePath)
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.29 1999/02/10 21:02:37 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.30 1999/02/12 06:43:28 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -435,7 +435,7 @@ compute_attribute_width(TargetEntry *tlistentry)
|
|||||||
* Returns a fixnum.
|
* Returns a fixnum.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
compute_joinrel_size(JoinPath *joinpath)
|
compute_joinrel_size(NestPath *joinpath)
|
||||||
{
|
{
|
||||||
Cost temp = 1.0;
|
Cost temp = 1.0;
|
||||||
int temp1 = 0;
|
int temp1 = 0;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.20 1999/02/11 14:58:52 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.21 1999/02/12 06:43:30 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -87,23 +87,21 @@ find_all_join_paths(Query *root, List *joinrels)
|
|||||||
* list of integers.
|
* list of integers.
|
||||||
*/
|
*/
|
||||||
innerrel = (length(innerrelids) == 1) ?
|
innerrel = (length(innerrelids) == 1) ?
|
||||||
get_base_rel(root, lfirsti(innerrelids)) : get_join_rel(root, innerrelids);
|
get_base_rel(root, lfirsti(innerrelids)) :
|
||||||
|
get_join_rel(root, innerrelids);
|
||||||
outerrel = (length(outerrelids) == 1) ?
|
outerrel = (length(outerrelids) == 1) ?
|
||||||
get_base_rel(root, lfirsti(outerrelids)) : get_join_rel(root, outerrelids);
|
get_base_rel(root, lfirsti(outerrelids)) :
|
||||||
|
get_join_rel(root, outerrelids);
|
||||||
|
|
||||||
|
bestinnerjoin = best_innerjoin(innerrel->innerjoin, outerrel->relids);
|
||||||
|
|
||||||
bestinnerjoin = best_innerjoin(innerrel->innerjoin,
|
|
||||||
outerrel->relids);
|
|
||||||
if (_enable_mergejoin_)
|
if (_enable_mergejoin_)
|
||||||
{
|
|
||||||
mergeinfo_list = group_clauses_by_order(joinrel->restrictinfo,
|
mergeinfo_list = group_clauses_by_order(joinrel->restrictinfo,
|
||||||
lfirsti(innerrel->relids));
|
lfirsti(innerrel->relids));
|
||||||
}
|
|
||||||
|
|
||||||
if (_enable_hashjoin_)
|
if (_enable_hashjoin_)
|
||||||
{
|
|
||||||
hashinfo_list = group_clauses_by_hashop(joinrel->restrictinfo,
|
hashinfo_list = group_clauses_by_hashop(joinrel->restrictinfo,
|
||||||
lfirsti(innerrel->relids));
|
lfirsti(innerrel->relids));
|
||||||
}
|
|
||||||
|
|
||||||
/* need to flatten the relids list */
|
/* need to flatten the relids list */
|
||||||
joinrel->relids = intAppend(outerrelids, innerrelids);
|
joinrel->relids = intAppend(outerrelids, innerrelids);
|
||||||
@ -330,10 +328,8 @@ match_unsorted_outer(RelOptInfo *joinrel,
|
|||||||
outerpath_ordering = outerpath->pathorder;
|
outerpath_ordering = outerpath->pathorder;
|
||||||
|
|
||||||
if (outerpath_ordering)
|
if (outerpath_ordering)
|
||||||
{
|
|
||||||
xmergeinfo = match_order_mergeinfo(outerpath_ordering,
|
xmergeinfo = match_order_mergeinfo(outerpath_ordering,
|
||||||
mergeinfo_list);
|
mergeinfo_list);
|
||||||
}
|
|
||||||
|
|
||||||
if (xmergeinfo)
|
if (xmergeinfo)
|
||||||
clauses = xmergeinfo->jmethod.clauses;
|
clauses = xmergeinfo->jmethod.clauses;
|
||||||
@ -344,12 +340,12 @@ match_unsorted_outer(RelOptInfo *joinrel,
|
|||||||
List *clauses = xmergeinfo->jmethod.clauses;
|
List *clauses = xmergeinfo->jmethod.clauses;
|
||||||
|
|
||||||
matchedJoinKeys = match_pathkeys_joinkeys(outerpath->pathkeys,
|
matchedJoinKeys = match_pathkeys_joinkeys(outerpath->pathkeys,
|
||||||
jmkeys,
|
jmkeys,
|
||||||
clauses,
|
clauses,
|
||||||
OUTER,
|
OUTER,
|
||||||
&matchedJoinClauses);
|
&matchedJoinClauses);
|
||||||
merge_pathkeys = new_join_pathkeys(outerpath->pathkeys,
|
merge_pathkeys = new_join_pathkeys(outerpath->pathkeys,
|
||||||
joinrel->targetlist, clauses);
|
joinrel->targetlist, clauses);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
merge_pathkeys = outerpath->pathkeys;
|
merge_pathkeys = outerpath->pathkeys;
|
||||||
@ -434,8 +430,7 @@ match_unsorted_outer(RelOptInfo *joinrel,
|
|||||||
* found, and
|
* found, and
|
||||||
* 2. sorting the cheapest outer path is cheaper than using an ordered
|
* 2. sorting the cheapest outer path is cheaper than using an ordered
|
||||||
* but unsorted outer path(as was considered in
|
* but unsorted outer path(as was considered in
|
||||||
* (match-unsorted-outer)),
|
* (match-unsorted-outer)), then this merge path is considered.
|
||||||
* then this merge path is considered.
|
|
||||||
*
|
*
|
||||||
* 'joinrel' is the join result relation
|
* 'joinrel' is the join result relation
|
||||||
* 'outerrel' is the outer join relation
|
* 'outerrel' is the outer join relation
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/predmig.c,v 1.15 1999/02/03 21:16:28 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/predmig.c,v 1.16 1999/02/12 06:43:31 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -53,13 +53,13 @@
|
|||||||
* (not a join) iff it has
|
* (not a join) iff it has
|
||||||
* a non-NULL cinfo field */
|
* a non-NULL cinfo field */
|
||||||
|
|
||||||
static void xfunc_predmig(JoinPath pathnode, Stream streamroot,
|
static void xfunc_predmig(NestPath pathnode, Stream streamroot,
|
||||||
Stream laststream, bool *progressp);
|
Stream laststream, bool *progressp);
|
||||||
static bool xfunc_series_llel(Stream stream);
|
static bool xfunc_series_llel(Stream stream);
|
||||||
static bool xfunc_llel_chains(Stream root, Stream bottom);
|
static bool xfunc_llel_chains(Stream root, Stream bottom);
|
||||||
static Stream xfunc_complete_stream(Stream stream);
|
static Stream xfunc_complete_stream(Stream stream);
|
||||||
static bool xfunc_prdmig_pullup(Stream origstream, Stream pullme,
|
static bool xfunc_prdmig_pullup(Stream origstream, Stream pullme,
|
||||||
JoinPath joinpath);
|
NestPath joinpath);
|
||||||
static void xfunc_form_groups(Stream root, Stream bottom);
|
static void xfunc_form_groups(Stream root, Stream bottom);
|
||||||
static void xfunc_free_stream(Stream root);
|
static void xfunc_free_stream(Stream root);
|
||||||
static Stream xfunc_add_clauses(Stream current);
|
static Stream xfunc_add_clauses(Stream current);
|
||||||
@ -91,8 +91,8 @@ xfunc_do_predmig(Path root)
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
progress = false;
|
progress = false;
|
||||||
Assert(IsA(root, JoinPath));
|
Assert(IsA(root, NestPath));
|
||||||
xfunc_predmig((JoinPath) root, (Stream) NULL, (Stream) NULL,
|
xfunc_predmig((NestPath) root, (Stream) NULL, (Stream) NULL,
|
||||||
&progress);
|
&progress);
|
||||||
if (changed && progress)
|
if (changed && progress)
|
||||||
elog(DEBUG, "Needed to do a second round of predmig!\n");
|
elog(DEBUG, "Needed to do a second round of predmig!\n");
|
||||||
@ -111,7 +111,7 @@ xfunc_do_predmig(Path root)
|
|||||||
** Destructively modifies the join tree (via predicate pullup).
|
** Destructively modifies the join tree (via predicate pullup).
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
xfunc_predmig(JoinPath pathnode,/* root of the join tree */
|
xfunc_predmig(NestPath pathnode,/* root of the join tree */
|
||||||
Stream streamroot,
|
Stream streamroot,
|
||||||
Stream laststream,/* for recursive calls -- these are the
|
Stream laststream,/* for recursive calls -- these are the
|
||||||
* root of the stream under construction,
|
* root of the stream under construction,
|
||||||
@ -161,11 +161,11 @@ xfunc_predmig(JoinPath pathnode,/* root of the join tree */
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* visit left child */
|
/* visit left child */
|
||||||
xfunc_predmig((JoinPath) get_outerjoinpath(pathnode),
|
xfunc_predmig((NestPath) get_outerjoinpath(pathnode),
|
||||||
streamroot, newstream, progressp);
|
streamroot, newstream, progressp);
|
||||||
|
|
||||||
/* visit right child */
|
/* visit right child */
|
||||||
xfunc_predmig((JoinPath) get_innerjoinpath(pathnode),
|
xfunc_predmig((NestPath) get_innerjoinpath(pathnode),
|
||||||
streamroot, newstream, progressp);
|
streamroot, newstream, progressp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ xfunc_llel_chains(Stream root, Stream bottom)
|
|||||||
*/
|
*/
|
||||||
Assert(xfunc_num_relids(pathstream) > xfunc_num_relids(tmpstream));
|
Assert(xfunc_num_relids(pathstream) > xfunc_num_relids(tmpstream));
|
||||||
progress = xfunc_prdmig_pullup(origstream, tmpstream,
|
progress = xfunc_prdmig_pullup(origstream, tmpstream,
|
||||||
(JoinPath) get_pathptr(pathstream));
|
(NestPath) get_pathptr(pathstream));
|
||||||
}
|
}
|
||||||
if (get_downstream(tmpstream))
|
if (get_downstream(tmpstream))
|
||||||
pathstream = (Stream) xfunc_get_downjoin((Stream) get_downstream(tmpstream));
|
pathstream = (Stream) xfunc_get_downjoin((Stream) get_downstream(tmpstream));
|
||||||
@ -304,14 +304,14 @@ xfunc_complete_stream(Stream stream)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
** xfunc_prdmig_pullup
|
** xfunc_prdmig_pullup
|
||||||
** pullup a clause in a path above joinpath. Since the JoinPath tree
|
** pullup a clause in a path above joinpath. Since the NestPath tree
|
||||||
** doesn't have upward pointers, it's difficult to deal with. Thus we
|
** doesn't have upward pointers, it's difficult to deal with. Thus we
|
||||||
** require the original stream, which maintains pointers to all the path
|
** require the original stream, which maintains pointers to all the path
|
||||||
** nodes. We use the original stream to find out what joins are
|
** nodes. We use the original stream to find out what joins are
|
||||||
** above the clause.
|
** above the clause.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
xfunc_prdmig_pullup(Stream origstream, Stream pullme, JoinPath joinpath)
|
xfunc_prdmig_pullup(Stream origstream, Stream pullme, NestPath joinpath)
|
||||||
{
|
{
|
||||||
RestrictInfo restrictinfo = get_cinfo(pullme);
|
RestrictInfo restrictinfo = get_cinfo(pullme);
|
||||||
bool progress = false;
|
bool progress = false;
|
||||||
@ -333,7 +333,7 @@ xfunc_prdmig_pullup(Stream origstream, Stream pullme, JoinPath joinpath)
|
|||||||
/* pull up this node as far as it should go */
|
/* pull up this node as far as it should go */
|
||||||
for (upjoin = (Stream) xfunc_get_upjoin(orignode);
|
for (upjoin = (Stream) xfunc_get_upjoin(orignode);
|
||||||
upjoin != (Stream) NULL
|
upjoin != (Stream) NULL
|
||||||
&& (JoinPath) get_pathptr((Stream) xfunc_get_downjoin(upjoin))
|
&& (NestPath) get_pathptr((Stream) xfunc_get_downjoin(upjoin))
|
||||||
!= joinpath;
|
!= joinpath;
|
||||||
upjoin = (Stream) xfunc_get_upjoin(upjoin))
|
upjoin = (Stream) xfunc_get_upjoin(upjoin))
|
||||||
{
|
{
|
||||||
@ -342,12 +342,12 @@ xfunc_prdmig_pullup(Stream origstream, Stream pullme, JoinPath joinpath)
|
|||||||
#endif
|
#endif
|
||||||
/* move clause up in path */
|
/* move clause up in path */
|
||||||
if (get_pathptr((Stream) get_downstream(upjoin))
|
if (get_pathptr((Stream) get_downstream(upjoin))
|
||||||
== (pathPtr) get_outerjoinpath((JoinPath) get_pathptr(upjoin)))
|
== (pathPtr) get_outerjoinpath((NestPath) get_pathptr(upjoin)))
|
||||||
whichchild = OUTER;
|
whichchild = OUTER;
|
||||||
else
|
else
|
||||||
whichchild = INNER;
|
whichchild = INNER;
|
||||||
restrictinfo = xfunc_pullup((Path) get_pathptr((Stream) get_downstream(upjoin)),
|
restrictinfo = xfunc_pullup((Path) get_pathptr((Stream) get_downstream(upjoin)),
|
||||||
(JoinPath) get_pathptr(upjoin),
|
(NestPath) get_pathptr(upjoin),
|
||||||
restrictinfo,
|
restrictinfo,
|
||||||
whichchild,
|
whichchild,
|
||||||
get_clausetype(orignode));
|
get_clausetype(orignode));
|
||||||
@ -366,10 +366,10 @@ xfunc_prdmig_pullup(Stream origstream, Stream pullme, JoinPath joinpath)
|
|||||||
temp = (Stream) get_downstream(temp))
|
temp = (Stream) get_downstream(temp))
|
||||||
set_pathptr
|
set_pathptr
|
||||||
(temp, (pathPtr)
|
(temp, (pathPtr)
|
||||||
get_outerjoinpath((JoinPath) get_pathptr(upjoin)));
|
get_outerjoinpath((NestPath) get_pathptr(upjoin)));
|
||||||
set_pathptr
|
set_pathptr
|
||||||
(temp,
|
(temp,
|
||||||
(pathPtr) get_outerjoinpath((JoinPath) get_pathptr(upjoin)));
|
(pathPtr) get_outerjoinpath((NestPath) get_pathptr(upjoin)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -377,10 +377,10 @@ xfunc_prdmig_pullup(Stream origstream, Stream pullme, JoinPath joinpath)
|
|||||||
temp = (Stream) get_downstream(temp))
|
temp = (Stream) get_downstream(temp))
|
||||||
set_pathptr
|
set_pathptr
|
||||||
(temp, (pathPtr)
|
(temp, (pathPtr)
|
||||||
get_innerjoinpath((JoinPath) get_pathptr(upjoin)));
|
get_innerjoinpath((NestPath) get_pathptr(upjoin)));
|
||||||
set_pathptr
|
set_pathptr
|
||||||
(temp, (pathPtr)
|
(temp, (pathPtr)
|
||||||
get_innerjoinpath((JoinPath) get_pathptr(upjoin)));
|
get_innerjoinpath((NestPath) get_pathptr(upjoin)));
|
||||||
}
|
}
|
||||||
progress = true;
|
progress = true;
|
||||||
}
|
}
|
||||||
@ -425,14 +425,14 @@ xfunc_form_groups(Query *queryInfo, Stream root, Stream bottom)
|
|||||||
if (!is_clause(temp))
|
if (!is_clause(temp))
|
||||||
{
|
{
|
||||||
if (get_pathptr((Stream) get_downstream(temp))
|
if (get_pathptr((Stream) get_downstream(temp))
|
||||||
== (pathPtr) get_outerjoinpath((JoinPath) get_pathptr(temp)))
|
== (pathPtr) get_outerjoinpath((NestPath) get_pathptr(temp)))
|
||||||
whichchild = OUTER;
|
whichchild = OUTER;
|
||||||
else
|
else
|
||||||
whichchild = INNER;
|
whichchild = INNER;
|
||||||
set_groupcost(temp,
|
set_groupcost(temp,
|
||||||
xfunc_join_expense((JoinPath) get_pathptr(temp),
|
xfunc_join_expense((NestPath) get_pathptr(temp),
|
||||||
whichchild));
|
whichchild));
|
||||||
if (primjoin = xfunc_primary_join((JoinPath) get_pathptr(temp)))
|
if (primjoin = xfunc_primary_join((NestPath) get_pathptr(temp)))
|
||||||
{
|
{
|
||||||
set_groupsel(temp,
|
set_groupsel(temp,
|
||||||
compute_clause_selec(queryInfo,
|
compute_clause_selec(queryInfo,
|
||||||
@ -529,10 +529,10 @@ xfunc_add_clauses(Stream current)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* and add in the join clauses */
|
/* and add in the join clauses */
|
||||||
if (IsA(get_pathptr(current), JoinPath))
|
if (IsA(get_pathptr(current), NestPath))
|
||||||
{
|
{
|
||||||
primjoin = xfunc_primary_join((JoinPath) get_pathptr(current));
|
primjoin = xfunc_primary_join((NestPath) get_pathptr(current));
|
||||||
foreach(temp, get_pathrestrictinfo((JoinPath) get_pathptr(current)))
|
foreach(temp, get_pathrestrictinfo((NestPath) get_pathptr(current)))
|
||||||
{
|
{
|
||||||
if (!equal(get_clause((RestrictInfo) lfirst(temp)), primjoin))
|
if (!equal(get_clause((RestrictInfo) lfirst(temp)), primjoin))
|
||||||
topnode = xfunc_streaminsert((RestrictInfo) lfirst(temp), topnode,
|
topnode = xfunc_streaminsert((RestrictInfo) lfirst(temp), topnode,
|
||||||
@ -615,11 +615,11 @@ xfunc_streaminsert(RestrictInfo restrictinfo,
|
|||||||
static int
|
static int
|
||||||
xfunc_num_relids(Stream node)
|
xfunc_num_relids(Stream node)
|
||||||
{
|
{
|
||||||
if (!node || !IsA(get_pathptr(node), JoinPath))
|
if (!node || !IsA(get_pathptr(node), NestPath))
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return (length
|
return (length
|
||||||
(get_relids(get_parent((JoinPath) get_pathptr(node)))));
|
(get_relids(get_parent((NestPath) get_pathptr(node)))));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.28 1999/02/12 05:56:51 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.29 1999/02/12 06:43:32 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -92,17 +92,17 @@ rels_set_cheapest(List *rel_list)
|
|||||||
{
|
{
|
||||||
List *x = NIL;
|
List *x = NIL;
|
||||||
RelOptInfo *rel = (RelOptInfo *) NULL;
|
RelOptInfo *rel = (RelOptInfo *) NULL;
|
||||||
JoinPath *cheapest;
|
NestPath *cheapest;
|
||||||
|
|
||||||
foreach(x, rel_list)
|
foreach(x, rel_list)
|
||||||
{
|
{
|
||||||
rel = (RelOptInfo *) lfirst(x);
|
rel = (RelOptInfo *) lfirst(x);
|
||||||
|
|
||||||
cheapest = (JoinPath *) set_cheapest(rel, rel->pathlist);
|
cheapest = (NestPath *) set_cheapest(rel, rel->pathlist);
|
||||||
if (IsA_JoinPath(cheapest))
|
if (IsA_JoinPath(cheapest))
|
||||||
rel->size = compute_joinrel_size(cheapest);
|
rel->size = compute_joinrel_size(cheapest);
|
||||||
else
|
else
|
||||||
elog(ERROR, "non JoinPath called");
|
elog(ERROR, "non NestPath called");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.25 1999/02/10 21:02:40 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.26 1999/02/12 06:43:32 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -61,7 +61,7 @@ xfunc_trypullup(RelOptInfo rel)
|
|||||||
LispValue y; /* list ptr */
|
LispValue y; /* list ptr */
|
||||||
RestrictInfo maxcinfo; /* The RestrictInfo to pull up, as
|
RestrictInfo maxcinfo; /* The RestrictInfo to pull up, as
|
||||||
* calculated by xfunc_shouldpull() */
|
* calculated by xfunc_shouldpull() */
|
||||||
JoinPath curpath; /* current path in list */
|
NestPath curpath; /* current path in list */
|
||||||
int progress; /* has progress been made this time
|
int progress; /* has progress been made this time
|
||||||
* through? */
|
* through? */
|
||||||
int clausetype;
|
int clausetype;
|
||||||
@ -71,7 +71,7 @@ xfunc_trypullup(RelOptInfo rel)
|
|||||||
progress = false; /* no progress yet in this iteration */
|
progress = false; /* no progress yet in this iteration */
|
||||||
foreach(y, get_pathlist(rel))
|
foreach(y, get_pathlist(rel))
|
||||||
{
|
{
|
||||||
curpath = (JoinPath) lfirst(y);
|
curpath = (NestPath) lfirst(y);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* * for each operand, attempt to pullup predicates until
|
* * for each operand, attempt to pullup predicates until
|
||||||
@ -142,7 +142,7 @@ xfunc_trypullup(RelOptInfo rel)
|
|||||||
int
|
int
|
||||||
xfunc_shouldpull(Query *queryInfo,
|
xfunc_shouldpull(Query *queryInfo,
|
||||||
Path childpath,
|
Path childpath,
|
||||||
JoinPath parentpath,
|
NestPath parentpath,
|
||||||
int whichchild,
|
int whichchild,
|
||||||
RestrictInfo * maxcinfopt) /* Out: pointer to clause
|
RestrictInfo * maxcinfopt) /* Out: pointer to clause
|
||||||
* to pullup */
|
* to pullup */
|
||||||
@ -184,8 +184,8 @@ xfunc_shouldpull(Query *queryInfo,
|
|||||||
* see if any join clause has even higher rank than the highest *
|
* see if any join clause has even higher rank than the highest *
|
||||||
* local predicate
|
* local predicate
|
||||||
*/
|
*/
|
||||||
if (is_join(childpath) && xfunc_num_join_clauses((JoinPath) childpath) > 1)
|
if (is_join(childpath) && xfunc_num_join_clauses((NestPath) childpath) > 1)
|
||||||
for (tmplist = get_pathrestrictinfo((JoinPath) childpath);
|
for (tmplist = get_pathrestrictinfo((NestPath) childpath);
|
||||||
tmplist != LispNil;
|
tmplist != LispNil;
|
||||||
tmplist = lnext(tmplist))
|
tmplist = lnext(tmplist))
|
||||||
{
|
{
|
||||||
@ -224,7 +224,7 @@ xfunc_shouldpull(Query *queryInfo,
|
|||||||
|| (joincost == 0 && joinselec < 1)
|
|| (joincost == 0 && joinselec < 1)
|
||||||
|| (!is_join(childpath)
|
|| (!is_join(childpath)
|
||||||
&& (whichchild == INNER)
|
&& (whichchild == INNER)
|
||||||
&& IsA(parentpath, JoinPath)
|
&& IsA(parentpath, NestPath)
|
||||||
&&!IsA(parentpath, HashPath)
|
&&!IsA(parentpath, HashPath)
|
||||||
&&!IsA(parentpath, MergePath)))))
|
&&!IsA(parentpath, MergePath)))))
|
||||||
{
|
{
|
||||||
@ -263,7 +263,7 @@ xfunc_shouldpull(Query *queryInfo,
|
|||||||
RestrictInfo
|
RestrictInfo
|
||||||
xfunc_pullup(Query *queryInfo,
|
xfunc_pullup(Query *queryInfo,
|
||||||
Path childpath,
|
Path childpath,
|
||||||
JoinPath parentpath,
|
NestPath parentpath,
|
||||||
RestrictInfo cinfo, /* clause to pull up */
|
RestrictInfo cinfo, /* clause to pull up */
|
||||||
int whichchild, /* whether child is INNER or OUTER of join */
|
int whichchild, /* whether child is INNER or OUTER of join */
|
||||||
int clausetype) /* whether clause to pull is join or local */
|
int clausetype) /* whether clause to pull is join or local */
|
||||||
@ -285,9 +285,9 @@ xfunc_pullup(Query *queryInfo,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
set_pathrestrictinfo
|
set_pathrestrictinfo
|
||||||
((JoinPath) newkid,
|
((NestPath) newkid,
|
||||||
xfunc_LispRemove((LispValue) cinfo,
|
xfunc_LispRemove((LispValue) cinfo,
|
||||||
(List) get_pathrestrictinfo((JoinPath) newkid)));
|
(List) get_pathrestrictinfo((NestPath) newkid)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -390,7 +390,7 @@ LispValue clause;
|
|||||||
** Find global expense of a join clause
|
** Find global expense of a join clause
|
||||||
*/
|
*/
|
||||||
Cost
|
Cost
|
||||||
xfunc_join_expense(Query *queryInfo, JoinPath path, int whichchild)
|
xfunc_join_expense(Query *queryInfo, NestPath path, int whichchild)
|
||||||
{
|
{
|
||||||
LispValue primjoinclause = xfunc_primary_join(path);
|
LispValue primjoinclause = xfunc_primary_join(path);
|
||||||
|
|
||||||
@ -854,7 +854,7 @@ xfunc_find_references(LispValue clause)
|
|||||||
** min rank pathclause
|
** min rank pathclause
|
||||||
*/
|
*/
|
||||||
LispValue
|
LispValue
|
||||||
xfunc_primary_join(JoinPath pathnode)
|
xfunc_primary_join(NestPath pathnode)
|
||||||
{
|
{
|
||||||
LispValue joinclauselist = get_pathrestrictinfo(pathnode);
|
LispValue joinclauselist = get_pathrestrictinfo(pathnode);
|
||||||
RestrictInfo mincinfo;
|
RestrictInfo mincinfo;
|
||||||
@ -947,13 +947,13 @@ xfunc_get_path_cost(Query *queryInfo, Path pathnode)
|
|||||||
* * Now add in any node-specific expensive function costs. * Again,
|
* * Now add in any node-specific expensive function costs. * Again,
|
||||||
* we must ensure that the clauses are sorted by rank.
|
* we must ensure that the clauses are sorted by rank.
|
||||||
*/
|
*/
|
||||||
if (IsA(pathnode, JoinPath))
|
if (IsA(pathnode, NestPath))
|
||||||
{
|
{
|
||||||
if (XfuncMode != XFUNC_OFF)
|
if (XfuncMode != XFUNC_OFF)
|
||||||
set_pathrestrictinfo((JoinPath) pathnode, lisp_qsort
|
set_pathrestrictinfo((NestPath) pathnode, lisp_qsort
|
||||||
(get_pathrestrictinfo((JoinPath) pathnode),
|
(get_pathrestrictinfo((NestPath) pathnode),
|
||||||
xfunc_cinfo_compare));
|
xfunc_cinfo_compare));
|
||||||
for (tmplist = get_pathrestrictinfo((JoinPath) pathnode), selec = 1.0;
|
for (tmplist = get_pathrestrictinfo((NestPath) pathnode), selec = 1.0;
|
||||||
tmplist != LispNil;
|
tmplist != LispNil;
|
||||||
tmplist = lnext(tmplist))
|
tmplist = lnext(tmplist))
|
||||||
{
|
{
|
||||||
@ -1006,14 +1006,14 @@ xfunc_get_path_cost(Query *queryInfo, Path pathnode)
|
|||||||
** Recalculate the cost of a path node. This includes the basic cost of the
|
** Recalculate the cost of a path node. This includes the basic cost of the
|
||||||
** node, as well as the cost of its expensive functions.
|
** node, as well as the cost of its expensive functions.
|
||||||
** We need to do this to the parent after pulling a clause from a child into a
|
** We need to do this to the parent after pulling a clause from a child into a
|
||||||
** parent. Thus we should only be calling this function on JoinPaths.
|
** parent. Thus we should only be calling this function on NestPaths.
|
||||||
*/
|
*/
|
||||||
Cost
|
Cost
|
||||||
xfunc_total_path_cost(JoinPath pathnode)
|
xfunc_total_path_cost(NestPath pathnode)
|
||||||
{
|
{
|
||||||
Cost cost = xfunc_get_path_cost((Path) pathnode);
|
Cost cost = xfunc_get_path_cost((Path) pathnode);
|
||||||
|
|
||||||
Assert(IsA(pathnode, JoinPath));
|
Assert(IsA(pathnode, NestPath));
|
||||||
if (IsA(pathnode, MergePath))
|
if (IsA(pathnode, MergePath))
|
||||||
{
|
{
|
||||||
MergePath mrgnode = (MergePath) pathnode;
|
MergePath mrgnode = (MergePath) pathnode;
|
||||||
@ -1089,7 +1089,7 @@ xfunc_total_path_cost(JoinPath pathnode)
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
Cost
|
Cost
|
||||||
xfunc_expense_per_tuple(JoinPath joinnode, int whichchild)
|
xfunc_expense_per_tuple(NestPath joinnode, int whichchild)
|
||||||
{
|
{
|
||||||
RelOptInfo outerrel = get_parent((Path) get_outerjoinpath(joinnode));
|
RelOptInfo outerrel = get_parent((Path) get_outerjoinpath(joinnode));
|
||||||
RelOptInfo innerrel = get_parent((Path) get_innerjoinpath(joinnode));
|
RelOptInfo innerrel = get_parent((Path) get_innerjoinpath(joinnode));
|
||||||
@ -1118,7 +1118,7 @@ xfunc_expense_per_tuple(JoinPath joinnode, int whichchild)
|
|||||||
else
|
else
|
||||||
/* nestloop */
|
/* nestloop */
|
||||||
{
|
{
|
||||||
Assert(IsA(joinnode, JoinPath));
|
Assert(IsA(joinnode, NestPath));
|
||||||
return _CPU_PAGE_WEIGHT_;
|
return _CPU_PAGE_WEIGHT_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1375,7 +1375,7 @@ xfunc_tuple_width(Relation rd)
|
|||||||
** Find the number of join clauses associated with this join path
|
** Find the number of join clauses associated with this join path
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
xfunc_num_join_clauses(JoinPath path)
|
xfunc_num_join_clauses(NestPath path)
|
||||||
{
|
{
|
||||||
int num = length(get_pathrestrictinfo(path));
|
int num = length(get_pathrestrictinfo(path));
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.43 1999/02/11 14:58:54 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.44 1999/02/12 06:43:33 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -45,12 +45,12 @@
|
|||||||
|
|
||||||
static List *switch_outer(List *clauses);
|
static List *switch_outer(List *clauses);
|
||||||
static Scan *create_scan_node(Path *best_path, List *tlist);
|
static Scan *create_scan_node(Path *best_path, List *tlist);
|
||||||
static Join *create_join_node(JoinPath *best_path, List *tlist);
|
static Join *create_join_node(NestPath *best_path, List *tlist);
|
||||||
static SeqScan *create_seqscan_node(Path *best_path, List *tlist,
|
static SeqScan *create_seqscan_node(Path *best_path, List *tlist,
|
||||||
List *scan_clauses);
|
List *scan_clauses);
|
||||||
static IndexScan *create_indexscan_node(IndexPath *best_path, List *tlist,
|
static IndexScan *create_indexscan_node(IndexPath *best_path, List *tlist,
|
||||||
List *scan_clauses);
|
List *scan_clauses);
|
||||||
static NestLoop *create_nestloop_node(JoinPath *best_path, List *tlist,
|
static NestLoop *create_nestloop_node(NestPath *best_path, List *tlist,
|
||||||
List *clauses, Plan *outer_node, List *outer_tlist,
|
List *clauses, Plan *outer_node, List *outer_tlist,
|
||||||
Plan *inner_node, List *inner_tlist);
|
Plan *inner_node, List *inner_tlist);
|
||||||
static MergeJoin *create_mergejoin_node(MergePath *best_path, List *tlist,
|
static MergeJoin *create_mergejoin_node(MergePath *best_path, List *tlist,
|
||||||
@ -117,7 +117,7 @@ create_plan(Path *best_path)
|
|||||||
case T_HashJoin:
|
case T_HashJoin:
|
||||||
case T_MergeJoin:
|
case T_MergeJoin:
|
||||||
case T_NestLoop:
|
case T_NestLoop:
|
||||||
plan_node = (Plan *) create_join_node((JoinPath *) best_path, tlist);
|
plan_node = (Plan *) create_join_node((NestPath *) best_path, tlist);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* do nothing */
|
/* do nothing */
|
||||||
@ -204,7 +204,7 @@ create_scan_node(Path *best_path, List *tlist)
|
|||||||
* Returns the join node.
|
* Returns the join node.
|
||||||
*/
|
*/
|
||||||
static Join *
|
static Join *
|
||||||
create_join_node(JoinPath *best_path, List *tlist)
|
create_join_node(NestPath *best_path, List *tlist)
|
||||||
{
|
{
|
||||||
Plan *outer_node;
|
Plan *outer_node;
|
||||||
List *outer_tlist;
|
List *outer_tlist;
|
||||||
@ -242,7 +242,7 @@ create_join_node(JoinPath *best_path, List *tlist)
|
|||||||
inner_tlist);
|
inner_tlist);
|
||||||
break;
|
break;
|
||||||
case T_NestLoop:
|
case T_NestLoop:
|
||||||
retval = (Join *) create_nestloop_node((JoinPath *) best_path,
|
retval = (Join *) create_nestloop_node((NestPath *) best_path,
|
||||||
tlist,
|
tlist,
|
||||||
clauses,
|
clauses,
|
||||||
outer_node,
|
outer_node,
|
||||||
@ -416,7 +416,7 @@ create_indexscan_node(IndexPath *best_path,
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
static NestLoop *
|
static NestLoop *
|
||||||
create_nestloop_node(JoinPath *best_path,
|
create_nestloop_node(NestPath *best_path,
|
||||||
List *tlist,
|
List *tlist,
|
||||||
List *clauses,
|
List *clauses,
|
||||||
Plan *outer_node,
|
Plan *outer_node,
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.33 1999/02/12 05:56:57 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.34 1999/02/12 06:43:37 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -473,14 +473,14 @@ create_index_path(Query *root,
|
|||||||
* Returns the resulting path node.
|
* Returns the resulting path node.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
JoinPath *
|
NestPath *
|
||||||
create_nestloop_path(RelOptInfo *joinrel,
|
create_nestloop_path(RelOptInfo *joinrel,
|
||||||
RelOptInfo *outer_rel,
|
RelOptInfo *outer_rel,
|
||||||
Path *outer_path,
|
Path *outer_path,
|
||||||
Path *inner_path,
|
Path *inner_path,
|
||||||
List *pathkeys)
|
List *pathkeys)
|
||||||
{
|
{
|
||||||
JoinPath *pathnode = makeNode(JoinPath);
|
NestPath *pathnode = makeNode(NestPath);
|
||||||
|
|
||||||
pathnode->path.pathtype = T_NestLoop;
|
pathnode->path.pathtype = T_NestLoop;
|
||||||
pathnode->path.parent = joinrel;
|
pathnode->path.parent = joinrel;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: nodes.h,v 1.41 1999/02/09 17:03:11 momjian Exp $
|
* $Id: nodes.h,v 1.42 1999/02/12 06:43:45 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -74,7 +74,7 @@ typedef enum NodeTag
|
|||||||
T_PathOrder,
|
T_PathOrder,
|
||||||
T_Path,
|
T_Path,
|
||||||
T_IndexPath,
|
T_IndexPath,
|
||||||
T_JoinPath,
|
T_NestPath,
|
||||||
T_MergePath,
|
T_MergePath,
|
||||||
T_HashPath,
|
T_HashPath,
|
||||||
T_OrderKey,
|
T_OrderKey,
|
||||||
@ -244,7 +244,7 @@ typedef struct Node
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
#define IsA_JoinPath(jp) \
|
#define IsA_JoinPath(jp) \
|
||||||
(nodeTag(jp)==T_JoinPath || nodeTag(jp)==T_MergePath || \
|
(nodeTag(jp)==T_NestPath || nodeTag(jp)==T_MergePath || \
|
||||||
nodeTag(jp)==T_HashPath)
|
nodeTag(jp)==T_HashPath)
|
||||||
|
|
||||||
#define IsA_Join(j) \
|
#define IsA_Join(j) \
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: relation.h,v 1.20 1999/02/12 05:57:01 momjian Exp $
|
* $Id: relation.h,v 1.21 1999/02/12 06:43:47 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -160,17 +160,17 @@ typedef struct IndexPath
|
|||||||
int *indexkeys; /* to transform heap attnos into index ones */
|
int *indexkeys; /* to transform heap attnos into index ones */
|
||||||
} IndexPath;
|
} IndexPath;
|
||||||
|
|
||||||
typedef struct JoinPath
|
typedef struct NestPath
|
||||||
{
|
{
|
||||||
Path path;
|
Path path;
|
||||||
List *pathinfo;
|
List *pathinfo;
|
||||||
Path *outerjoinpath;
|
Path *outerjoinpath;
|
||||||
Path *innerjoinpath;
|
Path *innerjoinpath;
|
||||||
} JoinPath;
|
} NestPath;
|
||||||
|
|
||||||
typedef struct MergePath
|
typedef struct MergePath
|
||||||
{
|
{
|
||||||
JoinPath jpath;
|
NestPath jpath;
|
||||||
List *path_mergeclauses;
|
List *path_mergeclauses;
|
||||||
List *outersortkeys;
|
List *outersortkeys;
|
||||||
List *innersortkeys;
|
List *innersortkeys;
|
||||||
@ -178,7 +178,7 @@ typedef struct MergePath
|
|||||||
|
|
||||||
typedef struct HashPath
|
typedef struct HashPath
|
||||||
{
|
{
|
||||||
JoinPath jpath;
|
NestPath jpath;
|
||||||
List *path_hashclauses;
|
List *path_hashclauses;
|
||||||
List *outerhashkeys;
|
List *outerhashkeys;
|
||||||
List *innerhashkeys;
|
List *innerhashkeys;
|
||||||
@ -262,7 +262,7 @@ typedef struct Iter
|
|||||||
/*
|
/*
|
||||||
** Stream:
|
** Stream:
|
||||||
** A stream represents a root-to-leaf path in a plan tree (i.e. a tree of
|
** A stream represents a root-to-leaf path in a plan tree (i.e. a tree of
|
||||||
** JoinPaths and Paths). The stream includes pointers to all Path nodes,
|
** NestPaths and Paths). The stream includes pointers to all Path nodes,
|
||||||
** as well as to any clauses that reside above Path nodes. This structure
|
** as well as to any clauses that reside above Path nodes. This structure
|
||||||
** is used to make Path nodes and clauses look similar, so that Predicate
|
** is used to make Path nodes and clauses look similar, so that Predicate
|
||||||
** Migration can run.
|
** Migration can run.
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: cost.h,v 1.14 1999/02/10 21:02:43 momjian Exp $
|
* $Id: cost.h,v 1.15 1999/02/12 06:43:52 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -45,7 +45,7 @@ extern Cost cost_hashjoin(Cost outercost, Cost innercost, List *outerkeys,
|
|||||||
int outerwidth, int innerwidth);
|
int outerwidth, int innerwidth);
|
||||||
extern int compute_rel_size(RelOptInfo *rel);
|
extern int compute_rel_size(RelOptInfo *rel);
|
||||||
extern int compute_rel_width(RelOptInfo *rel);
|
extern int compute_rel_width(RelOptInfo *rel);
|
||||||
extern int compute_joinrel_size(JoinPath *joinpath);
|
extern int compute_joinrel_size(NestPath *joinpath);
|
||||||
extern int page_size(int tuples, int width);
|
extern int page_size(int tuples, int width);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: pathnode.h,v 1.12 1999/02/10 21:02:49 momjian Exp $
|
* $Id: pathnode.h,v 1.13 1999/02/12 06:43:53 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -27,7 +27,7 @@ extern List *add_pathlist(RelOptInfo *parent_rel, List *unique_paths,
|
|||||||
extern Path *create_seqscan_path(RelOptInfo *rel);
|
extern Path *create_seqscan_path(RelOptInfo *rel);
|
||||||
extern IndexPath *create_index_path(Query *root, RelOptInfo *rel, RelOptInfo *index,
|
extern IndexPath *create_index_path(Query *root, RelOptInfo *rel, RelOptInfo *index,
|
||||||
List *restriction_clauses, bool is_join_scan);
|
List *restriction_clauses, bool is_join_scan);
|
||||||
extern JoinPath *create_nestloop_path(RelOptInfo *joinrel, RelOptInfo *outer_rel,
|
extern NestPath *create_nestloop_path(RelOptInfo *joinrel, RelOptInfo *outer_rel,
|
||||||
Path *outer_path, Path *inner_path, List *pathkeys);
|
Path *outer_path, Path *inner_path, List *pathkeys);
|
||||||
extern MergePath *create_mergejoin_path(RelOptInfo *joinrel, int outersize,
|
extern MergePath *create_mergejoin_path(RelOptInfo *joinrel, int outersize,
|
||||||
int innersize, int outerwidth, int innerwidth, Path *outer_path,
|
int innersize, int outerwidth, int innerwidth, Path *outer_path,
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: xfunc.h,v 1.12 1999/02/10 21:02:50 momjian Exp $
|
* $Id: xfunc.h,v 1.13 1999/02/12 06:43:53 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -50,13 +50,13 @@ extern int XfuncMode; /* defined in tcop/postgres.c */
|
|||||||
|
|
||||||
/* function prototypes from planner/path/xfunc.c */
|
/* function prototypes from planner/path/xfunc.c */
|
||||||
extern void xfunc_trypullup(RelOptInfo *rel);
|
extern void xfunc_trypullup(RelOptInfo *rel);
|
||||||
extern int xfunc_shouldpull(Path *childpath, JoinPath *parentpath,
|
extern int xfunc_shouldpull(Path *childpath, NestPath *parentpath,
|
||||||
int whichchild, RestrictInfo * maxcinfopt);
|
int whichchild, RestrictInfo * maxcinfopt);
|
||||||
extern RestrictInfo *xfunc_pullup(Path *childpath, JoinPath *parentpath, RestrictInfo * cinfo,
|
extern RestrictInfo *xfunc_pullup(Path *childpath, NestPath *parentpath, RestrictInfo * cinfo,
|
||||||
int whichchild, int clausetype);
|
int whichchild, int clausetype);
|
||||||
extern Cost xfunc_rank(Expr *clause);
|
extern Cost xfunc_rank(Expr *clause);
|
||||||
extern Cost xfunc_expense(Query *queryInfo, Expr *clause);
|
extern Cost xfunc_expense(Query *queryInfo, Expr *clause);
|
||||||
extern Cost xfunc_join_expense(JoinPath *path, int whichchild);
|
extern Cost xfunc_join_expense(NestPath *path, int whichchild);
|
||||||
extern Cost xfunc_local_expense(Expr *clause);
|
extern Cost xfunc_local_expense(Expr *clause);
|
||||||
extern Cost xfunc_func_expense(Expr *node, List *args);
|
extern Cost xfunc_func_expense(Expr *node, List *args);
|
||||||
extern int xfunc_width(Expr *clause);
|
extern int xfunc_width(Expr *clause);
|
||||||
@ -65,10 +65,10 @@ extern int xfunc_width(Expr *clause);
|
|||||||
/* extern int xfunc_card_unreferenced(Expr *clause, Relid referenced); */
|
/* extern int xfunc_card_unreferenced(Expr *clause, Relid referenced); */
|
||||||
extern int xfunc_card_product(Relid relids);
|
extern int xfunc_card_product(Relid relids);
|
||||||
extern List *xfunc_find_references(List *clause);
|
extern List *xfunc_find_references(List *clause);
|
||||||
extern List *xfunc_primary_join(JoinPath *pathnode);
|
extern List *xfunc_primary_join(NestPath *pathnode);
|
||||||
extern Cost xfunc_get_path_cost(Path *pathnode);
|
extern Cost xfunc_get_path_cost(Path *pathnode);
|
||||||
extern Cost xfunc_total_path_cost(JoinPath *pathnode);
|
extern Cost xfunc_total_path_cost(NestPath *pathnode);
|
||||||
extern Cost xfunc_expense_per_tuple(JoinPath *joinnode, int whichchild);
|
extern Cost xfunc_expense_per_tuple(NestPath *joinnode, int whichchild);
|
||||||
extern void xfunc_fixvars(Expr *clause, RelOptInfo *rel, int varno);
|
extern void xfunc_fixvars(Expr *clause, RelOptInfo *rel, int varno);
|
||||||
extern int xfunc_cinfo_compare(void *arg1, void *arg2);
|
extern int xfunc_cinfo_compare(void *arg1, void *arg2);
|
||||||
extern int xfunc_clause_compare(void *arg1, void *arg2);
|
extern int xfunc_clause_compare(void *arg1, void *arg2);
|
||||||
@ -76,7 +76,7 @@ extern void xfunc_disjunct_sort(List *clause_list);
|
|||||||
extern int xfunc_disjunct_compare(void *arg1, void *arg2);
|
extern int xfunc_disjunct_compare(void *arg1, void *arg2);
|
||||||
extern int xfunc_func_width(RegProcedure funcid, List *args);
|
extern int xfunc_func_width(RegProcedure funcid, List *args);
|
||||||
extern int xfunc_tuple_width(Relation rd);
|
extern int xfunc_tuple_width(Relation rd);
|
||||||
extern int xfunc_num_join_clauses(JoinPath *path);
|
extern int xfunc_num_join_clauses(NestPath *path);
|
||||||
extern List *xfunc_LispRemove(List *foo, List *bar);
|
extern List *xfunc_LispRemove(List *foo, List *bar);
|
||||||
extern bool xfunc_copyrel(RelOptInfo *from, RelOptInfo ** to);
|
extern bool xfunc_copyrel(RelOptInfo *from, RelOptInfo ** to);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user