Re: pgsql: CREATE INDEX ... INCLUDING (column[, ...]) - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: CREATE INDEX ... INCLUDING (column[, ...])
Date
Msg-id 26649.1460143335@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: CREATE INDEX ... INCLUDING (column[, ...])  (Anastasia Lubennikova <a.lubennikova@postgrespro.ru>)
List pgsql-committers
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


pgsql-committers by date:

Previous
From: Stephen Frost
Date:
Subject: pgsql: In dumpTable, re-instate the skipping logic
Next
From: Kevin Grittner
Date:
Subject: pgsql: Modify BufferGetPage() to prepare for "snapshot too old" feature