Re: Optimization recommendations request

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Optimization recommendations request
Дата
Msg-id 7778.978133771@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Optimization recommendations request  ("Joe Conway" <joe@conway-family.com>)
Список 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 по дате отправления:

Предыдущее
От: "Joe Conway"
Дата:
Сообщение: Re: Optimization recommendations request
Следующее
От: Boris
Дата:
Сообщение: Date/Time problem -(((