Subject: pg_buffercache description

From: Satoshi Nagayasu <[email-masked]>
Date: Sat, 24 Nov 2012 11:57:51 +0900

Hi,

I found that the manual page for pg_buffercache module explains
"usagecount" as "Page LRU count".

http://www.postgresql.org/docs/devel/static/pgbuffercache.html

However, AFAIK, "usagecount" is not a LRU count nowadays, because
LRU is no longer used for the buffer management algorithm.

I think it should be described as "Clock-sweep count" or something
like that.

And I'd like to add some additional explanation for the "forknumber"
as below:

"0 for heap file, 1 for FreeSpaceMap, and 2 for VisibilityMap".

Any comments?

Regards,
-- 
Satoshi Nagayasu <[email-masked]>
Uptime Technologies, LLC. http://www.uptime.jp

---

From: Bruce Momjian <[email-masked]>
Date: Wed, 3 Jul 2013 14:23:11 -0400

> "0 for heap file, 1 for FreeSpaceMap, and 2 for VisibilityMap".

Good suggestion.  I ended up referencing the C file that contains the
"forknumber" definitions, rather than recreating the list in the docs. 
I applied the attached patch to head and 9.3.

-- 
  Bruce Momjian  <[email-masked]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +
diff --git a/doc/src/sgml/pgbuffercache.sgml b/doc/src/sgml/pgbuffercache.sgml
new file mode 100644
index 1d7d95f..685351f
*** a/doc/src/sgml/pgbuffercache.sgml
--- b/doc/src/sgml/pgbuffercache.sgml
***************
*** 84,90 ****
        <entry><structfield>relforknumber</structfield></entry>
        <entry><type>smallint</type></entry>
        <entry></entry>
!       <entry>Fork number within the relation</entry>
       </row>
  
       <row>
--- 84,91 ----
        <entry><structfield>relforknumber</structfield></entry>
        <entry><type>smallint</type></entry>
        <entry></entry>
!       <entry>Fork number within the relation;  see
!       <filename>include/storage/relfilenode.h</></entry>
       </row>
  
       <row>
***************
*** 98,104 ****
        <entry><structfield>usagecount</structfield></entry>
        <entry><type>smallint</type></entry>
        <entry></entry>
!       <entry>Page LRU count</entry>
       </row>
  
      </tbody>
--- 99,105 ----
        <entry><structfield>usagecount</structfield></entry>
        <entry><type>smallint</type></entry>
        <entry></entry>
!       <entry>Clock-sweep access count</entry>
       </row>
  
      </tbody>

-- 
Sent via pgsql-docs mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

---

From: Bruce Momjian <[email-masked]>
Date: Wed, 3 Jul 2013 14:26:36 -0400

> I applied the attached patch to head and 9.3.

I ended up applying it to 9.2 as well.

---

From: Satoshi Nagayasu <[email-masked]>
Date: Fri, 05 Jul 2013 01:16:22 +0900

Thanks, Bruce!