| От | Tom Lane |
|---|---|
| Тема | Re: index used when casting to different type? |
| Дата | |
| Msg-id | 10839.982637221@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | index used when casting to different type? (adb <adb@Beast.COM>) |
| Ответы |
Re: index used when casting to different type?
|
| Список | pgsql-general |
adb <adb@Beast.COM> writes:
> If I have a table with a key column stored as text and
> another table with a key column stored as an int4 and
> I join the two by casting the in4 column to text, will the existing
> index on the int4 key be used?
Nope. Indexes are associated with a particular datatype and only work
for comparison operators of that datatype. The index on the first
table's text column could possibly be used in this scenario, but not
the one on the int4 column.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера