Re: switching default integer datatype to int8 and "IN (...)" clause
В списке pgsql-sql по дате отправления:
| От | Andrew J. Kopciuch |
|---|---|
| Тема | Re: switching default integer datatype to int8 and "IN (...)" clause |
| Дата | |
| Msg-id | 200301090330.41238.akopciuch@bddf.ca обсуждение исходный текст |
| Ответ на | switching default integer datatype to int8 and "IN (...)" clause (postgres@ied.com) |
| Ответы |
Re: switching default integer datatype to int8 and "IN (...)"
|
| Список | pgsql-sql |
> but a select like this takes ages (looooong time): > # select * from file where id = 1921773; > id | name > -----+---------------- > 1921777 | icons > I believe the reason is this : the numeric literal is first considered an int4 becuase it falls within the range of int4 (-2147483648 to +2147483647). try quoting the literal like this: # select * from file where id = '1921773'; This forces the literal to be evaluated. If you do an explain on that query ... you should see that the query planner uses the index as expected and that the condition used on the index is using the literal value cast to a big int. That's just my understanding anyway. Andy
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера