Re: Allow to collect statistics on virtual generated columns

From: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
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-26 17:39:00
Message-ID: 20260327023900.0acda9b16d4d10cd1d453497@sraoss.co.jp
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 26 Mar 2026 17:25:23 +0000
Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:

> On Thu, 26 Mar 2026 at 16:00, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:
> >
> > On Thu, 26 Mar 2026 at 15:09, Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp> wrote:
> > >
> > > I've attached an updated patch including the documentation and tests.
>
> Looking at get_relation_statistics(), I think that you need to call
> expand_generated_columns_in_expr() *before* ChangeVarNodes() so that
> Vars in the expanded expression end up with the correct varno.

Thank you for the review.

I've corrected the placement of expand_generated_columns_in_expr()
so that it is called before ChangeVarNodes(). A revised patch is attached.

Regards,
Yugo Nagata

--
Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>

Attachment Content-Type Size
v9-0001-Allow-creating-extended-statistics-on-virtual-gen.patch text/x-diff 19.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2026-03-26 17:44:01 Re: Allow to collect statistics on virtual generated columns
Previous Message Masahiko Sawada 2026-03-26 17:30:21 Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions