Re: Query is not using index when it should

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Query is not using index when it should
Дата
Msg-id 200412121848.27513.josh@agliodbs.com
обсуждение исходный текст
Ответ на Query is not using index when it should  (tomas@nocrew.org (Tomas Skäre))
Список pgsql-performance
Tomas,

> I tried to subscribe to pgsql-performance, but there seems to be
> something wrong with the majordomo, so I'm sending to general too,
> where I'm already subscribed.

Well, I got your e-mail, so obviously you're subscribed to Performance.

> But when doing a search with objectid, class and field, it doesn't use
> the idx_cjm_object1 index.
> db=# explain analyze select * from cjm_object where objectid=4534 and
> class=12 and field='paroid'; QUERY PLAN

Try:

explain analyze select * from cjm_object where objectid=4534::BIGINT and
class=12 and field='paroid';

Sometimes the planner needs a little extra help on BIGINT fields.   This
problem is fixed in 8.0.

--
Josh Berkus
Aglio Database Solutions
San Francisco

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

Предыдущее
От: John A Meinel
Дата:
Сообщение: Re: Config Check
Следующее
От: Sven Willenberger
Дата:
Сообщение: Using LIMIT changes index used by planner