1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-27 00:12:01 +03:00

Merge restrictlist_selectivity into clauselist_selectivity by

teaching the latter to accept either RestrictInfo nodes or bare
clause expressions; and cache the selectivity result in the RestrictInfo
node when possible.  This extends the caching behavior of approx_selectivity
to many more contexts, and should reduce duplicate selectivity
calculations.
This commit is contained in:
Tom Lane
2004-01-04 03:51:52 +00:00
parent 21a1202281
commit 82b4dd394f
12 changed files with 196 additions and 200 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/optimizer/clauses.h,v 1.70 2003/12/30 23:53:15 tgl Exp $
* $PostgreSQL: pgsql/src/include/optimizer/clauses.h,v 1.71 2004/01/04 03:51:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -59,7 +59,6 @@ extern List *pull_constant_clauses(List *quals, List **constantQual);
extern bool has_distinct_on_clause(Query *query);
extern void clause_get_relids_vars(Node *clause, Relids *relids, List **vars);
extern int NumRelids(Node *clause);
extern void CommuteClause(OpExpr *clause);

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.58 2003/11/29 22:41:07 pgsql Exp $
* $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.59 2004/01/04 03:51:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -88,10 +88,6 @@ extern void set_function_size_estimates(Query *root, RelOptInfo *rel);
* prototypes for clausesel.c
* routines to compute clause selectivities
*/
extern Selectivity restrictlist_selectivity(Query *root,
List *restrictinfo_list,
int varRelid,
JoinType jointype);
extern Selectivity clauselist_selectivity(Query *root,
List *clauses,
int varRelid,