[odb-users] Erase/Remove Performance comparison to native SQL

Boris Kolpackov boris at codesynthesis.com
Tue Apr 15 07:27:47 EDT 2014


Hi Christian,

Lichtenberger, Christian <christian.lichtenberger at etm.at> writes:

> In the scenario "delete by ids" ODB is much slower. In this scenario
> we remove 10000 (entries) x 2 (tables in 2 transactions) by entering
> the id. In ODB we use "db->erase<Object>(id)" and in SQL we use
> "sqlite3_mprintf("delete from 'Object' where ID = '%d';", id)". With
> native SQL we need 0,3 seconds and with ODB 18,3 seconds.

Generally, if you do the same things in ODB and native SQL, ODB should
be at least as fast and often faster because of various reuse/caching
mechanisms.

It is hard to say why there is the difference without seeing the code,
including the object model/schema (e.g., do you use containers)? Can
you show the relevant transactions for each test (ODB case)? Also,
can you enable statement tracing for each transaction:

t.tracer (odb:stderr_tracer)

And see which statements actually get executed by ODB under the hood?
Do they match your native SQL?

I would be interested to hear what you will find.

Boris



More information about the odb-users mailing list