Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id D2E419FB453 for ; Thu, 10 May 2007 12:30:32 -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 06810-04 for ; Thu, 10 May 2007 12:30:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from gauss.credativ.com (ipx11302.ipxserver.de [212.112.227.254]) by postgresql.org (Postfix) with ESMTP id 89E0F9FB836 for ; Thu, 10 May 2007 12:30:31 -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 67724D78EF; Thu, 10 May 2007 17:30:28 +0200 (CEST) From: Peter Eisentraut To: Tom Lane Subject: Re: Nested loops overpriced Date: Thu, 10 May 2007 17:30:22 +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: 7bit Content-Disposition: inline Message-Id: <200705101730.22883.peter_e@gmx.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/227 X-Sequence-Number: 24617 Am Mittwoch, 9. Mai 2007 19:40 schrieb Tom Lane: > I remember having dithered about whether > to try to avoid counting the same physical relation more than once in > total_table_pages, but this example certainly suggests that we > shouldn't. Meanwhile, do the estimates get better if you set > effective_cache_size to 1GB or so? Yes, that makes the plan significantly cheaper (something like 500,000 instead of 5,000,000), but still a lot more expensive than the hash join (about 100,000). > To return to your original comment: if you're trying to model a > situation with a fully cached database, I think it's sensible > to set random_page_cost = seq_page_cost = 0.1 or so. You had > mentioned having to decrease them to 0.02, which seems unreasonably > small to me too, but maybe with the larger effective_cache_size > you won't have to go that far. Heh, when I decrease these parameters, the hash join gets cheaper as well. I can't actually get it to pick the nested-loop join. -- Peter Eisentraut http://developer.postgresql.org/~petere/