Re: Clock sweep not caching enough B-Tree leaf pages?

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Greg Stark <stark@mit.edu>
Cc: Peter Geoghegan <pg@heroku.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2014-04-18T15:14:58Z
Lists: pgsql-hackers
On Thu, Apr 17, 2014 at 5:00 PM, Greg Stark <stark@mit.edu> wrote:
> On Thu, Apr 17, 2014 at 10:18 AM, Robert Haas <robertmhaas@gmail.com> wrote:
>> Because all the usage counts are the same, the eviction at
>> this point is completely indiscriminate.  We're just as likely to kick
>> out a btree root page or a visibility map page as we are to kick out a
>> random heap page, even though the former have probably been accessed
>> several orders of magnitude more often.  That's clearly bad.
>
> That's not clear at all. In that circumstance regardless of what page
> you evict you're incurring precisely one page fault i/o when the page
> is read back in.

I am a bit confused by this remark.  In *any* circumstance when you
evict you're incurring precisely one page fault I/O when the page is
read back in.   That doesn't mean that the choice of which page to
evict is irrelevant.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Commits

  1. Replace the BufMgrLock with separate locks on the lookup hashtable and