Unix Technical Forum

Re:

This is a discussion on Re: within the Pgsql Performance forums, part of the PostgreSQL category; --> * Tyrrill, Ed (tyrrill_ed@emc.com) wrote: > Based on all this we will be going with 8.2.4.1, but it seems ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Performance

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 10:07 AM
Stephen Frost
 
Posts: n/a
Default Re:

* Tyrrill, Ed (tyrrill_ed@emc.com) wrote:
> Based on all this we will be going with 8.2.4.1, 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.

Enjoy,

Stephen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGgDomrzgMPqB3kigRAhyYAKCFZKXqJlt4rRSVUwknk0 IaFAByxACcCj0S
QQtrIiR0BQq9QcjhMsPo8Uo=
=r0Mu
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 10:07 AM
Ed Tyrrill
 
Posts: n/a
Default Re:

On Mon, 2007-06-25 at 17:56 -0400, Stephen Frost wrote:
> 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.
>
> Enjoy,
>
> Stephen


Yes, work_mem was set to 128MB for all runs. All settings were the same
except for the change to default_statistics_target. I'm certainly
memory constrained, but giving 2GB to one one session doesn't allow
other sessions to do anything. Possibly when we upgrade to 16GB. :-)




---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 10:07 AM
Stephen Frost
 
Posts: n/a
Default Re:

* Ed Tyrrill (tyrrill_ed@emc.com) wrote:
> Yes, work_mem was set to 128MB for all runs. All settings were the same
> except for the change to default_statistics_target. I'm certainly
> memory constrained, but giving 2GB to one one session doesn't allow
> other sessions to do anything. Possibly when we upgrade to 16GB. :-)


You might consider a smaller increase, say to 256MB, to see if that'll
switch it to a hash join (and then watch the *actual* memory usage, of
course), if you're looking for performance for this query at least.

Yeah, 2GB is what I typically run on our data warehouse box, which is a
nice dual-proc/dual-core DL385 w/ 16GB of ram. The annoying thing is
that I can still run it out of memory sometimes, even w/ 16GB. :/

Thanks,

Stephen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGgFUprzgMPqB3kigRAvmLAJ98vNbgO8VZc0HYnz6ptx BCiOxf5ACfS1q1
vr3/uF/sudWq23MnhDk7aQM=
=I9Mj
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:21 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com