mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
Optimizer cleanup.
This commit is contained in:
parent
d5db88142c
commit
6e2edaf4b8
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.61 1999/02/04 03:19:06 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.62 1999/02/05 19:59:25 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1343,7 +1343,7 @@ _copyRestrictInfo(RestrictInfo * from)
|
|||||||
Node_Copy(from, newnode, indexids);
|
Node_Copy(from, newnode, indexids);
|
||||||
Node_Copy(from, newnode, mergejoinorder);
|
Node_Copy(from, newnode, mergejoinorder);
|
||||||
newnode->hashjoinoperator = from->hashjoinoperator;
|
newnode->hashjoinoperator = from->hashjoinoperator;
|
||||||
newnode->cinfojoinid = listCopy(from->cinfojoinid);
|
newnode->restrictinfojoinid = listCopy(from->restrictinfojoinid);
|
||||||
|
|
||||||
return newnode;
|
return newnode;
|
||||||
}
|
}
|
||||||
|
@ -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.64 1999/02/04 01:46:54 momjian Exp $
|
* $Id: outfuncs.c,v 1.65 1999/02/05 19:59:25 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
|
||||||
@ -1107,7 +1107,7 @@ _outMergeOrder(StringInfo str, MergeOrder *node)
|
|||||||
static void
|
static void
|
||||||
_outRestrictInfo(StringInfo str, RestrictInfo * node)
|
_outRestrictInfo(StringInfo str, RestrictInfo * node)
|
||||||
{
|
{
|
||||||
appendStringInfo(str, " CINFO :clause ");
|
appendStringInfo(str, " RESTRICTINFO :clause ");
|
||||||
_outNode(str, node->clause);
|
_outNode(str, node->clause);
|
||||||
|
|
||||||
appendStringInfo(str,
|
appendStringInfo(str,
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.48 1999/02/04 03:19:06 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.49 1999/02/05 19:59:25 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
|
||||||
@ -2087,13 +2087,13 @@ parsePlanString(void)
|
|||||||
return_value = _readJoinKey();
|
return_value = _readJoinKey();
|
||||||
else if (!strncmp(token, "MERGEORDER", length))
|
else if (!strncmp(token, "MERGEORDER", length))
|
||||||
return_value = _readMergeOrder();
|
return_value = _readMergeOrder();
|
||||||
else if (!strncmp(token, "CLAUSEINFO", length))
|
else if (!strncmp(token, "RETRICTINFO", length))
|
||||||
return_value = _readRestrictInfo();
|
return_value = _readRestrictInfo();
|
||||||
else if (!strncmp(token, "JOINMETHOD", length))
|
else if (!strncmp(token, "JOINMETHOD", length))
|
||||||
return_value = _readJoinMethod();
|
return_value = _readJoinMethod();
|
||||||
else if (!strncmp(token, "JOININFO", length))
|
else if (!strncmp(token, "JOININFO", length))
|
||||||
return_value = _readJoinInfo();
|
return_value = _readJoinInfo();
|
||||||
else if (!strncmp(token, "HINFO", length))
|
else if (!strncmp(token, "HASHINFO", length))
|
||||||
return_value = _readHashInfo();
|
return_value = _readHashInfo();
|
||||||
else if (!strncmp(token, "ITER", length))
|
else if (!strncmp(token, "ITER", length))
|
||||||
return_value = _readIter();
|
return_value = _readIter();
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.37 1999/02/03 21:16:26 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.38 1999/02/05 19:59:26 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -56,7 +56,7 @@ static List *group_clauses_by_indexkey(RelOptInfo * rel, RelOptInfo * index,
|
|||||||
static List *group_clauses_by_ikey_for_joins(RelOptInfo * rel, RelOptInfo * index,
|
static List *group_clauses_by_ikey_for_joins(RelOptInfo * rel, RelOptInfo * index,
|
||||||
int *indexkeys, Oid *classes, List *join_cinfo_list, List *restr_cinfo_list);
|
int *indexkeys, Oid *classes, List *join_cinfo_list, List *restr_cinfo_list);
|
||||||
static RestrictInfo *match_clause_to_indexkey(RelOptInfo * rel, RelOptInfo * index, int indexkey,
|
static RestrictInfo *match_clause_to_indexkey(RelOptInfo * rel, RelOptInfo * index, int indexkey,
|
||||||
int xclass, RestrictInfo * clauseInfo, bool join);
|
int xclass, RestrictInfo * restrictInfo, bool join);
|
||||||
static bool pred_test(List *predicate_list, List *restrictinfo_list,
|
static bool pred_test(List *predicate_list, List *restrictinfo_list,
|
||||||
List *joininfo_list);
|
List *joininfo_list);
|
||||||
static bool one_pred_test(Expr *predicate, List *restrictinfo_list);
|
static bool one_pred_test(Expr *predicate, List *restrictinfo_list);
|
||||||
@ -575,10 +575,10 @@ match_clause_to_indexkey(RelOptInfo * rel,
|
|||||||
RelOptInfo *index,
|
RelOptInfo *index,
|
||||||
int indexkey,
|
int indexkey,
|
||||||
int xclass,
|
int xclass,
|
||||||
RestrictInfo * clauseInfo,
|
RestrictInfo *restrictInfo,
|
||||||
bool join)
|
bool join)
|
||||||
{
|
{
|
||||||
Expr *clause = clauseInfo->clause;
|
Expr *clause = restrictInfo->clause;
|
||||||
Var *leftop,
|
Var *leftop,
|
||||||
*rightop;
|
*rightop;
|
||||||
Oid join_op = InvalidOid;
|
Oid join_op = InvalidOid;
|
||||||
@ -761,7 +761,7 @@ match_clause_to_indexkey(RelOptInfo * rel,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isIndexable)
|
if (isIndexable)
|
||||||
return clauseInfo;
|
return restrictInfo;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -1208,7 +1208,7 @@ indexable_joinclauses(RelOptInfo * rel, RelOptInfo * index,
|
|||||||
{
|
{
|
||||||
List *clauses = lfirst(clausegroups);
|
List *clauses = lfirst(clausegroups);
|
||||||
|
|
||||||
((RestrictInfo *) lfirst(clauses))->cinfojoinid = joininfo->otherrels;
|
((RestrictInfo *) lfirst(clauses))->restrictinfojoinid = joininfo->otherrels;
|
||||||
}
|
}
|
||||||
cg_list = nconc(cg_list, clausegroups);
|
cg_list = nconc(cg_list, clausegroups);
|
||||||
}
|
}
|
||||||
@ -1298,7 +1298,7 @@ index_innerjoin(Query *root, RelOptInfo * rel, List *clausegroup_list,
|
|||||||
pathnode->indexkeys = index->indexkeys;
|
pathnode->indexkeys = index->indexkeys;
|
||||||
pathnode->indexqual = clausegroup;
|
pathnode->indexqual = clausegroup;
|
||||||
|
|
||||||
pathnode->path.joinid = ((RestrictInfo *) lfirst(clausegroup))->cinfojoinid;
|
pathnode->path.joinid = ((RestrictInfo *) lfirst(clausegroup))->restrictinfojoinid;
|
||||||
|
|
||||||
pathnode->path.path_cost = cost_index((Oid) lfirsti(index->relids),
|
pathnode->path.path_cost = cost_index((Oid) lfirsti(index->relids),
|
||||||
(int) temp_pages,
|
(int) temp_pages,
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.21 1999/02/05 03:43:05 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.22 1999/02/05 19:59:26 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -64,9 +64,9 @@ prune_joinrel(RelOptInfo *rel, List *other_rels)
|
|||||||
List *r1 = NIL;
|
List *r1 = NIL;
|
||||||
List *result = NIL;
|
List *result = NIL;
|
||||||
|
|
||||||
foreach(r1, other_rels)
|
foreach(i, other_rels)
|
||||||
{
|
{
|
||||||
RelOptInfo *other_rel = (RelOptInfo *) lfirst(r1);
|
RelOptInfo *other_rel = (RelOptInfo *) lfirst(i);
|
||||||
|
|
||||||
if (same(rel->relids, other_rel->relids))
|
if (same(rel->relids, other_rel->relids))
|
||||||
/*
|
/*
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.36 1999/02/03 21:16:30 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.37 1999/02/05 19:59:27 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -321,7 +321,7 @@ create_indexscan_node(IndexPath *best_path,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Extract the(first if conjunct, only if disjunct) clause from the
|
* Extract the(first if conjunct, only if disjunct) clause from the
|
||||||
* clauseinfo list.
|
* restrictinfo list.
|
||||||
*/
|
*/
|
||||||
Expr *index_clause = (Expr *) NULL;
|
Expr *index_clause = (Expr *) NULL;
|
||||||
List *indxqual = NIL;
|
List *indxqual = NIL;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# Makefile for optimizer/util
|
# Makefile for optimizer/util
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# IDENTIFICATION
|
||||||
# $Header: /cvsroot/pgsql/src/backend/optimizer/util/Makefile,v 1.7 1998/07/20 20:01:48 momjian Exp $
|
# $Header: /cvsroot/pgsql/src/backend/optimizer/util/Makefile,v 1.8 1999/02/05 19:59:28 momjian Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ include ../../../Makefile.global
|
|||||||
|
|
||||||
CFLAGS += -I../..
|
CFLAGS += -I../..
|
||||||
|
|
||||||
OBJS = clauseinfo.o clauses.o indexnode.o plancat.o \
|
OBJS = restrictinfo.o clauses.o indexnode.o plancat.o \
|
||||||
joininfo.o keys.o ordering.o pathnode.o relnode.o tlist.o var.o
|
joininfo.o keys.o ordering.o pathnode.o relnode.o tlist.o var.o
|
||||||
|
|
||||||
# not ready yet: predmig.o xfunc.o
|
# not ready yet: predmig.o xfunc.o
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/ordering.c,v 1.9 1999/02/03 21:16:51 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/ordering.c,v 1.10 1999/02/05 19:59:30 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/clauseinfo.c,v 1.11 1999/02/03 21:16:50 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/restrictinfo.c,v 1.1 1999/02/05 19:59:31 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
@ -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.14 1999/02/04 03:19:10 momjian Exp $
|
* $Id: relation.h,v 1.15 1999/02/05 19:59:31 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -219,7 +219,7 @@ typedef struct RestrictInfo
|
|||||||
|
|
||||||
/* hashjoin only */
|
/* hashjoin only */
|
||||||
Oid hashjoinoperator;
|
Oid hashjoinoperator;
|
||||||
Relid cinfojoinid;
|
Relid restrictinfojoinid;
|
||||||
} RestrictInfo;
|
} RestrictInfo;
|
||||||
|
|
||||||
typedef struct JoinMethod
|
typedef struct JoinMethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user