Re: Extra cost of "lossy mode" Bitmap Scan plan - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Extra cost of "lossy mode" Bitmap Scan plan
Date
Msg-id 2679.1240929258@sss.pgh.pa.us
Whole thread Raw
In response to Re: Extra cost of "lossy mode" Bitmap Scan plan  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, Apr 28, 2009 at 3:51 AM, Greg Stark <stark@enterprisedb.com> wrote:
>> If the logic you're suggesting would kick in at all it would be for a
>> narrow range of scan sizes,

> You may be right, but on the other hand, I'm not sure there's any
> sense in NOT trying to model the impact of the additional heap
> fetches.

I think it's probably useless.  In the first place, at reasonable values
of work_mem the effect is going to be negligible (in the sense that a
plain indexscan would never win).  In the second place, there isn't any
way to guess the extent of lossiness at plan time --- it depends on how
much the target rows are "clumped" on particular pages.  The planner
hasn't got any stats that would let it guess that, and even if we tried
to collect such stats they'd probably be too unstable to be useful.

There are boatloads of effects that the planner doesn't model.  This
one seems very far down the list of what we should worry about.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Clean shutdown and warm standby
Next
From: Greg Stark
Date:
Subject: Re: Extra cost of "lossy mode" Bitmap Scan plan