Re: [PERFORM] Query much slower when run from postgres function - Mailing list pgsql-jdbc

From Guillaume Cottenceau
Subject Re: [PERFORM] Query much slower when run from postgres function
Date
Msg-id 87bps9ls4f.fsf@meuh.mnc.lan
Whole thread Raw
In response to Re: [PERFORM] Query much slower when run from postgres function  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: [PERFORM] Query much slower when run from postgres function  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Tom Lane
Date:
Subject: Re: Renaming sequence auto generated by SERIAL type don't update pg_attrdef
Next
From: Oliver Jowett
Date:
Subject: Re: [PERFORM] Query much slower when run from postgres function