Re: size of table + toasted tables + indexes != pg_total_relation_size

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: size of table + toasted tables + indexes != pg_total_relation_size
Дата
Msg-id 87d0rk3itx.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на Re: size of table + toasted tables + indexes != pg_total_relation_size  (Mariel Cherkassky <mariel.cherkassky@gmail.com>)
Список pgsql-admin
>>>>> "Mariel" == Mariel Cherkassky <mariel.cherkassky@gmail.com> writes:

 >> You should probably check whether there are files in the db's
 >> directory that do not correspond to the filenode of any table (use
 >> select pg_relation_filenode(oid) from pg_class; to get a list of
 >> filenodes)

 Mariel> * and If i'll find some, is it safe just to delete them ?*

You need to check that they're not recent (i.e. could not belong to
table creations/rewrites that are still in progress, since those would
not be visible in pg_class).

Also make sure you're looking in the right database (using
pg_relation_filepath instead may make this clearer).

Remember that a given filenode/filepath also generates names with
suffixes for forks (e.g. _vm) and segments (.1, .2 etc) - those need to
be kept for valid filenodes and deleted along with orphaned ones.

Naturally, if you get this wrong you will break your database beyond
easy recovery, so BE CAREFUL. As an extra check, you could look at the
times of the files and check against your server logs to see if there
were indeed any crashes or unclean restarts of pg around those times; if
you have a lot of apparently orphaned files you should investigate why.

-- 
Andrew (irc:RhodiumToad)


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

Предыдущее
От: Mariel Cherkassky
Дата:
Сообщение: Re: size of table + toasted tables + indexes != pg_total_relation_size
Следующее
От: Rui DeSousa
Дата:
Сообщение: Re: size of table + toasted tables + indexes !=pg_total_relation_size