Hi. I have two existing tables, A and B. A has a 'varchar(1000)' field and B has a 'text' field, each with btree indexes defined. When I do a join between these, on this field, it seems to a hash join, as opposed to using the indexes, as I might expect (I'm no postgres expert, btw). My question is: if I changed both fields to be text or varchar(1000) then would the index be used? Ta, -- Mike
Mike Moran <mike_moran@mac.com> writes:
> Hi. I have two existing tables, A and B. A has a 'varchar(1000)' field
> and B has a 'text' field, each with btree indexes defined. When I do a
> join between these, on this field, it seems to a hash join, as opposed
> to using the indexes, as I might expect (I'm no postgres expert, btw).
> My question is: if I changed both fields to be text or varchar(1000)
> then would the index be used?
Probably not, and in any case your assumption is mistaken. Indexes are
not always the right way to join.
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера