Re: Berserk Autovacuum (let's save next Mandrill)
Laurenz Albe <laurenz.albe@cybertec.at>
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>, David Rowley <dgrowleyml@gmail.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, Amit Kapila <amit.kapila16@gmail.com>, Masahiko Sawada <sawada.mshk@gmail.com>, Darafei Komяpa Praliaskouski <me@komzpa.net>, Andres Freund <andres@anarazel.de>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>, Alvaro Herrera <alvherre@2ndquadrant.com>, Michael Banck <mbanck@gmx.net>
Date: 2020-03-16T07:54:46Z
Lists: pgsql-hackers
On Mon, 2020-03-16 at 12:53 +0900, Masahiko Sawada wrote: > There is already a consensus on introducing new 2 parameters, but as > the second idea I'd like to add one (or two) GUC(s) to my suggestion, > say autovacuum_vacuum_freeze_insert_ratio; this parameter is the ratio > of the number of inserted tuples for total number of tuples modified > and inserted, in order to trigger insert-only vacuum. For example, > suppose the table has 1,000,000 tuples and we set threshold = 0, > scale_factor = 0.2 and freeze_insert_ratio = 0.9, we will trigger > normal autovacuum when n_dead_tup + n_ins_since_vacuum > 200,000, but > we will instead trigger insert-only autovacuum, which is a vacuum with > vacuum_freeze_min_age = 0, when n_ins_since_vacuum > 180,000 (=200,000 > * 0.9). IOW if 90% of modified tuples are insertions, we freeze tuples > aggressively. If we want to trigger insert-only vacuum only on > insert-only table we can set freeze_insert_ratio = 1.0. The down side > of this idea is that we cannot disable autovacuum triggered by the > number of inserted, although we might be able to introduce more one > GUC that controls whether to include the number of inserted tuples for > triggering autovacuum (say, autovacuum_vacuum_triggered_by_insert = > on|off). The pros of this idea would be that we can ensure that > insert-only vacuum will run only in the case where the ratio of > insertion is large enough. Two more parameters :^( But your reasoning is good. How about we go with what we have now and leave that for future discussion and patches? Yours, Laurenz Albe
Commits
-
Further improve stability fix for partition_aggregate test.
- 18d85e9b8a2b 13.0 landed
-
Improve stability fix for partition_aggregate test.
- 7cb0a423f914 13.0 landed
-
Attempt to stabilize partitionwise_aggregate test
- cefb82d49e21 13.0 landed
-
Fix race condition in statext_store().
- fe3036527a1f 13.0 landed
- 6c426cd43790 12.3 landed
-
Attempt to fix unstable regression tests, take 2
- 24566b359d09 13.0 landed
-
Attempt to fix unstable regression tests
- 2dc16efedc76 13.0 landed
-
Trigger autovacuum based on number of INSERTs
- b07642dbcd8d 13.0 landed
-
Fix upper limit for vacuum_cleanup_index_scale_factor
- 4d54543efa5e 11.0 cited