Re: Allow to collect statistics on virtual generated columns

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Allow to collect statistics on virtual generated columns
Date: 2026-03-24 11:43:47
Message-ID: CAEZATCUR5B=6M7H2bwRU0_6FrbSE8yHe_+9bTbRUdU=jE33yog@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 24 Mar 2026 at 10:57, Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp> wrote:
>
> One concern is that CREATE STATISTICS does not allow creating extended
> statistics on a single colmun. If we try this, it raises the following error:
>
> ERROR: extended statistics require at least 2 columns
>
> Therefore, if we take this approach, we would need to add an exception
> to this rule for virtual columns.

I think that would be fine. It makes sense because a virtual column
expands to an expression, and we already allow CREATE STATISTICS on a
single expression.

Regards,
Dean

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2026-03-24 11:47:17 Re: Eliminating SPI / SQL from some RI triggers - take 3
Previous Message Yugo Nagata 2026-03-24 11:34:30 Adjust error message for CREATE STATISTICS to account for expressions