pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Carey <scott@richrelevance.com>
To: David Kerr <dmk@mr-paradox.net>
To: Chris <dmagick@gmail.com>
Cc: Craig Ringer <craig@postnewspapers.com.au>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Optimizer + bind variables
Date: Wed, 4 Nov 2009 21:47:01 -0800
Message-ID: <C717A6D5.15F03%scott@richrelevance.com> (raw)
In-Reply-To: <20091104001825.GA79191@mr-paradox.net>




On 11/3/09 4:18 PM, "David Kerr" <dmk@mr-paradox.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@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance
> 




view thread (6+ messages)

Message-ID: <C717A6D5.15F03%scott@richrelevance.com>
Permalink:  ../C717A6D5.15F03%25scott@richrelevance.com/
Also on:    postgresql.org/message-id/C717A6D5.15F03%scott@richrelevance.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: scott@richrelevance.com, dmk@mr-paradox.net, dmagick@gmail.com, craig@postnewspapers.com.au
  Subject: Re: Optimizer + bind variables
  In-Reply-To: <C717A6D5.15F03%scott@richrelevance.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox