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

From Amit Langote
Subject More buffers used than a relation's relpages
Date
Msg-id CA+HiwqHcjrV4Exwxz-w5f9uWiAh64Fh_8QidJKfOFK9g5TK3kQ@mail.gmail.com
Whole thread Raw
Responses Re: More buffers used than a relation's relpages  (Jeff Janes <jeff.janes@gmail.com>)
Re: More buffers used than a relation's relpages  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-general
Hello,

In what cases can a relation use more buffers (in shared memory) than
its pg_class.relpages?

For example, look at the second row in the following:

postgres=# SELECT c.relname,count(*) AS buffers, c.relpages
FROM pg_class c INNER JOIN pg_buffercache b
ON b.relfilenode=c.relfilenode INNER JOIN pg_database d
ON (b.reldatabase=d.oid AND d.datname=current_database())
GROUP BY c.relname,c.relpages
ORDER BY 2 DESC;
              relname              | buffers | relpages
-----------------------------------+---------+----------
 abc_idx          |    4800 |     4800
 abc                             |    3548 |     3547
abc_2_idx                |    3209 |     3209
...
...



--
Amit Langote


pgsql-general by date:

Previous
From: David Johnston
Date:
Subject: Re: Passing a WHERE clause by trigger to a function
Next
From: Jeff Janes
Date:
Subject: Re: More buffers used than a relation's relpages