Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id B6C789FA35D for ; Sun, 28 Oct 2007 06:15:42 -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 22071-08 for ; Sun, 28 Oct 2007 06:15:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from outmail136061.authsmtp.co.uk (outmail136061.authsmtp.co.uk [62.13.136.61]) by postgresql.org (Postfix) with ESMTP id B3BA49FA443 for ; Sun, 28 Oct 2007 06:15:31 -0300 (ADT) Received: from outmail128176.authsmtp.co.uk (outmail128176.authsmtp.co.uk [62.13.128.176]) by punt2.authsmtp.com (8.13.8/8.13.8/Kp) with ESMTP id l9S9FOKw038859; Sun, 28 Oct 2007 09:15:25 GMT Received: from [192.168.0.3] (62-3-250-177.dyn.gotadsl.co.uk [62.3.250.177]) (authenticated bits=0) by mail.authsmtp.com (8.13.8/8.13.8/Kp) with ESMTP id l9S9FMpC052077; Sun, 28 Oct 2007 09:15:22 GMT Subject: Re: partitioned table and ORDER BY indexed_field DESCLIMIT 1 From: Simon Riggs To: Luke Lonergan Cc: Heikki Linnakangas , Anton , pgsql-performance@postgresql.org In-Reply-To: References: Content-Type: text/plain Date: Sun, 28 Oct 2007 09:13:53 +0000 Message-Id: <1193562833.4242.670.camel@ebony.site> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2 Content-Transfer-Encoding: 7bit X-Server-Quench: 4fd32b15-8536-11dc-b86a-001185d377ca X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksachtFag1bYlpF HGQLW1NEUFR7WGZ/ aQgfawdDYVRMWgV0 UU9OXVBXCwUmXRVi D2hjEmpycgdGf3k+ ZEVlXj5fChB5dxR8 R1NcEG4AeGZhPDMC AkheJh5UcAJLdhoR aVd4ByJDAzANdhEA MjUdGAoUCH1HIT5J Qx0MKlQfTQ4XFzQ4 SlgLGzlnOncpah97 BS1uK1gQEVYcPnI8 MFYlVTB5HzIpISl/ OmBxSHYx X-Authentic-SMTP: 61633235383639.squirrel.dmpriest.net.uk:752/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.085 tagged_above=0 required=5 tests=AWL=-0.072, BAYES_50=0.001, SUBJECT_FUZZY_TION=0.156 X-Spam-Level: X-Archive-Number: 200710/329 X-Sequence-Number: 27351 On Sat, 2007-10-27 at 17:48 -0400, Luke Lonergan wrote: > Works great - plans no longer sort, but rather use indices as > expected. It's in use in Greenplum now. > > It's a simple approach, should easily extend from gpdb to postgres. > The patch is against gpdb so someone needs to 'port' it. The part of the patch that didn't work for me was the nrels==1 bit. The way it currently works there is only ever 0 or 2+ rels. The normal Postgres code has to cater for the possibility of a non-empty parent table, which seems to destroy the possibility of using this technique. I agree its annoying and I have a way of doing this, but that's an 8.4 thing now. Anybody think different? -- Simon Riggs 2ndQuadrant http://www.2ndQuadrant.com