Re: Index type

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Index type
Дата
Msg-id 200408161616.27768.josh@agliodbs.com
обсуждение исходный текст
Ответ на Index type  (Ilia Kantor <algolist@manual.ru>)
Список pgsql-performance
Ilia,

> If I create btree index on all columns (A,B,C..), here is what explain
> analyze gives me:
> -----------------------------------------------------------------
>  Index Scan using all_ind on test2  (cost=0.00..4.51 rows=1 width=24)
> (actual ti me=0.000..0.000 rows=5 loops=1)
>    Index Cond: ((a >= '2004-07-20 23:50:50'::timestamp without time zone)
> AND (a <= '2004-07-21 23:50:50'::timestamp without time zone) AND (b >=
> '2004-07-20 23
>
> :50:50'::timestamp without time zone) AND (b <= '2004-07-21
> : 23:50:50'::timestamp
>
>  without time zone) AND (c >= '2004-07-20 23:50:50'::timestamp without time
> zone ) AND (c <= '2004-07-21 23:50:50'::timestamp without time zone))

Looks good to me.   It's a fully indexed search, which it should be with
BETWEEN.  The only thing you need to ask yourself is whether or not you've
selected the columns in the most selective order (e.g. most selective column
first).

--
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco

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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Timestamp-based indexing
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Timestamp-based indexing