postgres.git / summary / log / commit / refs
commit 9d1ac2f5fa4043529dbaff5ebdc73405fa73207b
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Tue Jan 11 17:12:04 2011 +0000
First released in: 9.1.0
Tweak create_index_paths()'s test for whether to consider a bitmap scan.
Per my note of a couple days ago, create_index_paths would refuse to
consider any path at all for GIN indexes if the selectivity estimate came
out as 1.0; not even if you tried to force it with enable_seqscan. While
this isn't really a bad outcome in practice, it could be annoying for
testing purposes. Adjust the test for "is this path only useful for
sorting" so that it doesn't fire on paths with nil pathkeys, which will
include all GIN paths.
src/backend/optimizer/path/indxpath.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c
index ab3d8d00b75..a3101d7ea73 100644
--- a/src/backend/optimizer/path/indxpath.c
+++ b/src/backend/optimizer/path/indxpath.c
@@ -196,8 +196,8 @@ create_index_paths(PlannerInfo *root, RelOptInfo *rel)
add_path(rel, (Path *) ipath);
if (ipath->indexinfo->amhasgetbitmap &&
- ipath->indexselectivity < 1.0 &&
- !ScanDirectionIsBackward(ipath->indexscandir))
+ (ipath->path.pathkeys == NIL ||
+ ipath->indexselectivity < 1.0))
bitindexpaths = lappend(bitindexpaths, ipath);
}
[parent: 1c400d330934]