Re: pgsql: autovacuum: handle analyze for partitioned tables - Mailing list pgsql-hackers

From Zhihong Yu
Subject Re: pgsql: autovacuum: handle analyze for partitioned tables
Date
Msg-id CALNJ-vTHK-s41LFrizOpMN6n6tKGBMt9UUOY=SFHNWcCy-2tQw@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: autovacuum: handle analyze for partitioned tables  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: pgsql: autovacuum: handle analyze for partitioned tables  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers


On Thu, Apr 8, 2021 at 1:12 PM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
On 2021-Apr-08, Tom Lane wrote:

> > So I tend to think that my initial instinct was the better direction: we
> > should not be doing any find_all_inheritors() here at all, but instead
> > rely on pg_class.reltuples to be set for the partitioned table.
>
> +1

This patch does that.

--
Álvaro Herrera                            39°49'30"S 73°17'W
"I dream about dreams about dreams", sang the nightingale
under the pale moon (Sandman)

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.

Cheers 

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: pgsql: autovacuum: handle analyze for partitioned tables
Next
From: Tom Lane
Date:
Subject: Re: Dubious coding in nbtinsert.c