Re: 7.3 schedule - Mailing list pgsql-hackers

From Curt Sampson
Subject Re: 7.3 schedule
Date
Msg-id Pine.NEB.4.43.0204151335060.439-100000@angelic.cynic.net
Whole thread Raw
In response to Re: 7.3 schedule  (Barry Lind <barry@xythos.com>)
List pgsql-hackers
On Thu, 11 Apr 2002, Barry Lind wrote:

> I'm not sure that JDBC would use this feature directly.  When a
> PreparableStatement is created in JDBC there is nothing that indicates
> how many times this statement is going to be used.  Many (most IMHO)
> will be used only once.

Well, the particular PreparedStatement instance may be used only
once, yes. But it's quite likely that other, identical PreparedStatement
objects would be used time and time again, so it's still good if
you don't need to do much work on the second and subsequent
preparations of that statement.

> If it only is used once, it will actually perform worse than
> without the feature (since you need to issue two sql statements to the
> backend to accomplish what you were doing in one before).

I'm not sure that it would be much worse unless you need to wait
for an acknowledgement from the back-end for the first statement.
If you had a back-end command along the lines of "prepare this
statement and execute it with these parameters," it would have
pretty much the same performance as giving the statement directly
with the parameters already substituted in, right?

> Thus if someone wanted to use this functionality from jdbc they would
> need to do it manually, i.e. issue the prepare and execute statements
> manually instead of the jdbc driver doing it automatically for them.

I'd say that this is awfully frequent, anyway. I use PreparedStatements
for pretty much any non-constant input, because it's just not safe
or portable to try to escape parameters yourself.

cjs
-- 
Curt Sampson  <cjs@cynic.net>   +81 90 7737 2974   http://www.netbsd.org   Don't you know, in this new Dark Age, we're
alllight.  --XTC
 



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: regexp character class locale awareness patch
Next
From: Barry Lind
Date:
Subject: Re: bug with current sources? Re: cost of parse/plan/execute