Re: Don't treat virtual generated columns as missing statistics in vacuumdb --missing-stats-only

Поиск
Список
Период
Сортировка
От Yugo Nagata
Тема Re: Don't treat virtual generated columns as missing statistics in vacuumdb --missing-stats-only
Дата
Msg-id 20250820133012.c3c013055f8409e4765a72e8@sraoss.co.jp
обсуждение исходный текст
Ответ на Re: Don't treat virtual generated columns as missing statistics in vacuumdb --missing-stats-only  (Fujii Masao <masao.fujii@gmail.com>)
Ответы Re: Don't treat virtual generated columns as missing statistics in vacuumdb --missing-stats-only
Список pgsql-hackers
On Wed, 20 Aug 2025 12:49:14 +0900
Fujii Masao <masao.fujii@gmail.com> wrote:

> On Wed, Aug 20, 2025 at 10:42 AM Yugo Nagata <nagata@sraoss.co.jp> wrote:
> >
> > Hi,
> >
> > I found that "vacuumdb --missing-stats-only" always performs ANALYZE
> > on tables with a virtual generated column, since such columns currently
> > never have statistics. This seems like an obvious waste, so I've attached
> > a patch to fix it, ensuring that virtual generated columns are not
> > regarded as missing statistics.
> 
> Thanks for the report and patch! This seems to be an oversight from
> the commit that added virtual generated columns.
> 
> For the patch, shouldn't we also add a regression test for --missing-stats-only
> with generated columns, to prevent this issue from happening again?

Thank you for reviewing the patch and your suggestion.

I agree that we should add a test, since the behavior may change in the future
when statistics begin to be collected for virtual generated columns, and the test
will serve as a reminder when this behavior changes.

I've attached a updated patch including the test.

Regards,
Yugo Nagata

-- 
Yugo Nagata <nagata@sraoss.co.jp>

Вложения

В списке pgsql-hackers по дате отправления: