| От | Bill Moran |
|---|---|
| Тема | Re: sequential scan when using bigint value |
| Дата | |
| Msg-id | 405B06FF.50603@potentialtech.com обсуждение исходный текст |
| Ответ на | sequential scan when using bigint value (David Garamond <lists@zara.6.isreserved.com>) |
| Список | pgsql-general |
David Garamond wrote: > I have a table of 2mil records. The table consists of two columns, id > (BYTEA/GUID, PK) and i (INT, UNIQUE INDEX). Could someone explain why, > when using a bigint value like this: > > select * from partition where i=3000000000; > > or > > select * from partition where i in (1,2,3,3000000000); > > Postgres immediately switches from index scan to seq scan? I believe it's in the FAQ. But Postgres always uses a sequential scan when types don't match. If you're going to be looking for BIGINTs in that table, you should probably set i to BIGINT and always cast your search criterea to BIGINT. Otherwise, I can't imagine why you would be looking for a BIGINT in an INT field. -- Bill Moran Potential Technologies http://www.potentialtech.com
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера