Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9d1ac2f

Browse files
committed
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.
1 parent 1c400d3 commit 9d1ac2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/optimizer/path/indxpath.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ create_index_paths(PlannerInfo *root, RelOptInfo *rel)
196196
add_path(rel, (Path *) ipath);
197197

198198
if (ipath->indexinfo->amhasgetbitmap &&
199-
ipath->indexselectivity < 1.0 &&
200-
!ScanDirectionIsBackward(ipath->indexscandir))
199+
(ipath->path.pathkeys == NIL ||
200+
ipath->indexselectivity < 1.0))
201201
bitindexpaths = lappend(bitindexpaths, ipath);
202202
}
203203

0 commit comments

Comments
 (0)