Re: DB size

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: DB size
Дата
Msg-id 20210426204534.GA16381@alvherre.pgsql
обсуждение исходный текст
Ответ на DB size  (luis.roberto@siscobra.com.br)
Ответы Re: DB size  (luis.roberto@siscobra.com.br)
Re: DB size  (Laurenz Albe <laurenz.albe@cybertec.at>)
Список pgsql-general
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"



В списке pgsql-general по дате отправления:

Предыдущее
От: Josef Šimánek
Дата:
Сообщение: Re: DB size
Следующее
От: luis.roberto@siscobra.com.br
Дата:
Сообщение: Re: DB size