From: Ang Chin Han <angch@pintoo.com>
To: pgsql-sql@postgresql.org
Subject: Hash Join not using hashed index?
Date: Wed, 28 Jun 2000 13:24:11 +0800
Message-ID: <20000628132411.B29825@pollcities.com> (raw)
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.53 rows=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.53 rows=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?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: angch@pintoo.com
Subject: Re: Hash Join not using hashed index?
In-Reply-To: <20000628132411.B29825@pollcities.com>
References: <20000628132411.B29825@pollcities.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox