pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: autovacuum: handle analyze for partitioned tables
Date: Thu, 08 Apr 2021 05:20:39 +0000
Message-ID: <E1lUN5r-0005bJ-9G@gemulon.postgresql.org> (raw)

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 <yuzukohosoya@gmail.com>
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Reviewed-by: Tomas Vondra <tomas.vondra@enterprisedb.com>
Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://postgr.es/m/CAKkQ508_PwVgwJyBY=0Lmkz90j8CmWNPUxgHvCUwGhMrouz6UA@mail.gmail.com

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(-)



view thread (33+ messages)  latest in thread

Message-ID: <E1lUN5r-0005bJ-9G@gemulon.postgresql.org>
Permalink:  ../E1lUN5r-0005bJ-9G@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lUN5r-0005bJ-9G@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: autovacuum: handle analyze for partitioned tables
  In-Reply-To: <E1lUN5r-0005bJ-9G@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox