Hash Join not using hashed index?

Поиск
Список
Период
Сортировка
От Ang Chin Han
Тема Hash Join not using hashed index?
Дата
Msg-id 20000628132411.B29825@pollcities.com
обсуждение исходный текст
Ответы Re: Hash Join not using hashed index?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
I'm using Postgresql 7.02.

======================================================================
# explain select city.name, country.name from country, city
where city.country_id = country.country_id;
NOTICE:  QUERY PLAN:
Hash Join  (cost=8.85..16.76 rows=75 width=18) ->  Seq Scan on city  (cost=0.00..1.75 rows=75 width=16) ->  Hash
(cost=5.53..5.53rows=253 width=2)       ->  Seq Scan on country  (cost=0.00..5.53 rows=253 width=2)         
 

EXPLAIN 
# create index country_id_idx on country using hash (country_id);
CREATE
# vacuum analyze;
VACUUM
# explain select city.name, country.name from country, city
where city.country_id = country.country_id;
NOTICE:  QUERY PLAN:
Hash Join  (cost=8.85..16.76 rows=75 width=18) ->  Seq Scan on city  (cost=0.00..1.75 rows=75 width=16) ->  Hash
(cost=5.53..5.53rows=253 width=2)       ->  Seq Scan on country  (cost=0.00..5.53 rows=253 width=2)
 
EXPLAIN
======================================================================

Why doesn't PostgreSQL use country_id_idx, but rather rehashing 
country_id?


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

Предыдущее
От: Andrés Mauricio Marín Restrepo
Дата:
Сообщение: HI! Problems with cursors into triggers
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Problem with pg_dumpall