pgsql: autovacuum: handle analyze for partitioned tables

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

pgsql: autovacuum: handle analyze for partitioned tables

Álvaro Herrera
autovacuum: handle analyze for partitioned tables

Previously, autovacuum would completely ignore partitioned tables, which
is not good regarding analyze -- failing to analyze those tables means
poor plans may be chosen.  Make autovacuum aware of those tables by
propagating "changes since analyze" counts from the leaf partitions up
the partitioning hierarchy.

This also introduces necessary reloptions support for partitioned tables
(autovacuum_enabled, autovacuum_analyze_scale_factor,
autovacuum_analyze_threshold).  It's unclear how best to document this
aspect.

Author: Yuzuko Hosoya <[hidden email]>
Reviewed-by: Kyotaro Horiguchi <[hidden email]>
Reviewed-by: Tomas Vondra <[hidden email]>
Reviewed-by: Álvaro Herrera <[hidden email]>
Discussion: https://postgr.es/m/CAKkQ508_PwVgwJyBY=0Lmkz90j8CmWNPUxgHvCUwGhMrouz6UA@...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0827e8af70f4653ba17ed773f123a60eadd9f9c9

Modified Files
--------------
src/backend/access/common/reloptions.c |  15 +++--
src/backend/catalog/system_views.sql   |   4 +-
src/backend/commands/analyze.c         |  40 ++++++++----
src/backend/postmaster/autovacuum.c    | 105 +++++++++++++++++++++++++++++---
src/backend/postmaster/pgstat.c        | 108 ++++++++++++++++++++++++++++++---
src/include/pgstat.h                   |  25 +++++++-
src/test/regress/expected/rules.out    |   4 +-
7 files changed, 257 insertions(+), 44 deletions(-)

Reply | Threaded
Open this post in threaded view
|

Re: pgsql: autovacuum: handle analyze for partitioned tables

Tom Lane-2
Alvaro Herrera <[hidden email]> writes:
> autovacuum: handle analyze for partitioned tables

Looks like this has issues under EXEC_BACKEND:

https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=culicidae&dt=2021-04-08%2005%3A50%3A08

                        regards, tom lane