Re: Autovacuum not running properly

Поиск
Список
Период
Сортировка
От Luca Ferrari
Тема Re: Autovacuum not running properly
Дата
Msg-id CAKoxK+5hti6wnctLLvrhfq1Bn8wnmsVQDTy+iE=2j+Re15D=iQ@mail.gmail.com
обсуждение исходный текст
Ответ на Autovacuum not running properly  (Rajesh Kumar <rajeshkumar.dba09@gmail.com>)
Ответы Re: Autovacuum not running properly
Список pgsql-admin
On Fri, Sep 1, 2023 at 6:32 PM Rajesh Kumar <rajeshkumar.dba09@gmail.com> wrote:
>
> In that case how to be sure of autovacuum is not necessary for this table? On what basis? Do we have any calculation

The idea should be the number of "manipulated tuples" exceed the
thresholds. For example, in the case of insert workload, something
like:

SELECT current_setting( 'autovacuum_vacuum_insert_threshold' )::numeric
+ current_setting( 'autovacuum_vacuum_insert_scale_factor' )::numeric
* reltuples
FROM pg_class
WHERE relname = <your relation> and relkind = 'r';

will give you the amount of tuples that, once inserted, will trigger
an autovacuum. Therefore, unless your table receive more tuples than
the above, autovacuum will not consider vacuuming the table (thn
there's autoanalyze, that is another story but the reasoning is
similar).

Long story short: if your table is pretty much static, than it is
clear that autovacuum is not goint to vacuum over an over the same
data.

Luca



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

Предыдущее
От: Erik Wienhold
Дата:
Сообщение: Re: DBLINK Error
Следующее
От: Luca Ferrari
Дата:
Сообщение: Re: Why isn't there a IF NOT EXISTS clause on constraint creation?