Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id B208D9F9BE5 for ; Fri, 28 Sep 2007 09:33:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 04524-09 for ; Fri, 28 Sep 2007 09:33:46 -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 B40779F99D1 for ; Fri, 28 Sep 2007 09:33:51 -0300 (ADT) Received: from einstein.muc.ecircle.de (einstein.muc.ecircle.de [192.168.1.7]) by mail3.ecircle.de (READY) with ESMTP id 8E27511C09C; Fri, 28 Sep 2007 14:33:49 +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 14:33:40 +0200 Subject: Re: Searching for the cause of a bad plan From: Csaba Nagy To: Kenneth Marshall Cc: Ron Mayer , postgres performance list In-Reply-To: <20070928122556.GH14440@it.is.rice.edu> References: <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> <1190967130.5430.85.camel@PCD12478> <20070928122556.GH14440@it.is.rice.edu> Content-Type: text/plain Date: Fri, 28 Sep 2007 14:33:52 +0200 Message-Id: <1190982832.5430.94.camel@PCD12478> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 28 Sep 2007 12:33:40.0375 (UTC) FILETIME=[CCAA2270:01C801CB] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/464 X-Sequence-Number: 27009 > Just an idea, but with the 8.3 concurrent scan support would it be > possible to hang a more in depth analyze over exisiting sequential > scans. Then it would be a lower cost to have higher resolution in > the statistics because the I/O component would be hidden. The biggest problem with that is that it wouldn't be deterministic... the table in question from my original post is never scanned sequentially in normal operation. The other way around is also possible, when sequential scans are too frequent, in that case you wouldn't want to also analyze all the time. So there would be a need for logic of when to analyze or not with a sequential scan and when do it proactively without waiting for one... and I'm not sure it will be worth the complexity. I think it would me much more productive if some "long running query" tracking combined with a "background planner" thread would do targeted analyzes for specific correlations/distributions/conditions based on what queries are actually running on the system. Cheers, Csaba.