Skip site navigation (1) Skip section navigation (2)


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: "Tyrrill, Ed" <tyrrill_ed(at)emc(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re:
Date: 2007-06-25 21:56:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
* Tyrrill, Ed (tyrrill_ed(at)emc(dot)com) wrote:
> Based on all this we will be going with, but it seems like
> currently the query planner isn't choosing the best plan for this case.

Was the 'work_mem' set to the same thing on all these runs?  Also, you
might try increasing the 'work_mem' under 8.2.4, at least for this query
(you can set it by just doing: set work_mem = '2GB'; or similar in psql,
or you can change the default in postgresql.conf).

The big thing of note, it seems, is that you've got enough memory and
it's coming out faster when doing a hash-join vs. a sort + merge-join.
Could likely be because it doesn't think there's enough work memory
available for the hash, which might change based on the values it gets
from the statistics on how frequently something shows up, etc.



In response to

  • at 2007-06-25 21:28:32 from Tyrrill, Ed


  • Re: at 2007-06-25 23:39:02 from Ed Tyrrill

pgsql-performance by date

Next:From: Tom LaneDate: 2007-06-25 22:10:15
Subject: Re:
Previous:From: Tyrrill, EdDate: 2007-06-25 21:48:55
Subject: Non-optimal query plan with 8.2

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group