Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id E78C99FBC3D for ; Mon, 25 Jun 2007 18:58:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 53999-02-6 for ; Mon, 25 Jun 2007 18:58:21 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from tamriel.snowman.net (tamriel.snowman.net [72.66.115.51]) by postgresql.org (Postfix) with ESMTP id 880229FBD5F for ; Mon, 25 Jun 2007 18:56:55 -0300 (ADT) Received: by tamriel.snowman.net (Postfix, from userid 1000) id 4490584283; Mon, 25 Jun 2007 17:56:54 -0400 (EDT) Date: Mon, 25 Jun 2007 17:56:54 -0400 From: Stephen Frost To: "Tyrrill, Ed" Cc: pgsql-performance@postgresql.org Subject: Re: Message-ID: <20070625215654.GF7531@tamriel.snowman.net> Mail-Followup-To: "Tyrrill, Ed" , pgsql-performance@postgresql.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IsIRZ4DwzP0DcleK" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/2.6.18-4-vserver-amd64 (x86_64) X-Uptime: 17:51:04 up 49 days, 18:04, 22 users, load average: 0.03, 0.10, 0.08 User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/587 X-Sequence-Number: 25620 --IsIRZ4DwzP0DcleK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * 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 =3D '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 =66rom the statistics on how frequently something shows up, etc. Enjoy, Stephen --IsIRZ4DwzP0DcleK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFGgDomrzgMPqB3kigRAhyYAKCFZKXqJlt4rRSVUwknk0IaFAByxACcCj0S QQtrIiR0BQq9QcjhMsPo8Uo= =r0Mu -----END PGP SIGNATURE----- --IsIRZ4DwzP0DcleK--