Re: More buffers used than a relation's relpages - Mailing list pgsql-general

From Amit Langote
Subject Re: More buffers used than a relation's relpages
Date
Msg-id CA+HiwqH7+cNOdNvQ39XzLhNDtizSqHwg1RhR-WinMig4xuqzPg@mail.gmail.com
Whole thread Raw
In response to Re: More buffers used than a relation's relpages  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-general
On Tue, Jun 4, 2013 at 10:04 PM, Andres Freund <andres@2ndquadrant.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


pgsql-general by date:

Previous
From: Mads.Tandrup@schneider-electric.com
Date:
Subject: Streaming replication with sync slave, but disconnects due to missing WAL segments
Next
From: 任洪彩
Date:
Subject: How to modify dump files created by pg_dump