Re: Hash Join not using hashed index?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Hash Join not using hashed index?
Дата
Msg-id 14589.962175604@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Hash Join not using hashed index?  (Ang Chin Han <angch@pintoo.com>)
Ответы Re: Hash Join not using hashed index?  (Ang Chin Han <angch@pollcities.com>)
Список pgsql-sql
Hash joins don't have anything to do with hash indexes.

A hash join is a join that makes use of a temporary hashtable
built on-the-fly *in memory* for that join.

The planner could choose to use an indexscan on a hash index
as an input for the join, but it'd only be likely to do so
if there is a restriction clause matching the index.  In your
example you have only a join WHERE clause.

Plain btree indexes on city.country_id and country.country_id
might work better --- at least they'd offer the option of
a merge join without doing explicit sort.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problem with pg_dumpall
Следующее
От: Ben Stringer
Дата:
Сообщение: Selecting outside the current DB