Re: [PGSQL 8.3.5] Use of a partial indexes

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: [PGSQL 8.3.5] Use of a partial indexes
Дата
Msg-id dcc563d10812300612m5d02e4baqf9c8f40266fa4875@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PGSQL 8.3.5] Use of a partial indexes  (Reg Me Please <regmeplease@gmail.com>)
Ответы Re: [PGSQL 8.3.5] Use of a partial indexes
Список pgsql-general
On Tue, Dec 30, 2008 at 2:02 AM, Reg Me Please <regmeplease@gmail.com> wrote:
> Only one question remains in my mind:
>
> why the planner is not using the partial index?
>
> The partial index is covering 2 predicates out of the 3 used in the where
> condition. Actually there is a boolean flag (to exclude "disabled" rows),
> a timestamp (for row age) and an int8 (a FK to another table).
> The first two are in the partial index in order to exclude "disabled" and
> older rows. The int8 is the "random" key I mentioned earlier.
>
> So the WHERE condition reads like:
>
> flag AND tstz >= '2008-01-01'::timestamptz and thekey=42
>
> I can see in the EXPLAIN that there is no mention to the partial index.
> Please keep in mind that the table has 8+M rows, few of which are flagged,
> about 70% don't match the age limit and few dozens match the key.
> In my opinion the partial index should help a lot.

Can you show us the DDL for the index creation and the select query as well?

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

Предыдущее
От: "Bhujbal, Santosh"
Дата:
Сообщение: postgres block_size problem
Следующее
От: justin
Дата:
Сообщение: Re: [PGSQL 8.3.5] Use of a partial indexes