db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steen Jansdal <st...@jansdal.dk>
Subject Ideas for optimization
Date Wed, 08 Sep 2004 06:32:36 GMT
Hi,

I've noticed that simple insert statements aren't the fastest in the world.

We have a closed source module that do a lot of simple insertions like:

INSERT INTO test ( col1, col2, col3 ) VALUES ( 18, 34, 33 )
INSERT INTO test ( col1, col2, col3 ) VALUES ( 44, 1435, 856 )
..
..
INSERT INTO test ( col1, col2, col3 ) VALUES ( 117, 342, 452 )

without using parameters. This means that the statements are different 
and the cache of compiled statements doesn't help us at all. 
Unfortunately we aren't able to change this, since its not our own
program.

Idea: Would it be possible for Derby to rewrite these statements 
containing constant parameters into prepared statements with parameter.
In our example this would be an internal rewrite into

INSERT INTO test ( col1, col2, col3 ) VALUES ( ?, ?, ? )

and the execution would be much faster.

What do you think?

Unfortunately I haven't the knowledge yet to test this approach myself, 
but maybe some of you hardcore derby developers can step in.

Steen


Mime
View raw message