Thanks to visit codestin.com
Credit goes to postgrespro.com

Re: Optimization recommendations request - Mailing list pgsql-sql

From Tom Lane
Subject Re: Optimization recommendations request
Date
Msg-id [email protected]
Whole thread Raw
In response to Optimization recommendations request  ("Joe Conway" <[email protected]>)
List pgsql-sql
"Joe Conway" <[email protected]> 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 -(((