pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guillaume Cottenceau <gc@mnc.ch>
To: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [PERFORM] Query much slower when run from postgres 	function
Date: Tue, 10 Mar 2009 09:05:52 +0100
Message-ID: <87bps9ls4f.fsf@meuh.mnc.lan> (raw)
In-Reply-To: <49B58ABE.7070105@opencloud.com>
References: <49B51B60.6030600@megafon.hr>
	<27649.1236616294@sss.pgh.pa.us>
	<87fxhmmygj.fsf@meuh.mnc.lan>
	<1d4e0c10903091004m758d7ea2s91e33631be81215a@mail.gmail.com>
	<5165.1236618994@sss.pgh.pa.us>
	<491f66a50903091256n7fe4a3f6i93267d0d53b983cb@mail.gmail.com>
	<49B58ABE.7070105@opencloud.com>

Oliver Jowett <oliver 'at' opencloud.com> writes:

> The idea behind the threshold is that if a PreparedStatement object is
> reused, that's a fairly good indication that the application wants to
> run the same query many times with different parameters (since it's
> going to the trouble of preserving the statement object for reuse). But

Or it may just need the safeness of driver/database parameter
"interpolation", to get a "free" efficient safeguard against SQL
injection. As for myself, I have found no other way to obtain
driver/database parameter interpolation. So sometimes I use
prepared statements even for running a query only once. I am
unsure it is a widely used pattern, but SQL injection being quite
important to fight against, I think I may not be the only one.

-- 
Guillaume Cottenceau



view thread (26+ messages)  latest in thread

Message-ID: <87bps9ls4f.fsf@meuh.mnc.lan>
Permalink:  ../87bps9ls4f.fsf@meuh.mnc.lan/
Also on:    postgresql.org/message-id/87bps9ls4f.fsf@meuh.mnc.lan

 · 

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: gc@mnc.ch, oliver@opencloud.com, pgsql-jdbc@postgresql.org
  Subject: Re: [PERFORM] Query much slower when run from postgres 	function
  In-Reply-To: <87bps9ls4f.fsf@meuh.mnc.lan>

* 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