Re: index-only scans - Mailing list pgsql-hackers

From Marti Raudsepp
Subject Re: index-only scans
Date
Msg-id CABRT9RCszX41+PDAx6j4ctQJ3YjfLCENRzJ5mb06PG8GBP15Yw@mail.gmail.com
Whole thread Raw
In response to Re: index-only scans  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: index-only scans
List pgsql-hackers
On Sun, Aug 14, 2011 at 00:31, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
> That is somewhat compensated by the fact that tuples that are accessed more
> often are also more likely to be in cache. Fetching the heap tuple to check
> visibility is very cheap when the tuple is in cache.
>
> I'm not sure how far that compensates it, though. I'm sure there's typically
> nevertheless a fairly wide range of pages that have been modified since the
> last vacuum, but not in cache anymore.

Would it make sense to re-evaluate the visibility bit just before a
page gets flushed out from shared buffers? On a system with no long
transactions, it seems likely that a dirty page is already all-visible
by the time bgwriter (or shared buffers memory pressure) gets around
to writing it out. That way we don't have to wait for vacuum to do it
and would make your observation hold more often.

Regards,
Marti


pgsql-hackers by date:

Previous
From: Joshua Berkus
Date:
Subject: Re: unite recovery.conf and postgresql.conf
Next
From: Jeff Davis
Date:
Subject: Re: Range Types - symmetric