Re: pgsql: autovacuum: handle analyze for partitioned tables

Alvaro Herrera <alvherre@alvh.no-ip.org>

From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Zhihong Yu <zyu@yugabyte.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2021-04-08T21:29:51Z
Lists: pgsql-hackers
On 2021-Apr-08, Zhihong Yu wrote:

> Hi,
> Within truncate_update_partedrel_stats(), dirty is declared within the loop.
> +       if (rd_rel->reltuples != 0)
> +       {
> ...
> +       if (dirty)
> 
> The two if blocks can be merged. The variable dirty can be dropped.

Hi, thanks for reviewing.  Yes, evidently I copied vac_update_relstats
too closely -- that boolean is not necessary.

-- 
Álvaro Herrera       Valdivia, Chile



Commits

  1. Describe (auto-)analyze behavior for partitioned tables

  2. Add comment about extract_autovac_opts not holding lock

  3. Set pg_class.reltuples for partitioned tables

  4. autovacuum: handle analyze for partitioned tables