Re: Extra files in "base" dir not seen in relfilenodes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Farina <daniel(at)fdr(dot)io>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Extra files in "base" dir not seen in relfilenodes
Date: 2018-01-16 23:03:58
Message-ID: 794.1516143838@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Daniel Farina <daniel(at)fdr(dot)io> 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Farina 2018-01-16 23:08:35 Re: Extra files in "base" dir not seen in relfilenodes
Previous Message Daniel Farina 2018-01-16 22:54:30 Extra files in "base" dir not seen in relfilenodes