pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Farina <daniel@fdr.io>
Cc: pgsql-general@postgresql.org
Subject: Re: Extra files in "base" dir not seen in relfilenodes
Date: Tue, 16 Jan 2018 18:03:58 -0500
Message-ID: <794.1516143838@sss.pgh.pa.us> (raw)
In-Reply-To: <CACN56+N6XNATLAzQiQk0N2E6HehGgkNi+dyTgNBv+uGnoLUXiw@mail.gmail.com>
References: <CACN56+N6XNATLAzQiQk0N2E6HehGgkNi+dyTgNBv+uGnoLUXiw@mail.gmail.com>

Daniel Farina <daniel@fdr.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




view thread (6+ messages)  latest in thread

Message-ID: <794.1516143838@sss.pgh.pa.us>
Permalink:  ../794.1516143838@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/794.1516143838@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, daniel@fdr.io
  Subject: Re: Extra files in "base" dir not seen in relfilenodes
  In-Reply-To: <794.1516143838@sss.pgh.pa.us>
  References: <CACN56+N6XNATLAzQiQk0N2E6HehGgkNi+dyTgNBv+uGnoLUXiw@mail.gmail.com> <794.1516143838@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox