Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id A88172E0046 for ; Wed, 21 May 2008 13:12:04 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 98093-08 for ; Wed, 21 May 2008 13:12:00 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from 30.mail-out.ovh.net (30.mail-out.ovh.net [213.186.62.213]) by developer.postgresql.org (Postfix) with SMTP id 09A742E002C for ; Wed, 21 May 2008 13:12:00 -0300 (ADT) Received: (qmail 12018 invoked by uid 503); 21 May 2008 16:12:20 -0000 Received: from unknown (HELO mail243.ha.ovh.net) (213.186.33.59) by 30.mail-out.ovh.net with SMTP; 21 May 2008 16:12:20 -0000 Received: from b0.ovh.net (HELO queue-out) (213.186.33.50) by b0.ovh.net with SMTP; 21 May 2008 16:11:54 -0000 Received: from par69-8-88-161-102-87.fbx.proxad.net (HELO apollo13.peufeu.com) (88.161.102.87) by ns0.ovh.net with SMTP; 21 May 2008 16:11:53 -0000 Date: Wed, 21 May 2008 18:18:27 +0200 To: "Richard Huxton" , "Luke Lonergan" Subject: Re: Posible planner improvement? From: PFC Cc: albert@sedifa.com, pgsql-performance@postgresql.org Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <014F2941B0A1EA47BD61D21526B806E90162C3D2@MI8NYCMAIL08.Mi8.com> <48341F1D.3090304@archonet.com> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <48341F1D.3090304@archonet.com> User-Agent: Opera Mail/9.24 (Linux) X-Ovh-Tracer-Id: 5313966087121405473 X-Ovh-Remote: 88.161.102.87 (par69-8-88-161-102-87.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|H 0.5/N X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.647 tagged_above=0 required=5 tests=AWL=0.647 X-Spam-Level: X-Archive-Number: 200805/297 X-Sequence-Number: 30265 On Wed, 21 May 2008 15:09:49 +0200, Richard Huxton wrote: > Luke Lonergan wrote: >> The problem is that the implied join predicate is not being >> propagated. This is definitely a planner deficiency. > > IIRC only equality conditions are propagated and gt, lt, between aren't. > I seem to remember that the argument given was that the cost of > checking for the ability to propagate was too high for the frequency > when it ocurred. > > Of course, what was true for code and machines of 5 years ago might not > be so today. > Suggestion : when executing a one-off sql statement, optimizer should try to offer "best effort while being fast" ; when making a plan that will be reused many times (ie PREPARE, functions...) planning time could be muuuuch longer...