diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-08-28 22:47:20 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-08-28 22:47:20 +0000 |
commit | 46a0eee3006b11a15b73426c8146ed5ab32e1d62 (patch) | |
tree | 84e646e836446437c7fd310fd0aaf167b561e4dc /src/backend/optimizer/path/indxpath.c | |
parent | 75e90bbf69efb3cee8d3af9c07d345dd9540a7cc (diff) |
Tweak nodeBitmapAnd to stop evaluating sub-plan scans if it finds it's
got an empty bitmap after any step; the remaining subplans can no longer
affect the result. Per a suggestion from Ilia Kantor.
Diffstat (limited to 'src/backend/optimizer/path/indxpath.c')
-rw-r--r-- | src/backend/optimizer/path/indxpath.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index bd0b09fcfe9..c689d1461e9 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.187 2005/07/28 20:26:20 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.188 2005/08/28 22:47:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -538,6 +538,11 @@ choose_bitmap_and(PlannerInfo *root, RelOptInfo *rel, List *paths) * cases, the partial index will sort before competing non-partial * indexes and so it makes the right choice, but perhaps we need to * work harder. + * + * Note: outputting the selected sub-paths in selectivity order is a good + * thing even if we weren't using that as part of the selection method, + * because it makes the short-circuit case in MultiExecBitmapAnd() more + * likely to apply. */ /* Convert list to array so we can apply qsort */ |