Anastasia Lubennikova <a.lubennikova@postgrespro.ru> writes:
> The answer to the question about expressions is quite simple - they are not
> supported by index-only scan, so having them in covering index now is just
> wasting of disc space.
Well, it's true that the planner can't handle them easily in IOS, but
your claim that that makes them useless is exactly backwards. As an
example, consider an index on x with f(x) as an extra column. The
planner *could* make use of f(x), at least in simple cases, because
the presence of x would bypass the lack of intelligence in
check_index_only().
In any case, work is afoot to fix that planner restriction, so I do
not think we should add features that expect it to be a permanent
part of the landscape.
regards, tom lane