Jeff Davis <pgsql@j-davis.com> writes:
> On Tue, 2009-02-24 at 00:18 -0500, Robert Haas wrote:
>> It only took me about 5 minutes to come up with a test case against CVS
>> HEAD where disabling index scans resulted in a significant dropoff in
>> performance. Here it is:
> On the other hand, Teodor showed a typical use case and a very
> substantial performance gain:
Yeah. Whatever we do here is a tradeoff (and whether Robert likes it
or not, reliability and code maintainability weigh heavily in the
tradeoff).
> I wonder how many people really use GIN with non-bitmap scans for some
> benefit? And even if the benefit exists, does the planner have a way to
> identify those cases reliably, or does it have to be done manually?
A relevant point there is that most of the estimator functions for
GIN-amenable operators are just smoke and mirrors; so if the planner
is making a good choice between indexscan and bitmapscan at all, it's
mostly luck. This might get better someday, but not in 8.4.
regards, tom lane