Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 1844A9FA524 for ; Fri, 28 Sep 2007 05:12:19 -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 62907-01-3 for ; Fri, 28 Sep 2007 05:12:16 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail3.ecircle.de (mail3.ecircle.de [195.140.186.206]) by postgresql.org (Postfix) with ESMTP id 4A31A9FA46E for ; Fri, 28 Sep 2007 05:12:16 -0300 (ADT) Received: from einstein.muc.ecircle.de (einstein.muc.ecircle.de [192.168.1.7]) by mail3.ecircle.de (READY) with ESMTP id 858D511C0C2; Fri, 28 Sep 2007 10:12:14 +0200 (CEST) Received: from [192.168.1.91] ([192.168.1.91]) by einstein.muc.ecircle.de with Microsoft SMTPSVC(6.0.3790.1830); Fri, 28 Sep 2007 10:11:58 +0200 Subject: Re: Searching for the cause of a bad plan From: Csaba Nagy To: Ron Mayer Cc: postgres performance list In-Reply-To: <46FBF174.1020206@cheapcomplexdevices.com> References: <1190369024.4661.173.camel@PCD12478> <6175.1190390913@sss.pgh.pa.us> <1190396352.4202.109.camel@ebony.site> <13644.1190397220@sss.pgh.pa.us> <1190399879.4202.127.camel@ebony.site> <27857.1190417434@sss.pgh.pa.us> <1190640429.4181.165.camel@ebony.site> <1190818357.5430.29.camel@PCD12478> <21582.1190820137@sss.pgh.pa.us> <1190894004.5430.46.camel@PCD12478> <29186.1190904025@sss.pgh.pa.us> <1190906166.5430.76.camel@PCD12478> <46FBF174.1020206@cheapcomplexdevices.com> Content-Type: text/plain Date: Fri, 28 Sep 2007 10:12:10 +0200 Message-Id: <1190967130.5430.85.camel@PCD12478> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 28 Sep 2007 08:11:58.0514 (UTC) FILETIME=[3DA04920:01C801A7] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/463 X-Sequence-Number: 27008 On Thu, 2007-09-27 at 11:07 -0700, Ron Mayer wrote: > Csaba Nagy wrote: > > > > Well, my problem was actually solved by rising the statistics target, > > Would it do more benefit than harm if postgres increased the > default_statistics_target? > > I see a fair number of people (myself included) asking questions who's > resolution was to ALTER TABLE SET STATISTICS; and I think relatively > fewer (if any?) people concerned about space in pg_statistic > or people improving analyze time by reducing the statistics target. Well, the cost of raising the statistics target is far from zero: with all defaults the analyze time was ~ 10 seconds, with one column set to 100 was ~ 1.5 minutes, with one column set to 1000 was 15 minutes for the table in question (few 100M rows). Of course the IO load must have been proportional to the timings... so I'm pretty sure the current default is serving well most of the situations. Cheers, Csaba.