1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-07 19:06:32 +03:00

Clean up messy clause-selectivity code in clausesel.c; repair bug

identified by Hiroshi (incorrect cost attributed to OR clauses
after multiple passes through set_rest_selec()).  I think the code
was trying to allow selectivities of OR subclauses to be passed in
from outside, but noplace was actually passing any useful data, and
set_rest_selec() was passing wrong data.

Restructure representation of "indexqual" in IndexPath nodes so that
it is the same as for indxqual in completed IndexScan nodes: namely,
a toplevel list with an entry for each pass of the index scan, having
sublists that are implicitly-ANDed index qual conditions for that pass.
You don't want to know what the old representation was :-(

Improve documentation of OR-clause indexscan functions.

Remove useless 'notclause' field from RestrictInfo nodes.  (This might
force an initdb for anyone who has stored rules containing RestrictInfos,
but I do not think that RestrictInfo ever appears in completed plans.)
This commit is contained in:
Tom Lane
1999-07-24 23:21:14 +00:00
parent 348bdbce79
commit ac4913a0dd
17 changed files with 471 additions and 519 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/restrictinfo.c,v 1.6 1999/07/16 04:59:27 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/restrictinfo.c,v 1.7 1999/07/24 23:21:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -20,17 +20,15 @@
#include "optimizer/restrictinfo.h"
/*
* valid_or_clause
* restriction_is_or_clause
*
* Returns t iff the restrictinfo node contains a 'normal' 'or' clause.
* Returns t iff the restrictinfo node contains an 'or' clause.
*
*/
bool
valid_or_clause(RestrictInfo *restrictinfo)
restriction_is_or_clause(RestrictInfo *restrictinfo)
{
if (restrictinfo != NULL &&
!single_node((Node *) restrictinfo->clause) &&
!restrictinfo->notclause &&
or_clause((Node *) restrictinfo->clause))
return true;
else