On 04/11/2019 07:04 PM, Alvaro Herrera wrote:
> On 2019-Apr-11, rihad wrote:
>
>> On 04/11/2019 06:41 PM, Alvaro Herrera wrote:
>>
>>> Perhaps it'd be better to vacuum this table much more often.
>>>
>> Each run took 5-6 hours, now it takes 2-3 hours after I've tweaked some
>> cost-based vacuum knobs.
> But how often does it run?
>
One after another. Enough n_dead_tuples accumulate in between runs to
easily trigger that.
autovacuum_vacuum_scale_factor = 0.01
utovacuum_vacuum_threshold = 50
which means to run autovac when 1% of table size + 50 rows have been
updated or deleted.
But we can't make each autovacuum run run faster )
Currently I lowered this from 20ms:
autovacuum_vacuum_cost_delay = 10ms
And increased this from 200:
autovacuum_vacuum_cost_limit = 400
to make it finish in 1 hour rather than 3 hours.
Anything more than that and we risk impacting the performance of user
queries.