Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 860722E00C6 for ; Thu, 13 Mar 2008 17:20:37 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 61434-02 for ; Thu, 13 Mar 2008 17:20:32 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 5B1B82E0118 for ; Thu, 13 Mar 2008 17:20:31 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m2DKKU1i000440; Thu, 13 Mar 2008 16:20:30 -0400 (EDT) To: "Zubkovsky, Sergey" cc: pgsql-docs@postgresql.org Subject: Re: pg_total_relation_size() and CHECKPOINT In-reply-to: <528853D3C5ED2C4AA8990B504BA7FB850106DF10@sol.transas.com> References: <528853D3C5ED2C4AA8990B504BA7FB850106DF10@sol.transas.com> Comments: In-reply-to "Zubkovsky, Sergey" message dated "Thu, 13 Mar 2008 22:49:58 +0300" Date: Thu, 13 Mar 2008 16:20:30 -0400 Message-ID: <439.1205439630@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/41 X-Sequence-Number: 4853 "Zubkovsky, Sergey" writes: > I've detected that a result value of pg_total_relation_size() for an > actively updated table might be significantly differ from a result that > is returned after explicit CHECKPOINT command execution. Uh, can you show a specific example of what you mean? > I understand the reasons of such behavior: cache buffers must be flushed > in order to be sure that pg_total_relation_size() result will be like we > expect. I wouldn't think so. The space for a page is allocated immediately when needed --- its *contents* might not be up to date, but that shouldn't affect pg_total_relation_size. regards, tom lane