Re: Optimizer refuses to hash join

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Optimizer refuses to hash join
Дата
Msg-id 24077.1091206170@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Optimizer refuses to hash join  (Stan Bielski <bielski@ece.cmu.edu>)
Список pgsql-performance
Stan Bielski <bielski@ece.cmu.edu> writes:
> On Thu, 29 Jul 2004, Tom Lane wrote:
>> Are you sure the join condition is hashjoinable?  You didn't say
>> anything about the datatypes involved ...

> My apologies. The columns that I want to join are both type 'inet'.
> Shouldn't that be hashjoinable?

Depends on your PG version.  The raw type isn't hashjoinable, because
its '=' operator ignores the inet-vs-cidr flag.  Before 7.4 the operator
was (correctly) marked not hashjoinable.  In 7.4 it was (incorrectly)
marked hashjoinable, due no doubt to momentary brain fade on my part.
For 7.5 it is hashjoinable and the join will actually work, because we
added a specialized hash function that also ignores the inet-vs-cidr flag.

If you are joining data that is all inet or all cidr (no mixtures),
then 7.4 works okay, which is why we didn't notice the bug right away.
If that's good enough for now, you could emulate the 7.4 behavior in
earlier releases by setting the oprcanhash flag in pg_operator for the
inet equality operator.

            regards, tom lane

В списке pgsql-performance по дате отправления:

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: my boss want to migrate to ORACLE
Следующее
От: "Matthew T. O'Connor"
Дата:
Сообщение: Re: my boss want to migrate to ORACLE