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

From Jim Nasby
Subject Re: index-only scans
Date
Msg-id 5CF12E25-77E5-42C2-9DCD-0018592B6E41@nasby.net
Whole thread Raw
In response to Re: index-only scans  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On Aug 13, 2011, at 4:31 PM, Heikki Linnakangas wrote:
>> The example is much more realistic if the query is a fetch of N latest rows from a table. Very common use case, and
thewhole relation's visibility statistics are completely wrong for that query. 
>
> 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
pagesthat have been modified since the last vacuum, but not in cache anymore. 

http://xkcd.org/937/ :)

Could something be added to pg_stats that tracks visibility map usefulness on a per-attribute basis? Perhaps another
setof stats buckets that show visibility percentages for each stats bucket? 
--
Jim C. Nasby, Database Architect                   jim@nasby.net
512.569.9461 (cell)                         http://jim.nasby.net




pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: walprotocol.h vs frontends
Next
From: Simon Riggs
Date:
Subject: Re: walprotocol.h vs frontends