Re: Optimization recommendations request - Mailing list pgsql-sql

From Tom Lane
Subject Re: Optimization recommendations request
Date
Msg-id 7778.978133771@sss.pgh.pa.us
Whole thread Raw
In response to Optimization recommendations request  ("Joe Conway" <joe@conway-family.com>)
List pgsql-sql
"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


pgsql-sql by date:

Previous
From: "Joe Conway"
Date:
Subject: Re: Optimization recommendations request
Next
From: Boris
Date:
Subject: Date/Time problem -(((