Re: ways to force index use?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ways to force index use?
Дата
Msg-id 3743.1066089715@sss.pgh.pa.us
обсуждение исходный текст
Ответ на ways to force index use?  (Seth Ladd <seth@picklematrix.net>)
Список pgsql-performance
Seth Ladd <seth@picklematrix.net> writes:
> My Table Columns (all bigints): start, stop, step1, step2, step3
                    ^^^^^^^^^^^

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

> Does anyone have a suggestion on how to get that query to use an index?

Coerce the constants to bigint, for starters.  However, a query that is
selecting almost 10% of the table, as your example is, probably
*shouldn't* be using an index.

            regards, tom lane

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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: ways to force index use?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: go for a script! / ex: PostgreSQL vs. MySQL