Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 995E99FB6F2 for ; Thu, 10 May 2007 12:35:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 07831-05 for ; Thu, 10 May 2007 12:35:11 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from gauss.credativ.com (ipx11302.ipxserver.de [212.112.227.254]) by postgresql.org (Postfix) with ESMTP id D740D9FB422 for ; Thu, 10 May 2007 12:35:11 -0300 (ADT) Received: from hawking.credativ.lan (unknown [87.139.82.80]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by gauss.credativ.com (Postfix) with ESMTP id 96DA2D782D; Thu, 10 May 2007 17:35:07 +0200 (CEST) From: Peter Eisentraut To: Tom Lane Subject: Re: Nested loops overpriced Date: Thu, 10 May 2007 17:35:06 +0200 User-Agent: KMail/1.9.5 Cc: pgsql-performance@postgresql.org References: <200705081722.16731.peter_e@gmx.net> <200705091817.45056.peter_e@gmx.net> <28620.1178732406@sss.pgh.pa.us> In-Reply-To: <28620.1178732406@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200705101735.06509.peter_e@gmx.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/228 X-Sequence-Number: 24618 Am Mittwoch, 9. Mai 2007 19:40 schrieb Tom Lane: > Hmmm ... I see at least part of the problem, which is that email_header > is joined twice in this query, which means that it's counted twice in > figuring the total volume of pages competing for cache space.  So the > thing thinks cache space is oversubscribed nearly 3X when in reality > the database is fully cached. I should add that other, similar queries in this database that do not involve joining the same table twice produce seemingly optimal plans. (It picks hash joins which are actually faster than nested loops.) -- Peter Eisentraut http://developer.postgresql.org/~petere/