Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebaH0-0007Mq-MC for pgsql-general@arkaria.postgresql.org; Tue, 16 Jan 2018 23:04:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebaH0-00064j-61 for pgsql-general@arkaria.postgresql.org; Tue, 16 Jan 2018 23:04:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ebaGz-00064Z-Ud for pgsql-general@lists.postgresql.org; Tue, 16 Jan 2018 23:04:05 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ebaGw-0004g0-VU for pgsql-general@postgresql.org; Tue, 16 Jan 2018 23:04:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w0GN3wCn000795; Tue, 16 Jan 2018 18:03:58 -0500 From: Tom Lane To: Daniel Farina cc: pgsql-general@postgresql.org Subject: Re: Extra files in "base" dir not seen in relfilenodes In-reply-to: References: Comments: In-reply-to Daniel Farina message dated "Tue, 16 Jan 2018 22:54:30 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <793.1516143838.1@sss.pgh.pa.us> Date: Tue, 16 Jan 2018 18:03:58 -0500 Message-ID: <794.1516143838@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Daniel Farina writes: > I am looking at a database with a wide (~500G) divergence between the total > space expended by the database directory and the result of select > sum(pg_relation_size(oid)) from pg_class;. Odd. > I located about 280G of apparent extra space by performing an anti-join > between files on disk and files in the catalog via the pg_class.relfilenode > field. Umm ... are you accounting for catalogs that have zeroes in pg_class.relfilenode? It's generally better to rely on the pg_relation_filenode(oid) function than the raw column contents. regards, tom lane