| От | Corey Edwards |
|---|---|
| Тема | Re: select is not using index? |
| Дата | |
| Msg-id | 1075936942.12400.18.camel@harvey обсуждение исходный текст |
| Ответ на | select is not using index? (Mark Harrison <mh@pixar.com>) |
| Список | pgsql-performance |
On Wed, 2004-02-04 at 14:55, Mark Harrison wrote: > testdb=# \d bigtable > Table "public.bigtable" > Column | Type | Modifiers > ---------+---------+----------- > id | bigint | not null > typeid | integer | not null > reposid | integer | not null > Indexes: bigtable_id_key unique btree (id) > testdb=# explain select * from bigtable where id = 123; Your column is a bigint but 123 defaults to type int. Indexes aren't used when there's a type mismatch. Use an explicit cast or quote it: select * from bigtable where id = 123::bigint; Or select * from bigtable where id = '123'; Corey
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера