Re: Berserk Autovacuum (let's save next Mandrill)
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>, Justin Pryzby <pryzby@telsasoft.com>, Masahiko Sawada <masahiko.sawada@2ndquadrant.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>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>, Alvaro Herrera <alvherre@2ndquadrant.com>, Michael Banck <mbanck@gmx.net>
Date: 2020-03-20T02:23:51Z
Lists: pgsql-hackers
Hi, On 2020-03-20 15:05:03 +1300, David Rowley wrote: > On Fri, 20 Mar 2020 at 11:17, Andres Freund <andres@anarazel.de> wrote: > > I think there's too much "reinventing" autovacuum scheduling in a > > "local" insert-only manner happening in this thread. And as far as I can > > tell additionally only looking at a somewhat narrow slice of insert only > > workloads. > > I understand your concern and you might be right. However, I think the > main reason that the default settings for the new threshold and scale > factor has deviated this far from the existing settings is regarding > the example of a large insert-only table that receives inserts of 1 > row per xact. If we were to copy the existing settings then when that > table gets to 1 billion rows, it would be eligible for an > insert-vacuum after 200 million tuples/xacts, which does not help the > situation since an anti-wraparound vacuum would be triggering then > anyway. Sure, that'd happen for inserts that happen after that threshold. I'm just not convinced that this is as huge a problem as presented in this thread. And I'm fairly convinced the proposed solution is the wrong direction to go into. It's not like that's not an issue for updates? If you update one row per transaction, then you run into exactly the same issue for a table of the same size? You maybe could argue that it's more common to insert 1 billion tuples in individual transaction, than it is to update 1 billion tuples in individual transactions, but I don't think it's a huge difference if it even exist. In fact the problem is worse for the update case, because that tends to generate a lot more random looking IO during vacuum (both because only parts of the table are updated causing small block reads/writes, and because it will need [multiple] index scans/vacuum, and because the vacuum is a lot more expensive CPU time wise). Imo this line of reasoning is about adding autovacuum scheduling based on xid age, not about insert only workloads. Greetings, Andres Freund
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