Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 06AB163381D for ; Thu, 5 Nov 2009 01:47:37 -0400 (AST) 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 80050-07 for ; Thu, 5 Nov 2009 05:47:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from EXHUB018-3.exch018.msoutlookonline.net (exhub018-3.exch018.msoutlookonline.net [64.78.17.18]) by mail.postgresql.org (Postfix) with ESMTP id 0DE4F6331C2 for ; Thu, 5 Nov 2009 01:47:28 -0400 (AST) Received: from EXVMBX018-1.exch018.msoutlookonline.net ([64.78.17.47]) by EXHUB018-3.exch018.msoutlookonline.net ([64.78.17.18]) with mapi; Wed, 4 Nov 2009 21:47:26 -0800 From: Scott Carey To: David Kerr , Chris CC: Craig Ringer , "pgsql-performance@postgresql.org" Date: Wed, 4 Nov 2009 21:47:01 -0800 Subject: Re: Optimizer + bind variables Thread-Topic: [PERFORM] Optimizer + bind variables Thread-Index: Acpc5F+HMPmMNBq6QJeKF9FxyMxfmQA9wWi5 Message-ID: In-Reply-To: <20091104001825.GA79191@mr-paradox.net> Accept-Language: en-US Content-Language: en X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200911/58 X-Sequence-Number: 36226 On 11/3/09 4:18 PM, "David Kerr" wrote: > On Wed, Nov 04, 2009 at 11:02:22AM +1100, Chris wrote: > - David Kerr wrote: > - >On Wed, Nov 04, 2009 at 07:43:16AM +0800, Craig Ringer wrote: > - >- David Kerr wrote: > - No. > - > - This is explained in the notes here: > - > - http://www.postgresql.org/docs/current/static/sql-prepare.html >=20 > and i've read that before too. >=20 > On the upside, then it behaves like I would expect it to, which is > good. >=20 > Thanks >=20 > Dave Note that the query plan can often be the same for the example here. It depends on whether the knowledge of the exact value makes a difference. The most common case is an identifier column. If the column is unique and indexed, and the parameter is an exact =3D matc= h in the where clause to that column, the plans won't differ. >=20 > -- > Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org= ) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance >=20