Re: Optimizer + bind variables

From: Scott Carey <scott(at)richrelevance(dot)com>
To: David Kerr <dmk(at)mr-paradox(dot)net>, Chris <dmagick(at)gmail(dot)com>
Cc: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Optimizer + bind variables
Date: 2009-11-05 05:47:01
Message-ID: C717A6D5.15F03%scott@richrelevance.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 11/3/09 4:18 PM, "David Kerr" <dmk(at)mr-paradox(dot)net> 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
>
> <sigh> and i've read that before too.
>
> On the upside, then it behaves like I would expect it to, which is
> good.
>
> Thanks
>
> 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 = match
in the where clause to that column, the plans won't differ.

>
> --
> Sent via pgsql-performance mailing list (pgsql-performance(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance
>

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jay Manni 2009-11-05 08:01:36 Re: High Frequency Inserts to Postgres Database vs Writing to a File
Previous Message Jeff Janes 2009-11-05 04:27:27 Re: maintaining a reference to a fetched row