Re: [PERFORM] Query much slower when run from postgres function

From: Guillaume Cottenceau
Subject: Re: [PERFORM] Query much slower when run from postgres function
Date: ,
Msg-id: 87bps9ls4f.fsf@meuh.mnc.lan
(view: Whole thread, Raw)
In response to: Re: [PERFORM] Query much slower when run from postgres function  (Oliver Jowett)
Responses: Re: [PERFORM] Query much slower when run from postgres function  (Oliver Jowett)
List: pgsql-jdbc

Tree view

Re: [PERFORM] Query much slower when run from postgres function  (Guillaume Cottenceau, )
 Re: [PERFORM] Query much slower when run from postgres function  (Guillaume Smet, )
  Re: [PERFORM] Query much slower when run from postgres function  (Tom Lane, )
   Re: [PERFORM] Query much slower when run from postgres function  (Andreas Wenk, )
   Re: [PERFORM] Query much slower when run from postgres function  (Dave Cramer, )
    Re: [PERFORM] Query much slower when run from postgres function  (James Mansion, )
    Re: [PERFORM] Query much slower when run from postgres function  (Oliver Jowett, )
     Re: [PERFORM] Query much slower when run from postgres function  (Guillaume Cottenceau, )
      Re: [PERFORM] Query much slower when run from postgres function  (Oliver Jowett, )
       Re: [PERFORM] Query much slower when run from postgres function  (Guillaume Cottenceau, )
        Re: [PERFORM] Query much slower when run from postgres function  (Kris Jurka, )
  Re: [PERFORM] Query much slower when run from postgres function  (Scott Carey, )
   Re: [PERFORM] Query much slower when run from postgres function  (Oliver Jowett, )
    Re: [PERFORM] Query much slower when run from postgres function  (Scott Carey, )
 Re: [PERFORM] Query much slower when run from postgres function  (Mario Splivalo, )

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:

From: "Dickson S. Guedes"
Date:
Subject: Re: Renaming sequence auto generated by SERIAL type don't update pg_attrdef
From: Kris Jurka
Date:
Subject: Re: [PERFORM] Query much slower when run from postgres function