Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 65807633715 for ; Mon, 23 Mar 2009 11:21:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 20235-09-2 for ; Mon, 23 Mar 2009 11:20:53 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gwmta.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 6573E633708 for ; Mon, 23 Mar 2009 11:20:58 -0300 (ADT) Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Mon, 23 Mar 2009 09:20:56 -0500 Message-Id: <49C75467.EE98.0025.0@wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 7.0.3 Date: Mon, 23 Mar 2009 09:20:39 -0500 From: "Kevin Grittner" To: "Romuald Brunet" , Subject: Re: Slower query after psql changed it's execution plan References: <8ae589230903230652n294f456dn6e3ec7a39bb4c0aa@mail.gmail.com> In-Reply-To: <8ae589230903230652n294f456dn6e3ec7a39bb4c0aa@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200903/327 X-Sequence-Number: 33249 Romuald Brunet wrote: > The statistics are at the default value everywhere (10) Try setting that to 100 and running ANALYZE. The small size of the sample with the default of 10 happened to land you with a bad estimate this time. (If the numbers it has were actually representative of the data, the plan it's using would be reasonable.) -Kevin