The old "not using index" question

Поиск
Список
Период
Сортировка
От Jan-Philipp 'Thefly' Reining
Тема The old "not using index" question
Дата
Msg-id 02cd01c297c5$8cfcbb80$84c206d4@thefly
обсуждение исходный текст
Ответы Re: The old "not using index" question  (Hubert depesz Lubaczewski <depesz@depesz.pl>)
Список pgsql-general
Hi there,

---this one is using the index on "ranking"
SELECT  *
FROM  ttm_slots s
WHERE  s.peering = 72
AND   s.ranking = 1050

---but this one does not?
SELECT  *
FROM  ttm_slots s
WHERE  s.peering = 72
AND   s.ranking < 1050
AND   s.ranking > 950

The index ist "btree", so it should be able to use the index with a < >
comparison?

\d ranking_ttm_slots_key
Index "ranking_ttm_slots_key"
 Column  |  Type
---------+---------
 ranking | integer
btree



regards,
Jan-Philipp


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Memory leak with palloc
Следующее
От: Joe Conway
Дата:
Сообщение: Re: One SQL to access two databases.