1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-21 00:42:43 +03:00

Adjust indexscan planning logic to keep RestrictInfo nodes associated

with index qual clauses in the Path representation.  This saves a little
work during createplan and (probably more importantly) allows reuse of
cached selectivity estimates during indexscan planning.  Also fix latent
bug: wrong plan would have been generated for a 'special operator' used
in a nestloop-inner-indexscan join qual, because the special operator
would not have gotten into the list of quals to recheck.  This bug is
only latent because at present the special-operator code could never
trigger on a join qual, but sooner or later someone will want to do it.
This commit is contained in:
Tom Lane
2004-01-05 23:39:54 +00:00
parent 5d472f6464
commit fa559a86ee
11 changed files with 400 additions and 188 deletions

View File

@@ -49,7 +49,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.120 2004/01/05 05:07:35 tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.121 2004/01/05 23:39:54 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -238,6 +238,9 @@ cost_nonsequential_access(double relpages)
* Any additional quals evaluated as qpquals may reduce the number of returned
* tuples, but they won't reduce the number of tuples we have to fetch from
* the table, so they don't reduce the scan cost.
*
* NOTE: as of 7.5, indexQuals is a list of RestrictInfo nodes, where formerly
* it was a list of bare clause expressions.
*/
void
cost_index(Path *path, Query *root,