diff options
| author | Tom Lane | 2001-05-20 20:28:20 +0000 |
|---|---|---|
| committer | Tom Lane | 2001-05-20 20:28:20 +0000 |
| commit | be03eb25f34c9c95c400504ef76c8abe0081d09f (patch) | |
| tree | ca3b081710826485bdaaad375b80e82f5a7fd611 /src/include | |
| parent | 5d53389cfe5ecacadda12f3a777a642605278e49 (diff) | |
Modify optimizer data structures so that IndexOptInfo lists built for
create_index_paths are not immediately discarded, but are available for
subsequent planner work. This allows avoiding redundant syscache lookups
in several places. Change interface to operator selectivity estimation
procedures to allow faster and more flexible estimation.
Initdb forced due to change of pg_proc entries for selectivity functions!
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/catalog/catversion.h | 4 | ||||
| -rw-r--r-- | src/include/catalog/pg_proc.h | 62 | ||||
| -rw-r--r-- | src/include/nodes/parsenodes.h | 3 | ||||
| -rw-r--r-- | src/include/nodes/relation.h | 47 | ||||
| -rw-r--r-- | src/include/optimizer/clauses.h | 15 | ||||
| -rw-r--r-- | src/include/optimizer/pathnode.h | 9 | ||||
| -rw-r--r-- | src/include/optimizer/paths.h | 4 | ||||
| -rw-r--r-- | src/include/optimizer/plancat.h | 22 | ||||
| -rw-r--r-- | src/include/optimizer/prep.h | 6 |
9 files changed, 88 insertions, 84 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 44ddb7611a5..e04f97e0ec8 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -37,7 +37,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: catversion.h,v 1.78 2001/05/15 03:49:35 momjian Exp $ + * $Id: catversion.h,v 1.79 2001/05/20 20:28:19 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 200105145 +#define CATALOG_VERSION_NO 200105191 #endif diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 7d7acf96f73..f905a063c63 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_proc.h,v 1.185 2001/05/09 23:13:35 tgl Exp $ + * $Id: pg_proc.h,v 1.186 2001/05/20 20:28:19 tgl Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -219,21 +219,21 @@ DESCR("btree cost estimator"); DATA(insert OID = 100 ( int8fac PGUID 12 f t t t 1 f 20 "20" 100 0 0 100 int8fac - )); DESCR("factorial"); -DATA(insert OID = 101 ( eqsel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 eqsel - )); +DATA(insert OID = 101 ( eqsel PGUID 12 f t f t 4 f 701 "0 26 0 23" 100 0 0 100 eqsel - )); DESCR("restriction selectivity of = and related operators"); -DATA(insert OID = 102 ( neqsel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 neqsel - )); +DATA(insert OID = 102 ( neqsel PGUID 12 f t f t 4 f 701 "0 26 0 23" 100 0 0 100 neqsel - )); DESCR("restriction selectivity of <> and related operators"); -DATA(insert OID = 103 ( scalarltsel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 scalarltsel - )); +DATA(insert OID = 103 ( scalarltsel PGUID 12 f t f t 4 f 701 "0 26 0 23" 100 0 0 100 scalarltsel - )); DESCR("restriction selectivity of < and related operators on scalar datatypes"); -DATA(insert OID = 104 ( scalargtsel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 scalargtsel - )); +DATA(insert OID = 104 ( scalargtsel PGUID 12 f t f t 4 f 701 "0 26 0 23" 100 0 0 100 scalargtsel - )); DESCR("restriction selectivity of > and related operators on scalar datatypes"); -DATA(insert OID = 105 ( eqjoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 eqjoinsel - )); +DATA(insert OID = 105 ( eqjoinsel PGUID 12 f t f t 3 f 701 "0 26 0" 100 0 0 100 eqjoinsel - )); DESCR("join selectivity of = and related operators"); -DATA(insert OID = 106 ( neqjoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 neqjoinsel - )); +DATA(insert OID = 106 ( neqjoinsel PGUID 12 f t f t 3 f 701 "0 26 0" 100 0 0 100 neqjoinsel - )); DESCR("join selectivity of <> and related operators"); -DATA(insert OID = 107 ( scalarltjoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 scalarltjoinsel - )); +DATA(insert OID = 107 ( scalarltjoinsel PGUID 12 f t f t 3 f 701 "0 26 0" 100 0 0 100 scalarltjoinsel - )); DESCR("join selectivity of < and related operators on scalar datatypes"); -DATA(insert OID = 108 ( scalargtjoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 scalargtjoinsel - )); +DATA(insert OID = 108 ( scalargtjoinsel PGUID 12 f t f t 3 f 701 "0 26 0" 100 0 0 100 scalargtjoinsel - )); DESCR("join selectivity of > and related operators on scalar datatypes"); DATA(insert OID = 112 ( text PGUID 12 f t t t 1 f 25 "23" 100 0 0 100 int4_text - )); @@ -292,9 +292,9 @@ DATA(insert OID = 137 ( on_ppath PGUID 12 f t t t 2 f 16 "600 602" 100 0 0 DESCR("contained in"); DATA(insert OID = 138 ( box_center PGUID 12 f t t t 1 f 600 "603" 100 0 0 100 box_center - )); DESCR("center of"); -DATA(insert OID = 139 ( areasel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 areasel - )); +DATA(insert OID = 139 ( areasel PGUID 12 f t f t 4 f 701 "0 26 0 23" 100 0 0 100 areasel - )); DESCR("restriction selectivity for area-comparison operators"); -DATA(insert OID = 140 ( areajoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 areajoinsel - )); +DATA(insert OID = 140 ( areajoinsel PGUID 12 f t f t 3 f 701 "0 26 0" 100 0 0 100 areajoinsel - )); DESCR("join selectivity for area-comparison operators"); DATA(insert OID = 141 ( int4mul PGUID 12 f t t t 2 f 23 "23 23" 100 0 0 100 int4mul - )); DESCR("multiply"); @@ -1562,13 +1562,13 @@ DESCR("current transaction time"); /* OIDS 1300 - 1399 */ -DATA(insert OID = 1300 ( positionsel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 positionsel - )); +DATA(insert OID = 1300 ( positionsel PGUID 12 f t f t 4 f 701 "0 26 0 23" 100 0 0 100 positionsel - )); DESCR("restriction selectivity for position-comparison operators"); -DATA(insert OID = 1301 ( positionjoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 positionjoinsel - )); +DATA(insert OID = 1301 ( positionjoinsel PGUID 12 f t f t 3 f 701 "0 26 0" 100 0 0 100 positionjoinsel - )); DESCR("join selectivity for position-comparison operators"); -DATA(insert OID = 1302 ( contsel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 contsel - )); +DATA(insert OID = 1302 ( contsel PGUID 12 f t f t 4 f 701 "0 26 0 23" 100 0 0 100 contsel - )); DESCR("restriction selectivity for containment comparison operators"); -DATA(insert OID = 1303 ( contjoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 contjoinsel - )); +DATA(insert OID = 1303 ( contjoinsel PGUID 12 f t f t 3 f 701 "0 26 0" 100 0 0 100 contjoinsel - )); DESCR("join selectivity for containment comparison operators"); DATA(insert OID = 1304 ( overlaps PGUID 12 f t t f 4 f 16 "1184 1184 1184 1184" 100 0 0 100 overlaps_timestamp - )); @@ -2465,37 +2465,37 @@ DATA(insert OID = 1799 ( oidout PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 oid DESCR("(internal)"); /* Selectivity estimators for LIKE and related operators */ -DATA(insert OID = 1814 ( iclikesel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 iclikesel - )); +DATA(insert OID = 1814 ( iclikesel PGUID 12 f t f t 4 f 701 "0 26 0 23" 100 0 0 100 iclikesel - )); DESCR("restriction selectivity of ILIKE"); -DATA(insert OID = 1815 ( icnlikesel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 icnlikesel - )); +DATA(insert OID = 1815 ( icnlikesel PGUID 12 f t f t 4 f 701 "0 26 0 23" 100 0 0 100 icnlikesel - )); DESCR("restriction selectivity of NOT ILIKE"); -DATA(insert OID = 1816 ( iclikejoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 iclikejoinsel - )); +DATA(insert OID = 1816 ( iclikejoinsel PGUID 12 f t f t 3 f 701 "0 26 0" 100 0 0 100 iclikejoinsel - )); DESCR("join selectivity of ILIKE"); -DATA(insert OID = 1817 ( icnlikejoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 icnlikejoinsel - )); +DATA(insert OID = 1817 ( icnlikejoinsel PGUID 12 f t f t 3 f 701 "0 26 0" 100 0 0 100 icnlikejoinsel - )); DESCR("join selectivity of NOT ILIKE"); -DATA(insert OID = 1818 ( regexeqsel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 regexeqsel - )); +DATA(insert OID = 1818 ( regexeqsel PGUID 12 f t f t 4 f 701 "0 26 0 23" 100 0 0 100 regexeqsel - )); DESCR("restriction selectivity of regex match"); -DATA(insert OID = 1819 ( likesel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 likesel - )); +DATA(insert OID = 1819 ( likesel PGUID 12 f t f t 4 f 701 "0 26 0 23" 100 0 0 100 likesel - )); DESCR("restriction selectivity of LIKE"); -DATA(insert OID = 1820 ( icregexeqsel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 icregexeqsel - )); +DATA(insert OID = 1820 ( icregexeqsel PGUID 12 f t f t 4 f 701 "0 26 0 23" 100 0 0 100 icregexeqsel - )); DESCR("restriction selectivity of case-insensitive regex match"); -DATA(insert OID = 1821 ( regexnesel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 regexnesel - )); +DATA(insert OID = 1821 ( regexnesel PGUID 12 f t f t 4 f 701 "0 26 0 23" 100 0 0 100 regexnesel - )); DESCR("restriction selectivity of regex non-match"); -DATA(insert OID = 1822 ( nlikesel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 nlikesel - )); +DATA(insert OID = 1822 ( nlikesel PGUID 12 f t f t 4 f 701 "0 26 0 23" 100 0 0 100 nlikesel - )); DESCR("restriction selectivity of NOT LIKE"); -DATA(insert OID = 1823 ( icregexnesel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 icregexnesel - )); +DATA(insert OID = 1823 ( icregexnesel PGUID 12 f t f t 4 f 701 "0 26 0 23" 100 0 0 100 icregexnesel - )); DESCR("restriction selectivity of case-insensitive regex non-match"); -DATA(insert OID = 1824 ( regexeqjoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 regexeqjoinsel - )); +DATA(insert OID = 1824 ( regexeqjoinsel PGUID 12 f t f t 3 f 701 "0 26 0" 100 0 0 100 regexeqjoinsel - )); DESCR("join selectivity of regex match"); -DATA(insert OID = 1825 ( likejoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 likejoinsel - )); +DATA(insert OID = 1825 ( likejoinsel PGUID 12 f t f t 3 f 701 "0 26 0" 100 0 0 100 likejoinsel - )); DESCR("join selectivity of LIKE"); -DATA(insert OID = 1826 ( icregexeqjoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 icregexeqjoinsel - )); +DATA(insert OID = 1826 ( icregexeqjoinsel PGUID 12 f t f t 3 f 701 "0 26 0" 100 0 0 100 icregexeqjoinsel - )); DESCR("join selectivity of case-insensitive regex match"); -DATA(insert OID = 1827 ( regexnejoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 regexnejoinsel - )); +DATA(insert OID = 1827 ( regexnejoinsel PGUID 12 f t f t 3 f 701 "0 26 0" 100 0 0 100 regexnejoinsel - )); DESCR("join selectivity of regex non-match"); -DATA(insert OID = 1828 ( nlikejoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 nlikejoinsel - )); +DATA(insert OID = 1828 ( nlikejoinsel PGUID 12 f t f t 3 f 701 "0 26 0" 100 0 0 100 nlikejoinsel - )); DESCR("join selectivity of NOT LIKE"); -DATA(insert OID = 1829 ( icregexnejoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 icregexnejoinsel - )); +DATA(insert OID = 1829 ( icregexnejoinsel PGUID 12 f t f t 3 f 701 "0 26 0" 100 0 0 100 icregexnejoinsel - )); DESCR("join selectivity of case-insensitive regex non-match"); /* Aggregate-related functions */ diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 63b1b1046a8..cfea5222965 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: parsenodes.h,v 1.127 2001/05/07 00:43:25 tgl Exp $ + * $Id: parsenodes.h,v 1.128 2001/05/20 20:28:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -83,6 +83,7 @@ typedef struct Query /* internal to planner */ List *base_rel_list; /* list of base-relation RelOptInfos */ + List *other_rel_list; /* list of other 1-relation RelOptInfos */ List *join_rel_list; /* list of join-relation RelOptInfos */ List *equi_key_list; /* list of lists of equijoined * PathKeyItems */ diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h index c76d9b4af71..33927edc18d 100644 --- a/src/include/nodes/relation.h +++ b/src/include/nodes/relation.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: relation.h,v 1.55 2001/05/07 00:43:26 tgl Exp $ + * $Id: relation.h,v 1.56 2001/05/20 20:28:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -72,8 +72,8 @@ typedef enum CostSelector * * If the relation is a base relation it will have these fields set: * * issubquery - true if baserel is a subquery RTE rather than a table - * indexed - true if the relation has secondary indices (always false - * if it's a subquery) + * indexlist - list of IndexOptInfo nodes for relation's indexes + * (always NIL if it's a subquery) * pages - number of disk pages in relation (zero if a subquery) * tuples - number of tuples in relation (not considering restrictions) * subplan - plan for subquery (NULL if it's a plain table) @@ -150,7 +150,7 @@ typedef struct RelOptInfo /* information about a base rel (not set for join rels!) */ bool issubquery; - bool indexed; + List *indexlist; long pages; double tuples; struct Plan *subplan; @@ -178,20 +178,30 @@ typedef struct RelOptInfo * and indexes, but that created confusion without actually doing anything * useful. So now we have a separate IndexOptInfo struct for indexes. * - * indexoid - OID of the index relation itself - * pages - number of disk pages in index - * tuples - number of index tuples in index + * indexoid - OID of the index relation itself + * pages - number of disk pages in index + * tuples - number of index tuples in index + * ncolumns - number of columns in index + * nkeys - number of keys used by index (input columns) * classlist - List of PG_AMOPCLASS OIDs for the index * indexkeys - List of base-relation attribute numbers that are index keys - * ordering - List of PG_OPERATOR OIDs which order the indexscan result - * relam - the OID of the pg_am of the index + * 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 + * unique - true if index is unique * lossy - true if index is lossy (may return non-matching tuples) * - * NB. the last element of the arrays classlist, indexkeys and ordering - * is always 0. + * ncolumns and nkeys are the same except for a functional index, + * wherein ncolumns is 1 (the single function output) while nkeys + * is the number of table columns passed to the function. classlist[] + * and ordering[] have ncolumns entries, while indexkeys[] has nkeys + * entries. + * + * Note: for historical reasons, the arrays classlist, indexkeys and + * ordering have an extra entry that is always zero. Some code scans + * until it sees a zero rather than looking at ncolumns or nkeys. */ typedef struct IndexOptInfo @@ -205,15 +215,18 @@ typedef struct IndexOptInfo double tuples; /* index descriptor information */ - Oid *classlist; /* classes of AM operators */ - int *indexkeys; /* keys over which we're indexing */ - Oid *ordering; /* OIDs of sort operators for each key */ + int ncolumns; /* number of columns in index */ + int nkeys; /* number of keys used by index */ + Oid *classlist; /* AM operator classes for columns */ + int *indexkeys; /* column numbers of index's keys */ + Oid *ordering; /* OIDs of sort operators for each column */ Oid relam; /* OID of the access method (in pg_am) */ RegProcedure amcostestimate;/* OID of the access method's cost fcn */ Oid indproc; /* if a functional index */ List *indpred; /* if a partial index */ + bool unique; /* if a unique index */ bool lossy; /* if a lossy index */ } IndexOptInfo; @@ -275,7 +288,7 @@ typedef struct Path * 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. + * 'indexinfo' is a list of IndexOptInfo nodes, one per scan to be performed. * * 'indexqual' is a list of index qualifications, also one per scan. * Each entry in 'indexqual' is a sublist of qualification expressions with @@ -313,7 +326,7 @@ typedef struct Path typedef struct IndexPath { Path path; - List *indexid; + List *indexinfo; List *indexqual; ScanDirection indexscandir; Relids joinrelids; /* other rels mentioned in indexqual */ @@ -533,7 +546,7 @@ typedef struct RestrictInfo typedef struct JoinInfo { NodeTag type; - Relids unjoined_relids;/* some rels not yet part of my RelOptInfo */ + Relids unjoined_relids; /* some rels not yet part of my RelOptInfo */ List *jinfo_restrictinfo; /* relevant RestrictInfos */ } JoinInfo; diff --git a/src/include/optimizer/clauses.h b/src/include/optimizer/clauses.h index a02ef9c77c3..79bb7a13593 100644 --- a/src/include/optimizer/clauses.h +++ b/src/include/optimizer/clauses.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: clauses.h,v 1.43 2001/03/22 04:00:53 momjian Exp $ + * $Id: clauses.h,v 1.44 2001/05/20 20:28:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -16,14 +16,6 @@ #include "nodes/relation.h" -/* - * Flag bits returned by get_relattval(). - * These are used in selectivity-estimation routines, too. - */ -#define SEL_CONSTANT 1 /* operator's non-var arg is a constant */ -#define SEL_RIGHT 2 /* operator's non-var arg is on the right */ - - extern Expr *make_clause(int type, Node *oper, List *args); extern bool is_opclause(Node *clause); @@ -61,11 +53,6 @@ extern List *pull_constant_clauses(List *quals, List **constantQual); extern void clause_get_relids_vars(Node *clause, Relids *relids, List **vars); extern int NumRelids(Node *clause); -extern void get_relattval(Node *clause, int targetrelid, - int *relid, AttrNumber *attno, - Datum *constval, int *flag); -extern void get_rels_atts(Node *clause, int *relid1, - AttrNumber *attno1, int *relid2, AttrNumber *attno2); extern void CommuteClause(Expr *clause); extern Node *eval_const_expressions(Node *node); diff --git a/src/include/optimizer/pathnode.h b/src/include/optimizer/pathnode.h index 0839feb4b2f..85ba6936f48 100644 --- a/src/include/optimizer/pathnode.h +++ b/src/include/optimizer/pathnode.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pathnode.h,v 1.36 2001/05/07 00:43:26 tgl Exp $ + * $Id: pathnode.h,v 1.37 2001/05/20 20:28:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -64,9 +64,10 @@ extern HashPath *create_hashjoin_path(RelOptInfo *joinrel, /* * prototypes for relnode.c */ -extern RelOptInfo *get_base_rel(Query *root, int relid); -extern RelOptInfo *make_base_rel(Query *root, int relid); -extern RelOptInfo *get_join_rel(Query *root, +extern RelOptInfo *build_base_rel(Query *root, int relid); +extern RelOptInfo *build_other_rel(Query *root, int relid); +extern RelOptInfo *find_base_rel(Query *root, int relid); +extern RelOptInfo *build_join_rel(Query *root, RelOptInfo *outer_rel, RelOptInfo *inner_rel, JoinType jointype, diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h index ac67f6a6551..39afe74d2ad 100644 --- a/src/include/optimizer/paths.h +++ b/src/include/optimizer/paths.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: paths.h,v 1.52 2001/03/22 04:00:54 momjian Exp $ + * $Id: paths.h,v 1.53 2001/05/20 20:28:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -35,7 +35,7 @@ extern RelOptInfo *make_fromexpr_rel(Query *root, FromExpr *from); * indxpath.c * routines to generate index paths */ -extern void create_index_paths(Query *root, RelOptInfo *rel, List *indices); +extern void create_index_paths(Query *root, RelOptInfo *rel); extern Oid indexable_operator(Expr *clause, Oid opclass, Oid relam, bool indexkey_on_left); extern List *extract_or_indexqual_conditions(RelOptInfo *rel, diff --git a/src/include/optimizer/plancat.h b/src/include/optimizer/plancat.h index 5d3062d981c..a103f51e3f1 100644 --- a/src/include/optimizer/plancat.h +++ b/src/include/optimizer/plancat.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: plancat.h,v 1.22 2001/03/22 04:00:55 momjian Exp $ + * $Id: plancat.h,v 1.23 2001/05/20 20:28:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -17,7 +17,7 @@ #include "nodes/relation.h" -extern void relation_info(Oid relationObjectId, +extern void get_relation_info(Oid relationObjectId, bool *hasindex, long *pages, double *tuples); extern List *find_secondary_indexes(Oid relationObjectId); @@ -26,15 +26,15 @@ extern List *find_inheritance_children(Oid inhparent); extern bool has_subclass(Oid relationId); -extern Selectivity restriction_selectivity(Oid functionObjectId, - Oid operatorObjectId, - Oid relationObjectId, - AttrNumber attributeNumber, - Datum constValue, - int constFlag); +extern bool has_unique_index(RelOptInfo *rel, AttrNumber attno); -extern Selectivity join_selectivity(Oid functionObjectId, Oid operatorObjectId, - Oid relationObjectId1, AttrNumber attributeNumber1, - Oid relationObjectId2, AttrNumber attributeNumber2); +extern Selectivity restriction_selectivity(Query *root, + Oid operator, + List *args, + int varRelid); + +extern Selectivity join_selectivity(Query *root, + Oid operator, + List *args); #endif /* PLANCAT_H */ diff --git a/src/include/optimizer/prep.h b/src/include/optimizer/prep.h index b1ca99fed52..1888248ed53 100644 --- a/src/include/optimizer/prep.h +++ b/src/include/optimizer/prep.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: prep.h,v 1.27 2001/03/22 04:00:55 momjian Exp $ + * $Id: prep.h,v 1.28 2001/05/20 20:28:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -35,7 +35,9 @@ extern List *preprocess_targetlist(List *tlist, int command_type, extern Plan *plan_set_operations(Query *parse); extern List *find_all_inheritors(Oid parentrel); -extern List *expand_inherted_rtentry(Query *parse, Index rti); + +extern List *expand_inherted_rtentry(Query *parse, Index rti, + bool dup_parent); extern Node *adjust_inherited_attrs(Node *node, Index old_rt_index, Oid old_relid, |
