Re: ways to force index use?

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: ways to force index use?
Дата
Msg-id 200310131655.25022.josh@agliodbs.com
обсуждение исходный текст
Ответ на ways to force index use?  (Seth Ladd <seth@picklematrix.net>)
Список pgsql-performance
Seth,

> The Query: explain analyze select * from path where start = 653873 or
> start = 649967 or stop = 653873 or stop = 649967

you need to cast all those numbers to BIGINT:

select * from path where start = 653873::BIGINT or
start = 649967::BIGINT or stop = 653873::BIGINT or stop = 649967::BIGINT

Then an index on start or stop should be used by the planner.

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco


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

Предыдущее
От: Seth Ladd
Дата:
Сообщение: ways to force index use?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ways to force index use?