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

From: Greg Stark <stark(at)mit(dot)edu>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Peter Geoghegan <pg(at)heroku(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Clock sweep not caching enough B-Tree leaf pages?
Date: 2014-04-17 15:00:12
Message-ID: CAM-w4HOKEoS3iREjsjMpfaBoJrXqEj3JOpu6mc4ZcWSqurYcLQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 17, 2014 at 10:18 AM, Robert Haas <robertmhaas(at)gmail(dot)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. Incurring that i/o is bad but it's unavoidable and
it's the same badness regardless of what page it's for. The only way
to prefer one page over another is if one page won't be needed for
long enough for the page to be useful for caching this new buffer (or
mixture of buffers) for multiple accesses. If you can't do that then
it doesn't matter which buffer you use since it'll just be evicted to
read back in the original page again.

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabrízio de Royes Mello 2014-04-17 15:07:39 Re: Verbose output of pg_dump not show schema name
Previous Message Andres Freund 2014-04-17 14:58:13 Re: Clock sweep not caching enough B-Tree leaf pages?