Re: support create index on virtual generated column.

2025-07-24 Thread jian he
On Wed, Jul 23, 2025 at 4:54 AM Tom Lane wrote: > > Corey Huinker 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. Th

Re: support create index on virtual generated column.

2025-07-22 Thread Tom Lane
Corey Huinker 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

Re: support create index on virtual generated column.

2025-07-22 Thread Corey Huinker
> > > hi. > > refactor and rebase. > > fix the regress tests failure in v4. > This may need another rebase, as it doesn't apply to master. 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 na

Re: support create index on virtual generated column.

2025-07-09 Thread jian he
On Tue, Jul 8, 2025 at 2:37 PM jian he wrote: > > On Tue, Apr 15, 2025 at 4:36 PM jian he wrote: > > > > comment out tests are for to be implemented feature. > > There are some test changes that are indeed not necessary, I restored it > > back, > > please check attached. > > hi. > refactor and r

Re: support create index on virtual generated column.

2025-07-07 Thread jian he
On Tue, Apr 15, 2025 at 4:36 PM jian he wrote: > > comment out tests are for to be implemented feature. > There are some test changes that are indeed not necessary, I restored it back, > please check attached. hi. refactor and rebase. From d61f21e6fc410827d152a633e5699197c802870a Mon Sep 17 00:00

Re: support create index on virtual generated column.

2025-04-15 Thread jian he
On Mon, Apr 14, 2025 at 8:05 PM Kirill Reshke wrote: > > On Mon, 14 Apr 2025 at 16:10, jian he wrote: > > > > new patch attached. Now, > > ALTER TABLE DROP COLUMN works fine. > > ALTER INDEX ATTACH PARTITION works fine. > > creating such an index on a partitioned table works just fine. > > for ta

Re: support create index on virtual generated column.

2025-04-14 Thread Kirill Reshke
On Mon, 14 Apr 2025 at 16:10, jian he wrote: > > new patch attached. Now, > ALTER TABLE DROP COLUMN works fine. > ALTER INDEX ATTACH PARTITION works fine. > creating such an index on a partitioned table works just fine. > for table inheritance: create index on parent table will not cascade > to ch

Re: support create index on virtual generated column.

2025-04-14 Thread jian he
On Wed, Mar 26, 2025 at 5:36 PM Kirill Reshke wrote: > reshke=# CREATE TABLE xx (a int, b int GENERATED ALWAYS AS (a * 2) VIRTUAL) ; > CREATE TABLE > reshke=# create index on xx (b); > CREATE INDEX > reshke=# > reshke=# \d+ xx > Table "public.xx

Re: support create index on virtual generated column.

2025-03-26 Thread Kirill Reshke
On Wed, 26 Mar 2025 at 12:15, jian he wrote: > > hi. > attached patch for implementing $subject feature. > > * internally such index will be transformed into expression index. > for example, an index on (b int GENERATED ALWAYS AS (a * 2) VIRTUAL) will be > converted into an expression index on