pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: pgdba@hush.com
To: pgsql-php@postgresql.org
Subject: force re-planning of prepared statements?
Date: Mon, 29 Dec 2008 14:17:05 -0800
Message-ID: <20081229221705.4464B20040@smtp.hushmail.com> (raw)

Hi all, I am experiencing some performance issues that I think are 
stemming from the PDO prepared statements functions.

I have a pretty simple query that runs:

- sub-second when issued from the command line (not prepared)

- takes 200+ seconds when run from the command line inside a 
prepared statement (eg. 
http://www.postgresql.org/docs/8.2/interactive/sql-prepare.html)

- takes over 200s when run from our application, within the pdo 
prepared functions

- runs sub-second from our application if I prepend the query with 
"explain analyze" and looking at the resulting plan, it shows the 
same plan as when it runs quickly from the command line.

postgresql 8.2.11, php 5.2.1

What are my options here? I would like to continue to use bind 
variables to prevent sql injection, but I'd like to force a plan re-
parse for every single query.

Any ideas?


--
Click to become a massage therapist and work for yourself.
 http://tagline.hushmail.com/fc/PnY6qxsbda5xAD52Aya1On7VD40YOQA3qlB2S2RuRhpQuc9Grmy1V/




view thread (8+ messages)  latest in thread

Message-ID: <20081229221705.4464B20040@smtp.hushmail.com>
Permalink:  ../20081229221705.4464B20040@smtp.hushmail.com/
Also on:    postgresql.org/message-id/20081229221705.4464B20040@smtp.hushmail.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: pgdba@hush.com
  Subject: Re: force re-planning of prepared statements?
  In-Reply-To: <20081229221705.4464B20040@smtp.hushmail.com>
  References: <20081229221705.4464B20040@smtp.hushmail.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