diff options
author | Bruce Momjian <bruce@momjian.us> | 1998-08-31 07:19:56 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1998-08-31 07:19:56 +0000 |
commit | 0705b02f18b161292607a2541689aaf07783d15e (patch) | |
tree | d58696298e1a8ef971d71babd3435676d598795f /src/backend/optimizer/path/orindxpath.c | |
parent | cbf83190c5d9a620f4bab71e84cf0c2a0c867c07 (diff) | |
download | postgresql-0705b02f18b161292607a2541689aaf07783d15e.tar.gz postgresql-0705b02f18b161292607a2541689aaf07783d15e.zip |
OR clause index fix
Diffstat (limited to 'src/backend/optimizer/path/orindxpath.c')
-rw-r--r-- | src/backend/optimizer/path/orindxpath.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/backend/optimizer/path/orindxpath.c b/src/backend/optimizer/path/orindxpath.c index 7f220fc54ba..13f4b7c2061 100644 --- a/src/backend/optimizer/path/orindxpath.c +++ b/src/backend/optimizer/path/orindxpath.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.8 1998/08/01 22:12:13 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.9 1998/08/31 07:19:55 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -84,6 +84,7 @@ create_or_index_paths(Query *root, break; } } + /* do they all have indexes? */ if (index_flag) { /* used to be a lisp every function */ IndexPath *pathnode = makeNode(IndexPath); @@ -215,6 +216,11 @@ best_or_subclause_index(Query *root, { List *ilist; bool first_run = true; + + /* if we don't match anything, return zeros */ + *retIndexid = 0; + *retCost = 0.0; + *retSelec = 0.0; foreach (ilist, indices) { @@ -268,12 +274,5 @@ best_or_subclause_index(Query *root, } } - /* we didn't get any indexes, so zero return values */ - if (first_run) - { - *retIndexid = 0; - *retCost = 0.0; - *retSelec = 0.0; - } return; } |