Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 8067D1337B4D for ; Thu, 16 Sep 2010 11:13:24 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 52083-05 for ; Thu, 16 Sep 2010 14:13:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp19.orange.fr (smtp19.orange.fr [80.12.242.17]) by mail.postgresql.org (Postfix) with ESMTP id 27B851337E54 for ; Thu, 16 Sep 2010 11:13:09 -0300 (ADT) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1908.orange.fr (SMTP Server) with ESMTP id C33A61C00558 for ; Thu, 16 Sep 2010 16:13:08 +0200 (CEST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1908.orange.fr (SMTP Server) with ESMTP id B0F4F1C006A3 for ; Thu, 16 Sep 2010 16:13:08 +0200 (CEST) Received: from axege.com (LNeuilly-152-22-23-133.w193-251.abo.wanadoo.fr [193.251.23.133]) by mwinf1908.orange.fr (SMTP Server) with ESMTP id 7EED41C00558 for ; Thu, 16 Sep 2010 16:13:08 +0200 (CEST) X-ME-UUID: 20100916141308521.7EED41C00558@mwinf1908.orange.fr Received: from localhost (localhost [127.0.0.1]) by axege.com (Postfix) with ESMTP id 26DBE4FDA6 for ; Thu, 16 Sep 2010 16:13:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at myhostname="axege.com." Received: from axege.com ([127.0.0.1]) by localhost (axege.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jqBsTCZiaTHE for ; Thu, 16 Sep 2010 16:13:06 +0200 (CEST) Received: from [10.0.0.69] (unknown [10.0.0.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by axege.com (Postfix) with ESMTPSA id C6D34445E09 for ; Thu, 16 Sep 2010 16:13:06 +0200 (CEST) Subject: Re: Is disableing nested_loops a bad idea ? From: Franck Routier To: pgsql-performance In-Reply-To: <4C91DA360200002500035839@gw.wicourts.gov> References: <1284625427.2527.13.camel@franck-laptop> <4C91DA360200002500035839@gw.wicourts.gov> Content-Type: text/plain; charset="UTF-8" Organization: =?ISO-8859-1?Q?Ax=E8ge?= sarl Date: Thu, 16 Sep 2010 16:13:06 +0200 Message-ID: <1284646386.7884.8.camel@franck-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201009/102 X-Sequence-Number: 40305 Thanks Kevin and Samuel for your input. The point is we already made a lot of tweaking to try to tune postgresql to behave correctly. I work with Damien, and here is a post he did in july to explain the kind of problems we have http://comments.gmane.org/gmane.comp.db.postgresql.performance/25745 The end of the thread was Robert Hass concluding that "Disabling nestloops altogether, even for one particular query, is often going to be a sledgehammer where you need a scalpel. But then again, a sledgehammer is better than no hammer." So I wanted to better understand to what extend using a sledgehammer will impact me :-) Franck Le jeudi 16 septembre 2010 à 08:49 -0500, Kevin Grittner a écrit : > Franck Routier wrote: > > > I come into cases where the planner under-estimates the number of > > rows in some relations, chooses to go for nested loops, and takes > > forever to complete the request. > > People can provide more targeted assistance if you pick one of the > offenders and provide enough information for a thorough analysis. > It's at least somewhat likely that some tweaks to your configuration > or maintenance procedures could help all the queries, but starting > with just one is likely to highlight what those changes might be. > > For ideas on what information to include, see this page: > > http://wiki.postgresql.org/wiki/SlowQueryQuestions > > -Kevin >