| От | Thomas Lockhart |
|---|---|
| Тема | Re: Indexes not used in 7.1RC4: Bug? |
| Дата | |
| Msg-id | 3AD47334.25B9AC9A@alumni.caltech.edu обсуждение исходный текст |
| Ответ на | Re: Indexes not used in 7.1RC4: Bug? (Thomas Lockhart <lockhart@alumni.caltech.edu>) |
| Список | pgsql-hackers |
> What about going the other way around... Promote the int2 to an int4
> (lossless). Actually for all int1,int2 datatypes (regardless of whether it
> was the constant or the column) you could promote all to a common int4 and
> then do comparisons.
That is why the index is not used: the backend is promoting all of the
int2 column values to
int4 for the comparison, and concludes that the available index is not
relevant.
The index traversal code would need to know how to promote individual
values in the index for comparison, which is an interesting idea but I
haven't thought about how efficient it would be. Clearly the cost would
be different than a simple comparison.
- Thomas
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера