Re: support create index on virtual generated column. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: support create index on virtual generated column.
Date
Msg-id 1178617.1753217685@sss.pgh.pa.us
Whole thread Raw
In response to Re: support create index on virtual generated column.  (Corey Huinker <corey.huinker@gmail.com>)
Responses Re: support create index on virtual generated column.
Re: support create index on virtual generated column.
List pgsql-hackers
Corey Huinker <corey.huinker@gmail.com> writes:
> I'm interested in this feature, specifically whether the optimizer uses the
> index in situations where the expression is used rather than the virtual
> column name.

Hmm, I kinda think we should not do this.  The entire point of a
virtual column is that its values are not stored and so you can
(for example) change the generation expression "for free".
If it's referenced in an index that advantage goes out the window
because we'll have to rebuild the index.

Besides, this does nothing you haven't been able to do for
decades with expression indexes.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: index prefetching
Next
From: Merlin Moncure
Date:
Subject: Re: Making jsonb_agg() faster