Re: Berserk Autovacuum (let's save next Mandrill)
Laurenz Albe <laurenz.albe@cybertec.at>
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Andres Freund <andres@anarazel.de>, Masahiko Sawada <masahiko.sawada@2ndquadrant.com>, David Rowley <dgrowleyml@gmail.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>, pgsql-hackers@lists.postgresql.org, Alvaro Herrera <alvherre@2ndquadrant.com>, Michael Banck <mbanck@gmx.net>
Date: 2020-03-17T21:22:44Z
Lists: pgsql-hackers
On Tue, 2020-03-17 at 16:07 -0500, Justin Pryzby wrote: > > Assume a scale factor >= 1, for example 2, and n live tuples. > > The table has just been vacuumed. > > > > Now we insert m number tuples (which are live). > > > > Then the condition > > > > threshold + scale_factor * live_tuples < newly_inserted_tuples > > > > becomes > > > > 10000000 + 2 * (n + m) < m > > > > which can never be true for non-negative n and m. > > > > So a scale factor >= 1 disables the feature. > > No, this is what we mailed about privately yesterday, and I demonstrated that > autovac can still run with factor=100. I said: I remember. Can you point out where exactly the flaw in my reasoning is? > > It's a multiplier, not a percent out of 100 (fraction is not a great choice of > > words). > > > > &autovacuum_vac_scale, > > 0.2, 0.0, 100.0, > > > > The default is 0.2 (20%), so 100 means after updating/deleting 100*reltuples. Yes, exactly. > If 1.0 disabled the feature, it wouldn't make much sense to allow factor up to > 100. True, we could set the upper limit to 2, but it doesn't matter much. Note that this is different from autovacuum_vacuum_scale_factor, because inserted tuples are live, while dead tuples are not. 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