Re: Using bigint needs explicit cast to use the index

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: Using bigint needs explicit cast to use the index
Дата
Msg-id 404BC1CE.3040009@samurai.com
обсуждение исходный текст
Ответ на Using bigint needs explicit cast to use the index  ("Steven Butler" <stevenb@kjross.com.au>)
Список pgsql-performance
Steven Butler wrote:
> I've recently converted a database to use bigint for the indices.  Suddenly
> simple queries like
>
> select * from new_test_result where parent_id = 2
>
> are doing full table scans instead of using the index.

This is fixed in CVS HEAD. In the mean time, you can enclose the
integer literal in single quotes, or explicitely cast it to the type
of the column.

FWIW, this is an FAQ.

-Neil

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

Предыдущее
От: "Steven Butler"
Дата:
Сообщение: Using bigint needs explicit cast to use the index
Следующее
От: Christopher Kings-Lynne
Дата:
Сообщение: Re: speeding up a select with C function?