Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 5CB7ED6F1EA for ; Thu, 29 Mar 2012 06:37:15 -0300 (ADT) Received: from mail-ey0-f174.google.com ([209.85.215.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SDBn8-00071z-6o for pgsql-admin@postgresql.org; Thu, 29 Mar 2012 09:37:15 +0000 Received: by eaaq12 with SMTP id q12so839339eaa.19 for ; Thu, 29 Mar 2012 02:37:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=L3StQaCiIQUekBI6NfrENacF4CgC+00tCOkk/MVs3U4=; b=ybkusTRD0j+xiJ+rmuvs383ecZh0YXfzOI8cjjulDXfUtZWAXzx5bnUGuSyLieYPaE qZD76bWRshzaVTPd0bTkoMgdllNm/pn8ipY60hPJnzVqEnNwejUFck4iyUDiHymI/2d+ DFrhufDReQbFoNwD+Fy2c9FILP2tStDiGTvz/ivm4n4XUjoOugoki/MGKi9sQHEDsWkk Fi4VbkaDzKucypf1czLcNN+tnDS3DLWF1iNNTc0yzhlmeGUi6vaDHZRGKLORAuSAQybS GryBB2DnDxz5FBgCK/ZZkC9eIY5exDGUkrOl8kotVEdiEvbZfx7hLE7zNFXLl7Rss5no JgbQ== Received: by 10.180.24.7 with SMTP id q7mr3872352wif.11.1333013820970; Thu, 29 Mar 2012 02:37:00 -0700 (PDT) Received: from zeus.local (88-149-211-141.dynamic.ngi.it. [88.149.211.141]) by mx.google.com with ESMTPS id n8sm26181729wix.10.2012.03.29.02.36.59 (version=SSLv3 cipher=OTHER); Thu, 29 Mar 2012 02:37:00 -0700 (PDT) Message-ID: <4F742D3A.8010501@gmail.com> Date: Thu, 29 Mar 2012 11:36:58 +0200 From: Alexander Fortin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20120313 Thunderbird/11.0 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: pg_database_size() and actual disk space usage Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201203/130 X-Sequence-Number: 39318 Hi folks, I'm analyizing why our /var/lib/postgresql partition got a quick bump in usage (from 32GB to 41GB) few days ago, even if, according to data from monitoring software, database size kept increasing with no bump at all. So I'm using "SELECT pg_database_size('mydb')" but I can't find much documentation about what that "size" actually refers to. What I see is that both the master and the replicas shows the same number (32GB), but for both of those I see differences in the actual file system usage: master: 41G /var/lib/postgresql/9.1/main/base replica: 37G /var/lib/postgresql/9.1/main/base/ Does pg_database_size() return size occupied by indexes too? If not, the difference could be due to index space I guess. Thanks! -- Alexander Fortin http://about.me/alexanderfortin/