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

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Ants Aasma <ants(at)cybertec(dot)at>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Clock sweep not caching enough B-Tree leaf pages?
Date: 2014-04-18 01:57:55
Message-ID: CAM3SWZSWUYteBi5dfMbo1L-Oz0K-kXrtx5iabKVexctiQgjxfg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 17, 2014 at 6:50 PM, Greg Stark <stark(at)mit(dot)edu> wrote:
> On Thu, Apr 17, 2014 at 4:48 PM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
>> Although I will add that not caching highly useful inner pages for the
>> medium term, because that index isn't being used at all for 5 minutes
>> probably is very bad. Using the 4,828 buffers that it would take to
>> store all the inner pages (as in my large primary index example) to go
>> store something else is probably penny wise and pound foolish.
>
> But there could easily be 20 unused indexes for every 1 index that is
> being used.

Sure, but then there might not be. Obviously there is a trade-off to
be made between recency and frequency. One interesting observation in
the LRU-K paper is that for their test case, a pure LFU actually works
very well, despite, as the authors acknowledge, being a terrible
algorithm in the real world. That's because their test case is so
simple, and concerns only one table/index, with a uniform
distribution.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G Johnston 2014-04-18 02:07:55 Re: DISCARD ALL (Again)
Previous Message Amit Kapila 2014-04-18 01:50:59 Re: [bug fix] pg_ctl always uses the same event source