[DB-SIG] SQL statement parse for Oracle
Dittmar, Daniel
daniel.dittmar@sap.com
Fri, 14 Dec 2001 12:19:40 +0100
Jekabs Andrushaitis wrote:
> > In the Oracle world SQL statement parsing can take
> considerable CPU/Block IO
> > for complex statements.
> From: M.-A. Lemburg [mailto:mal@lemburg.com]
> Perhaps I should add a .prepare() method to the set of standard
> DB API extensions though ?!
Would it be useful to give an option to the cursor () method that statements
for this cursor should be cached by the connection?
- at least with connection pools, it is much easier to have the connection
object handle the statement cache instead of managing a pool of
<JDBCSpeak>PreparedStatements</JDBCSpeak>
- I'm somewhat reluctant to cache ALL statements as some programmers tend to
build complete INSERT statements rather than using parameters.
The current strategy with the SAP DB implementation is to reuse the parse
information if the SQL string hasn't changed since the last execute (),
statements without parameters are executed without a prepare step. This
works reasonably well for the sane case of using one cursor for only one
purpose, but fails in the case of connection pooling.
Daniel
--
Daniel Dittmar
SAP DB, SAP Labs Berlin
daniel.dittmar@sap.com
http://www.sapdb.org/