Re: HashAggregate slower than sort?

От: Kevin Grittner
Тема: Re: HashAggregate slower than sort?
Дата: ,
Msg-id: 4C1F289802000025000326B6@gw.wicourts.gov
(см: обсуждение, исходный текст)
Ответ на: Re: HashAggregate slower than sort?  ("Jatinder Sangha")
Список: pgsql-performance

Скрыть дерево обсуждения

HashAggregate slower than sort?  ("Jatinder Sangha", )
 Re: HashAggregate slower than sort?  ("Kevin Grittner", )
 Re: HashAggregate slower than sort?  ("Jatinder Sangha", )
  Re: HashAggregate slower than sort?  ("Kevin Grittner", )

"Jatinder Sangha" <> wrote:

> I've already converted all of my SQL to use "distinct on (...)"
> and this is now always faster using the hash-aggregates than when
> using sorting.  The queries now only use sorting if the hashing
> would take up too much memory.

It's great that you have a solution to your immediate problem, but
if the active portion of your database is really as fully cached as
your problem case indicates, you should probably still tweak the
costing factors.  Doing so will help the optimizer pick good plans
for any arbitrary query you choose to run.  If the caching was
unusual, and was just showing up because were repeatedly running
that one test case, then never mind.  :-)

-Kevin


В списке pgsql-performance по дате сообщения:

От: Scott Marlowe
Дата:
Сообщение: Re: mysql to postgresql, performance questions
От: Craig Ringer
Дата:
Сообщение: Re: Low perfomance SUM and Group by large databse