pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Kerr <dmk@mr-paradox.net>
To: pgsql-performance@postgresql.org
Subject: Optimizer + bind variables
Date: Tue, 3 Nov 2009 09:47:29 -0800
Message-ID: <20091103174729.GA55736@mr-paradox.net> (raw)

Does/is it possible for the PG optimizer come up with differnet plans when 
you're using bind variables vs when you send static values?

like  if my query was

select * from users (add a bunch of complex joins) where username = 'dave'
vs
select * from users (add a bunch of complex joins) where username = '?'

In oracle they are frequently different.

if it's possible for the plan to be different how can i generate an
xplan for the bind version?

Thanks!

Dave



view thread (6+ messages)  latest in thread

Message-ID: <20091103174729.GA55736@mr-paradox.net>
Permalink:  ../20091103174729.GA55736@mr-paradox.net/
Also on:    postgresql.org/message-id/20091103174729.GA55736@mr-paradox.net

 · 

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: dmk@mr-paradox.net
  Subject: Re: Optimizer + bind variables
  In-Reply-To: <20091103174729.GA55736@mr-paradox.net>

* 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