Re: 7.3 schedule

From: Curt Sampson <cjs(at)cynic(dot)net>
To: Barry Lind <barry(at)xythos(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.3 schedule
Date: 2002-04-15 04:41:03
Message-ID: Pine.NEB.4.43.0204151335060.439-100000@angelic.cynic.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)cynic(dot)net> +81 90 7737 2974 http://www.netbsd.org
Don't you know, in this new Dark Age, we're all light. --XTC

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Barry Lind 2002-04-15 04:44:42 Re: bug with current sources? Re: cost of parse/plan/execute
Previous Message Bruce Momjian 2002-04-15 04:27:53 Re: [PATCHES] ANSI Compliant Inserts