Adrian Klaver <adrian.klaver@aklaver.com> writes:
> Seems work_mem is the key:
Fascinating. So there's some bad behavior in the lossy-bitmap stuff
that's exposed by one case but not the other. The set of heap rows we
actually need to examine is presumably identical in both cases. The
only idea that comes to mind is that the order in which the TIDs get
inserted into the bitmaps might be entirely different between the two
index types. We might have to write it off as bad luck, if the
lossification algorithm doesn't have enough information to do better;
but it seems worth looking into.
regards, tom lane