Re: Index only scan

Поиск
Список
Период
Сортировка
От Gavin Flower
Тема Re: Index only scan
Дата
Msg-id 50761712.1070900@archidevsys.co.nz
обсуждение исходный текст
Ответ на Re: Index only scan  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Index only scan  (Lars Helge Øverland <larshelge@gmail.com>)
Список pgsql-general
On 11/10/12 12:41, Tom Lane wrote:
> Gavin Flower <GavinFlower@archidevsys.co.nz> writes:
>> On 11/10/12 01:03, Lars Helge Øverland wrote:
>>> My question is: Would it be feasible and/or possible to implement
>>> index only scans in a way that it could take advantage of several,
>>> single-column indexes? For example, a query spanning columns a, b, c
>>> could take advantage of 3 single-column indexes put on columns a, b,
>>> c.
>> Index only scans do use multiple indexes of single fields where
>> appropriate.  Here the planner determined it only needed to scan 2 of
>> the 3 relevant single field indexes.
> But your example isn't an index-only scan ... it's a plain old bitmap
> scan, and so it does touch the heap.
>
> The difficulty with what Lars proposes is that there's no way to scan
> the different indexes "in sync" --- each one will be ordered according
> to its own column order.  In principle I guess we could read out the
> index data and do a join using the ctid's, but it's far from clear that
> such a thing would be worth the trouble.
>
>             regards, tom lane
Thanks for the correction!

Cheers,
Gavin


В списке pgsql-general по дате отправления:

Предыдущее
От: Darren Duncan
Дата:
Сообщение: Re: moving from MySQL to pgsql
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Planner chooses multi-column index in 9.2 when maybe it should not