Re: document the need to analyze partitioned tables
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Bruce Momjian <bruce@momjian.us>, Justin Pryzby <pryzby@telsasoft.com>, Nathan Bossart <nathandbossart@gmail.com>, Tomas Vondra <tomas.vondra@enterprisedb.com>, Robert Haas <robertmhaas@gmail.com>, Álvaro Herrera <alvherre@alvh.no-ip.org>, yuzuko <yuzukohosoya@gmail.com>, pgsql-hackers@postgresql.org
Date: 2023-01-25T03:26:24Z
Lists: pgsql-hackers
Attachments
- doc_partitioned_tables_and_autovacuum.patch (text/plain) patch
On Wed, 18 Jan 2023 at 22:15, Laurenz Albe <laurenz.albe@cybertec.at> wrote: > Attached is a new version of my patch that tries to improve the wording. I had a look at this and agree that we should adjust the paragraph in question if people are finding it confusing. For your wording, I found I had a small problem with calling partitions of a partitioned tables "normal tables" in: + The partitions of a partitioned table are normal tables and get processed + by autovacuum, but autovacuum doesn't process the partitioned table itself. I started to adjust that but since the text is fairly short it turned out quite different from what you had. I ended up with: + With partitioned tables, since these do not directly store tuples, these + do not require autovacuum to perform any <command>VACUUM</command> + operations. Autovacuum simply performs a <command>VACUUM</command> on the + partitioned table's partitions the same as it does with normal tables. + However, the same is true for <command>ANALYZE</command> operations, and + this can be problematic as there are various places in the query planner + that attempt to make use of table statistics for partitioned tables when + partitioned tables are queried. For now, you can work around this problem + by running a manual <command>ANALYZE</command> command on the partitioned + table when the partitioned table is first populated, and again whenever + the distribution of data in its partitions changes significantly. which I've also attached in patch form. I know there's been a bit of debate on the wording and a few patches, so I may not be helping. If nobody is against the above, then I don't mind going ahead with it and backpatching to whichever version this first applies to. I just felt I wasn't 100% happy with what was being proposed. David
Commits
-
doc: Fix typo in ANALYZE documentation
- c5479178441e 14.3 landed
- c3a587994a01 12.11 landed
- a5d4a3850fa8 11.16 landed
- 8421a99ca189 13.7 landed
- 4e31c46e1e7b 15.0 landed
- 3b6d2b460b5a 10.21 landed
-
Document autoanalyze limitations for partitioned tables
- c1e9cfaef975 10.21 landed
- 0fc2455edbda 11.16 landed
- b36c27191324 12.11 landed
- 78ebfd885be5 13.7 landed
- 6b262f353ef7 14.3 landed
- 61fa6ca79b3c 15.0 landed
-
Revert analyze support for partitioned tables
- 6f8127b73901 15.0 cited
-
Describe (auto-)analyze behavior for partitioned tables
- 1b5617eb844c 14.0 cited