From 82b4dd394f50f75a34d3ddc1c7d54b8d8fcace33 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 4 Jan 2004 03:51:52 +0000 Subject: 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. --- src/include/optimizer/clauses.h | 3 +-- src/include/optimizer/cost.h | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'src/include/optimizer') diff --git a/src/include/optimizer/clauses.h b/src/include/optimizer/clauses.h index 3e089256a51..c948a9039fb 100644 --- a/src/include/optimizer/clauses.h +++ b/src/include/optimizer/clauses.h @@ -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); diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h index 316d63b97a2..15540a66643 100644 --- a/src/include/optimizer/cost.h +++ b/src/include/optimizer/cost.h @@ -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, -- cgit v1.2.3