| От | Mike Mascari |
|---|---|
| Тема | Re: Unused Indexes |
| Дата | |
| Msg-id | 3F27C510.1090708@mascari.com обсуждение исходный текст |
| Ответ на | Re: Unused Indexes (Mike Mascari <mascarm@mascari.com>) |
| Список | pgsql-general |
Mike Mascari wrote: > Tim McAuley wrote: > >>Hi, >> >>I have a table which I have populated with over 5000 entries. There is a >>combined index placed on two of the columns (both bigint). I am trying >>a simple select (i.e. select id where col1 = 1 and col2 = 1) covering >>these two columns and it keeps using a seq scan. Is this correct? I >>would have thought that with this number of entries that an index scan >>should be used. > > > You must cast the 1 to a bigint: > > SELECT id WHERE col1 = 1::bigint AND col1 = 2::bigint That should read: SELECT id WHERE col1 = 1::bigint AND col2 = 1::bigint. My dyslexia is kicking in... Mike Mascari mascarm@mascari.com
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера