[odb-users] Performance issues for large sets

Boris Kolpackov boris at codesynthesis.com
Fri Sep 19 07:04:51 EDT 2014


Hi Quentin,

Quentin Deldycke <quentindeldycke at gmail.com> writes:

> Yes, but sadly they doesn't suits all my needs and limit quite much our
> usage of ODB.

ODB is not magic. It cannot somehow deliver advanced, high-level
functionality (like polymorphism) at zero cost. Views allow you
to execute tailor-made queries that can (a) load only data members
that you need and (b) load multiple related objects with a single
query.


> Our 'old' system used C-ISAM. It can perform a "while" of 1000 elements in
> 0.003s - 0.007s.
> The same request with odb iterate this 1000 elements in 1.3s - 2.6s.
> 
> The use of odb views allows me to perform this iteration in 0.01s - 0.03s.

Was the 'old', C-ISAM system using the same MySQL database that you
are using with ODB?


> But this mode take only the data i want (i don't know exactly the user
> will need in the root object!)

Then load all of them. Or, if some of them are expensive to load (e.g.,
huge BLOBs), then load them with a separate view if and when necessary.


> The main advantage i see of views, is because they don't resolve dependency
> at 'iteration' but at 'query'
> 
> While the basic way of working select data of root object at 'query' then
> resolve dependency at 'iteration'.

If by dependencies you mean related objects, then you can also control
their loading with lazy pointers (Section 6.4, "Lazy Pointers"). Another
useful feature is object sections (Chapter 9, "Sections"). They allow
you to lazy-load huge BLOBs, etc.

Boris



More information about the odb-users mailing list