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

From Corey Huinker
Subject Re: support create index on virtual generated column.
Date
Msg-id CADkLM=dtJZTrbUdFq5UznRepSoYpB2ARm4Q6yGvcgPrxwTtMrQ@mail.gmail.com
Whole thread Raw
In response to Re: support create index on virtual generated column.  (jian he <jian.universality@gmail.com>)
Responses Re: support create index on virtual generated column.
List pgsql-hackers
> 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 name.

For example:

CREATE TABLE example (
   regular_name text,
   lowecase_name text GENERATED ALWAYS AS lower(regular_name) VIRTUAL
);

CREATE INDEX example_b ON example(b);

EXPLAIN SELECT regular_name FROM example WHERE lowercase_name = 'john q smith';

EXPLAIN SELECT regular_name FROM example WHERE lower(regular_name) = 'john q smith';

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: index prefetching
Next
From: Tomas Vondra
Date:
Subject: Re: index prefetching