Corey Huinker <corey.huin...@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