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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>>>> "Mariel" == Mariel Cherkassky <mariel.cherkassky@xxxxxxxxx> 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)




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux