Re: Clock sweep not caching enough B-Tree leaf pages?
Greg Stark <stark@mit.edu>
From: Greg Stark <stark@mit.edu>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Peter Geoghegan <pg@heroku.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2014-04-18T15:46:08Z
Lists: pgsql-hackers
On Fri, Apr 18, 2014 at 4:14 PM, Robert Haas <robertmhaas@gmail.com> wrote: > 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. But you might be evicting a page that will be needed soon or one that won't be needed for a while. If it's not needed for a while you might be able to avoid many page evictions by caching a page that will be used several times. If all the pages currently in RAM are hot -- meaning they're hot enough that they'll be needed again before the page you're reading in -- then they're all equally bad to evict. I'm trying to push us away from the gut instinct that frequently used pages are important to cache and towards actually counting how many i/os we're saving. In the extreme it's possible to simulate any cache algorithm on a recorded list of page requests and count how many page misses it generates to compare it with an optimal cache algorithm. -- greg
Commits
-
Replace the BufMgrLock with separate locks on the lookup hashtable and
- 5d5087363d7c 8.1.0 cited