Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 659AC2E30C7 for ; Wed, 6 Feb 2008 06:07:03 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 45918-04 for ; Wed, 6 Feb 2008 06:06:47 -0400 (AST) Received: from ptb-relay02.plus.net (ptb-relay02.plus.net [212.159.14.213]) by postgresql.org (Postfix) with ESMTP id E0EA22E2E5B for ; Wed, 6 Feb 2008 06:06:51 -0400 (AST) Received: from [84.51.143.99] (helo=server3.office.archonet.com) by ptb-relay02.plus.net with esmtp (Exim) id 1JMhB1-0005j4-Ui; Wed, 06 Feb 2008 10:06:48 +0000 Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id B0423274061; Wed, 6 Feb 2008 10:06:47 +0000 (GMT) Message-ID: <47A986B7.3000809@archonet.com> Date: Wed, 06 Feb 2008 10:06:47 +0000 From: Richard Huxton User-Agent: Thunderbird 2.0.0.9 (X11/20071031) MIME-Version: 1.0 To: =?UTF-7?B?U1VSQU5UWU4gSmVhbiBGcmFuK0FPYy1vaXM=?= CC: pgsql-performance@postgresql.org Subject: Re: Optimizer : query rewrite and execution plan ? References: <60F4687513E90748AE8933DEA5D054E79ACBE5@SLAM0018.match-supermarket.com> In-Reply-To: <60F4687513E90748AE8933DEA5D054E79ACBE5@SLAM0018.match-supermarket.com> Content-Type: text/plain; charset=UTF-7 Content-Transfer-Encoding: quoted-printable X-Plusnet-Relay: 5fcdf71963dd868d30fae650b4cd3e74 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/61 X-Sequence-Number: 28603 SURANTYN Jean Fran+AOc-ois wrote: > Many thanks for your quick reply >=20 > In fact, that issue comes from a recent migration from Oracle to > Postgresql, and even if some queries were not optimized by the past > (example: where n=3D1 and n=3D1), Oracle was able to rewrite them and t= o > "hide" the bad queries". But now that we have migrated to Postgresql, > we have discovered that some queries were indeed badly wroten I will > tell to the developpers to try to optimize their queries for them to > work efficiently on Postgresql If nothing else it will help when / if you decide to use prepared queries - there's no way to optimise "n=3D+ACQ-1 or n=3D+ACQ-2" at planni= ng time. --=20 Richard Huxton Archonet Ltd