From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: luis.roberto@siscobra.com.br
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: DB size
Date: Mon, 26 Apr 2021 16:45:34 -0400
Message-ID: <20210426204534.GA16381@alvherre.pgsql> (raw)
In-Reply-To: <133123052.3128057.1619468694515.JavaMail.zimbra@siscobra.com.br>
On 2021-Apr-26, luis.roberto@siscobra.com.br wrote:
> SELECT sum(pg_total_relation_size(relid)),
> pg_size_pretty(sum(pg_total_relation_size(relid)))
> FROM pg_catalog.pg_stat_all_tables
>
>
> sum |pg_size_pretty|
> ------------+--------------+
> 518549716992|483 GB |
>
>
> SELECT pg_database_size('mydb'),
> pg_size_pretty(pg_database_size('mydb'))
>
>
> pg_database_size|pg_size_pretty|
> ----------------+--------------+
> 869150909087|809 GB |
>
> There are three databases in the cluster, apart from 'mydb' (one of
> them is the 'postgres' database). These other two size about 8MB each.
I would guess that there are leftover files because of those crashes you
mentioned. You can probably look for files in the database subdir in
the data directory that do not appear in the pg_class.relfilenode
listing for the database.
--
Álvaro Herrera 39°49'30"S 73°17'W
<inflex> really, I see PHP as like a strange amalgamation of C, Perl, Shell
<crab> inflex: you know that "amalgam" means "mixture with mercury",
more or less, right?
<crab> i.e., "deadly poison"
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: alvherre@alvh.no-ip.org, luis.roberto@siscobra.com.br
Subject: Re: DB size
In-Reply-To: <20210426204534.GA16381@alvherre.pgsql>
References: <133123052.3128057.1619468694515.JavaMail.zimbra@siscobra.com.br> <20210426204534.GA16381@alvherre.pgsql>
* 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