Re: Optimization recommendations request

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Joe Conway" <joe(at)conway-family(dot)com>
Cc: "PostgreSQL-SQL" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Optimization recommendations request
Date: 2000-12-29 23:49:31
Message-ID: 7778.978133771@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Joe Conway" <joe(at)conway-family(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Thomas SMETS 2000-12-30 00:34:10 Re: Looking for comments
Previous Message Joe Conway 2000-12-29 23:39:35 Re: Optimization recommendations request