[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pgsql-performance
Subject:    Re: [PERFORM] HashAggregate slower than sort?
From:       "Kevin Grittner" <Kevin.Grittner () wicourts ! gov>
Date:       2010-06-21 13:53:44
Message-ID: 4C1F289802000025000326B6 () gw ! wicourts ! gov
[Download RAW message or body]

"Jatinder Sangha" <js@coalition.com> 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

-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic