Re: cannot use multicolumn index

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: cannot use multicolumn index
Дата
Msg-id CAOR=d=3iP-iVahZPS1O1-GAijo=0M_NMrdmM59kkT7Wh-Vgs_w@mail.gmail.com
обсуждение исходный текст
Ответ на cannot use multicolumn index  (MirrorX <mirrorx@gmail.com>)
Список pgsql-performance
On Wed, Sep 14, 2011 at 6:50 AM, MirrorX <mirrorx@gmail.com> wrote:
> dear all,
>
> i have a table with (approx) 500.000.000 rows. it has several indexes, one
> of which is a multicolumn index
> for a column that has an id (integer) and a column that has a timestamp. i
> have read in the manual that the multicolumn index can be used only if the
> clauses of the query are in the same order as the columns of the index. so i
> am trying the following simple query ->

this is incorrect.  Where did you read this?  The order in the where
clause doesn't matter.  Older versions of pg cannot use a muilticolumn
index unless you use the first column in the where clause / group by,
but newer versions can use that index, but since it's much less
efficient that way they will usually pick another index with the other
column in it first.

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

Предыдущее
От: Gunnlaugur Þór Briem
Дата:
Сообщение: Constraint exclusion on UNION ALL subqueries with WHERE conditions
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: cannot use multicolumn index