Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id F1709650179 for ; Wed, 6 Aug 2008 19:25:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 17212-05 for ; Wed, 6 Aug 2008 19:25:24 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail128065.authsmtp.net (outmail128065.authsmtp.net [62.13.128.65]) by postgresql.org (Postfix) with ESMTP id 91981650174 for ; Wed, 6 Aug 2008 19:25:27 -0300 (ADT) Received: from mail-c187.authsmtp.com (mail-c187.authsmtp.com [62.13.128.33]) by punt4.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m76MP3eC079217; Wed, 6 Aug 2008 23:25:03 +0100 (BST) Received: from [192.168.0.3] (85-211-19-153.dyn.gotadsl.co.uk [85.211.19.153]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m76MOsZd040900; Wed, 6 Aug 2008 23:24:55 +0100 (BST) Subject: Re: WIP: Transportable Optimizer Mode From: Simon Riggs To: chris Cc: pgsql-patches@postgresql.org In-Reply-To: <1217704370.3934.132.camel@ebony.t-mobile.de.> References: <1217023107.3894.1053.camel@ebony.2ndQuadrant> <87myjzp5as.fsf@dba2.int.libertyrms.com> <1217704370.3934.132.camel@ebony.t-mobile.de.> Content-Type: text/plain Date: Wed, 06 Aug 2008 23:32:02 +0100 Message-Id: <1218061922.4549.296.camel@ebony.2ndQuadrant> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit X-Server-Quench: 7eddef9a-6406-11dd-8155-001185d377ca X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksadBtFaANbbExW HGQLW1xEUl57W2d/ bg8fZQBDYEtPQQRj TklMQU1QEQdtHhxP WxkYL2YxHVFGfH55 ZUYsX3ZTVAp9IBIp FxhdRHAAYWdmdWEe BBRFfwJRdR5Kfh5E YlUrV3QKMjRJBC9q VzwLFgwaHRhkHWxq YzlfZW4ISEAQBjkm WxkIGThnOlUZRiAy PRE8YnsbEEt5 X-Authentic-SMTP: 61633235383639.squirrel.dmpriest.net.uk:1186/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system! X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200808/12 X-Sequence-Number: 6988 On Sat, 2008-08-02 at 20:12 +0100, Simon Riggs wrote: > Chris, > > Thanks for all of those changes... added as suggested (in next version) > > On Wed, 2008-07-30 at 14:58 -0400, chris wrote: > > > It's not clear to me that the plugin is actually working. > > > > When I run EXPLAIN against tables in "tomtestdb", I get results > > consistent with an unanalyzed table. So possibly the "hook" isn't > > being used. Perhaps I'm using it wrongly; perhaps what I have > > documented above may suggest to you what's broken. > > The plugin works, but it currently extracts 0 for number of tuples. So > you need to override that to give a different answer. > > I was going to add an SQL function to estimate the number of tuples in > the same way as the optimizer does. That way we get the same answer from > the EXPLAIN as we would have got on the main server and we don't need to > run select count(*) against each table (unless we want to). New version submitted together with stats hook patch on other thread. -- Simon Riggs www.2ndQuadrant.com PostgreSQL Training, Services and Support