Re: More buffers used than a relation's relpages

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: More buffers used than a relation's relpages
Date: 2013-06-04 13:42:59
Message-ID: CA+HiwqH7+cNOdNvQ39XzLhNDtizSqHwg1RhR-WinMig4xuqzPg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jun 4, 2013 at 10:04 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> On 2013-06-04 11:29:44 +0900, Amit Langote wrote:
>> In what cases can a relation use more buffers (in shared memory) than
>> its pg_class.relpages?
>
> relpages is primarily updated by (auto-)vacuum, (auto-)analyze, so it
> frequently lags behind reality in a growing relation. Why do you need an
> exact value?
>

I think I forgot that pg_class.relpages is a statistic that needs
updates to reflect its current value.

I don't need it (the value) for anything per se, was just wondering if
I was missing something about such an observation. I was using
pg_buffercache to understand what kind of page traffic a pg_trgm index
generates and in one case when it just finished building a pg_trgm
index (say, abc_idx) over a relation (say, abc), I observed that the
relation's (abc's) shared buffers count was one more than its relpages
at that moment.

--
Amit Langote

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2013-06-04 15:40:50 Re: How to modify dump files created by pg_dump
Previous Message Mads.Tandrup 2013-06-04 13:25:47 Streaming replication with sync slave, but disconnects due to missing WAL segments