From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joe Conway <joe@conway-family.com>
Cc: PostgreSQL-SQL <pgsql-sql@postgresql.org>
Subject: Re: Optimization recommendations request
Date: Fri, 29 Dec 2000 18:49:31 -0500
Message-ID: <7778.978133771@sss.pgh.pa.us> (raw)
In-Reply-To: <018601c06d02$d007ace0$0705a8c0@jecw2k1>
References: <Pine.BSF.4.21.0012210905420.86012-100000@megazone23.bigpanda.com>
<018601c06d02$d007ace0$0705a8c0@jecw2k1>
"Joe Conway" <joe@conway-family.com> writes:
> create index foo_idx1 on foo using HASH (guid);
> SELECT ks FROM foo WHERE guid = 'f9ee1930f4010ba34cc5ca6efd27d988eb4f921d';
> The query currently takes in excess of 40 seconds. I would appreciate any
> suggestions for optimizing to bring this down substantially.
Why are you using a hash index? btree is a lot better for every
conceivable purpose.
It would also be a good idea to check to make sure that the query is
using the index (see EXPLAIN). You didn't mention whether you'd done
a VACUUM ANALYZE, so there's a risk the planner will make the wrong
choice.
regards, tom lane
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: tgl@sss.pgh.pa.us, joe@conway-family.com
Subject: Re: Optimization recommendations request
In-Reply-To: <7778.978133771@sss.pgh.pa.us>
References: <Pine.BSF.4.21.0012210905420.86012-100000@megazone23.bigpanda.com> <018601c06d02$d007ace0$0705a8c0@jecw2k1> <7778.978133771@sss.pgh.pa.us>
* 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