Re: relpages for pg_toast.* tables

Поиск
Список
Период
Сортировка
От Paul Ramsey
Тема Re: relpages for pg_toast.* tables
Дата
Msg-id CACowWR3Go9C2UeRuccb0OUrwPn7NSFbqW_TvQmjvizLoxNpE_w@mail.gmail.com
обсуждение исходный текст
Ответ на relpages for pg_toast.* tables  (Paul Ramsey <pramsey@cleverelephant.ca>)
Список pgsql-general
In the spirit of "asking the question leads you to the answer", while
ANALYZE doesn't update stats on toast tables, VACUUM does. So running
VACUUM ANALYZE on the parent table updates all the relevant "relpages"
slots and the space summary turns out passable guesstimates.

P.

On Fri, Aug 28, 2015 at 6:16 AM, Paul Ramsey <pramsey@cleverelephant.ca> wrote:
> I've been trying to write up a "pg_total_relation_size()" replacement
> that just uses the system tables (sum up relpages for tables, indexes
> and toast tables), thereby avoiding the overhead of running stat() on
> thousands of filesystem tables, but I've come up against what seems to
> be an unsuperable problem.
>
> The `relpages` data for the toast tables doesn't seem to get updated.
> Not when I run a general 'ANALYZE' call, and when I specifically call
> ANALYZE on the toast tables, it tells me "WARNING:  skipping
> "pg_toast_4597532" --- cannot analyze non-tables or special system
> tables". Well, OK then.
>
> Presumably this is by design, but it makes it impossible to get a true
> guesstimate (as of latest ANALYZE) of size. Are there any known
> workarounds?
>
> Thanks,
> P


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

Предыдущее
От: Paul Ramsey
Дата:
Сообщение: relpages for pg_toast.* tables
Следующее
От: Anderson Abreu
Дата:
Сообщение: Execute DDL across multiple servers in an automated manner