Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 7AA9E6338E2 for ; Fri, 22 May 2009 07:37:08 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 91976-02 for ; Fri, 22 May 2009 07:37:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail128148.authsmtp.net (outmail128148.authsmtp.net [62.13.128.148]) by mail.postgresql.org (Postfix) with ESMTP id 2B5B8633239 for ; Fri, 22 May 2009 07:37:06 -0300 (ADT) Received: from mail-c189.authsmtp.com (mail-c189.authsmtp.com [62.13.128.71]) by punt5.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n4MAb3IX012737; Fri, 22 May 2009 11:37:03 +0100 (BST) Received: from [192.168.0.2] (85-211-225-42.dyn.gotadsl.co.uk [85.211.225.42]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n4MAb2QH051200; Fri, 22 May 2009 11:37:02 +0100 (BST) Subject: Re: Make the planner smarter about idiosyncratic (or broken) ORM behaviour From: Simon Riggs To: Frank =?ISO-8859-1?Q?J=F6rdens?= Cc: pgsql-sql@postgresql.org, Nic Ferrier , Edward George , Seb Potter , Hannu Krosing In-Reply-To: <7d10d2df0905220233v3e54ab34lb9c3530fe3543a5c@mail.gmail.com> References: <7d10d2df0905220233v3e54ab34lb9c3530fe3543a5c@mail.gmail.com> Content-Type: text/plain; charset=utf-8 Date: Fri, 22 May 2009 11:40:03 +0100 Message-Id: <1242988803.27960.382.camel@ebony.2ndQuadrant> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 8bit X-Server-Quench: 7d17e806-46bc-11de-bc7b-001f29070be2 X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksacBtFagdbYFhI HGQLW11EUVx7WmR/ awkfZQBDYEtPQQdo VVZNQE1QEQdtHhxP WBpjI0twFn1GfX9y ZUYsX3RYXAp9IUd6 F0ZUE3ACYzUzdWEe BBVFJVBTIh5Kfh4T aFl/U3NfNGdJBC9q VzwIBhQEdRBWKykd XgEAZUoWSEANEyR0 XBULBykiBwUMTSIu M1QnJl8bB1cXOV87 LVoqERIfKVcYEApd EkcMYk5+HXxJTScr BB1bWlMEeCAp X-Authentic-SMTP: 61633235383639.kestrel.dmpriest.net.uk:1562/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse 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: 200905/91 X-Sequence-Number: 32583 On Fri, 2009-05-22 at 10:33 +0100, Frank Jördens wrote: > Almost all of the 8k queries per second that are hitting our database > are generated by a web development framework's ORM (Django), and some > of the syntax there is quite mad. Possibly the worst tic exhibited by > the translation layer is that if you filter a query on an object by > more than one property on a related object it will create a join for > each property: It's a known issue that we're looking to work on in the next release. Work started in 8.4, though was more complex than first appeared and we didn't complete it in time for the dev deadline. -- Simon Riggs www.2ndQuadrant.com PostgreSQL Training, Services and Support