Re: size of table + toasted tables + indexes != pg_total_relation_size
От | Mariel Cherkassky |
---|---|
Тема | Re: size of table + toasted tables + indexes != pg_total_relation_size |
Дата | |
Msg-id | CA+t6e1nF76vnRO9YV2m97-1bSKj0QnivXQWbXAT5xBaggjaDug@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: size of table + toasted tables + indexes != pg_total_relation_size (Andrew Gierth <andrew@tao11.riddles.org.uk>) |
Ответы |
Re: size of table + toasted tables + indexes != pg_total_relation_size
|
Список | pgsql-admin |
In future please use plain text for query output, not screenshots------------------------------------------
Mariel> When I searched for the biggest objects in DB1 I saw that theMariel> total sum isnt even close to 100G :You should probably check whether there are files in the db's directorythat do not correspond to the filenode of any table (useselect pg_relation_filenode(oid) from pg_class; to get a list offilenodes)
and If i'll find some, is it safe just to delete them ?
-------------------------------------------------------------Crashes (or other unclean shutdown) in the middle of doing a vacuum fullor other table-rewriting operation is known to leave orphaned filesaround in the data dir.Mariel> Now, I thought that the pg_total_relation_size should includeMariel> also all the dead tuples and the toasted tables.It does, and your results agree with that. Perhaps you missed thatpg_table_size() includes the toast table too?
Yeah, that is exactly what I missed, thanks ;)
Mariel> In addition, I saw from pg_stat_activity that the session tableMariel> has about 198 dead tuples and the toasted table has about 83833Mariel> dead tuples. It seems that the autoanalyze has never run on theMariel> toasted table.There's nothing in a toast table that needs analyzing.Why not ? So when you analyze a table it will analyze also the pg_toast ? For example you would want to know how many records there are in that toast..--Andrew (irc:RhodiumToad)
В списке pgsql-admin по дате отправления: