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

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Don't treat virtual generated columns as missing statistics in vacuumdb --missing-stats-only
Date: 2025-08-20 03:49:14
Message-ID: CAHGQGwFcQT-6QZYFJLXxZ0s+1cOZve3+QcTubrn3+=Qn4zFKUg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Aug 20, 2025 at 10:42 AM Yugo Nagata <nagata(at)sraoss(dot)co(dot)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?

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2025-08-20 04:14:24 Re: Logical Replication of sequences
Previous Message Tom Lane 2025-08-20 03:47:21 Re: VM corruption on standby