Re: pgsql: CREATE INDEX ... INCLUDING (column[, ...])

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Anastasia Lubennikova <a(dot)lubennikova(at)postgrespro(dot)ru>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: CREATE INDEX ... INCLUDING (column[, ...])
Date: 2016-04-08 19:22:15
Message-ID: 26649.1460143335@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Anastasia Lubennikova <a(dot)lubennikova(at)postgrespro(dot)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

In response to

Browse pgsql-committers by date

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

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2016-04-08 19:22:38 Re: 2016-03 Commitfest
Previous Message Alexander Korotkov 2016-04-08 19:19:41 Re: Move PinBuffer and UnpinBuffer to atomics