Re: S.O.D.A. database Query API - call for comments

From: Carl Rosenberger <carl_at_db4o.com>
Date: Fri, 4 May 2001 16:23:40 +0200
Message-ID: <9cue2e$vgj$02$1_at_news.t-online.com>


Robert Sundström wrote:
> But, I have read some of the code of your benchmark and noticed that you
 have
> chosen to dynamically build _each_ SQL-statement and use JDBC-Statement
> objects for executing them. This is (just as you say) expensive. I would
 guess
> that a typical SQL-database will spend 90% of its time compiling and
> generating query plans for your statements.

Sorry for the simplicity of the benchmark. I know that the SQL part can be optimized for the specific task that is taking place. The 1000 runs try to simulate insert, update and retrieval of 1000 *different* objects.

> The idea of SQL to provide a generic, dynamic and easy to understand way
 of
> manipulating databases. SQL-statements *can* be compiled and executed
> dynamically, just as you do in your benchmark, but the preferred way is to
> compile the statements in advance using parameter markers and execute them
> multiple times.

O.K. we could add a prepared-statement version also, and compare performance.

On the other hand our engine also has a great disadvantage in the simple benchmark:
It stores an integer/String *plus* an object to carry it.

> Compare this to your object oriented database approach. When you have
 compiled
> your java database program, all possible database operations are set
> and defined at compile time. You will never dynamically construct and
 compile
> Java code!

No, we do not dynamically change Java code.

  • However we do generate and maintain (even on changes) an abstract class scheme in the database dynamically during runtime. The database does not need to be recompiled, if user classes change.
  • Every single query run dynamically generates an abstract representation of the query.
  • Query evaluation compares byte arrays, and most objects are not instantiated, to save resources and improve speed. I would call the above 3 points dynamic.

A side question:
Do OR-mappers typically use dynamic statements or prepared statements?

Kind regards,
Carl

---
Carl Rosenberger
db4o - database for objects - http://www.db4o.com
Received on Fri May 04 2001 - 16:23:40 CEST

Original text of this message