Re: pgsql: autovacuum: handle analyze for partitioned tables

Поиск
Список
Период
Сортировка
От Zhihong Yu
Тема Re: pgsql: autovacuum: handle analyze for partitioned tables
Дата
Msg-id CALNJ-vTHK-s41LFrizOpMN6n6tKGBMt9UUOY=SFHNWcCy-2tQw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pgsql: autovacuum: handle analyze for partitioned tables  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Ответы Re: pgsql: autovacuum: handle analyze for partitioned tables
Список 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 по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: pgsql: autovacuum: handle analyze for partitioned tables
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Dubious coding in nbtinsert.c