Re: PostGres is not using indices in select, I would like it to because it is too slow !

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: PostGres is not using indices in select, I would like it to because it is too slow !
Дата
Msg-id 20010928093303.C32426@svana.org
обсуждение исходный текст
Ответ на PostGres is not using indices in select, I would like it to because it is too slow !  (Dominique Dumortier <dominique.dumortier@entpe.fr>)
Список pgsql-general
On Mon, Sep 24, 2001 at 09:39:19PM +0200, Dominique Dumortier wrote:
> Dear all,
>
>     "cix" smallint,
>     "ciy" smallint,

> The index is created like that:
>
> CREATE INDEX ci_index on city (cix,ciy)
>
> If I do select ciname from city where cix=400 and ciy=500;

Try putting quotes around the numbers. There are similar issues with bigint
where it can't see that smallint promotes to int4 without loss so it doesn't
realise that it can use an index.. By putting quotes around it, the database
will see them as smallints and (hopefully) us the index.

HTH,

--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/
> Magnetism, electricity and motion are like a three-for-two special offer:
> if you have two of them, the third one comes free.

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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Performance question (stripped down the problem)
Следующее
От: merlyn@stonehenge.com (Randal L. Schwartz)
Дата:
Сообщение: Re: Randomize Result Set Order