Re: document the need to analyze partitioned tables
Laurenz Albe <laurenz.albe@cybertec.at>
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Bruce Momjian <bruce@momjian.us>, 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-18T19:26:10Z
Lists: pgsql-hackers
On Wed, 2023-01-18 at 11:49 -0600, Justin Pryzby wrote: > I tweaked this a bit to end up with: > > > - Partitioned tables are not processed by autovacuum. Statistics > > - should be collected by running a manual <command>ANALYZE</command> when it is > > + The leaf partitions of a partitioned table are normal tables and are processed > > + by autovacuum; however, autovacuum does not process the partitioned table itself. > > + This is no problem as far as <command>VACUUM</command> is concerned, since > > + there's no need to vacuum the empty, partitioned table. But, as mentioned in > > + <xref linkend="vacuum-for-statistics"/>, it also means that autovacuum won't > > + run <command>ANALYZE</command> on the partitioned table. > > + Although statistics are automatically gathered on its leaf partitions, some queries also need > > + statistics on the partitioned table to run optimally. You should collect statistics by > > + running a manual <command>ANALYZE</command> when the partitioned table is > > first populated, and again whenever the distribution of data in its > > partitions changes significantly. > > </para> > > "partitions are normal tables" was techically wrong, as partitions can > also be partitioned. I am fine with your tweaks. I think this is good to go. Yours, Laurenz Albe
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