[odb-users] Performance issues for large sets

Quentin Deldycke quentindeldycke at gmail.com
Thu Sep 18 09:04:08 EDT 2014


Hi Boris,

You are right, the difference of performance is impressive:

   - Without views: 50s
   - With views: 1.2s

I will try to modify my system to better use views.

--
Deldycke Quentin


On 18 September 2014 09:31, Boris Kolpackov <boris at codesynthesis.com> wrote:

> Hi Quentin,
>
> Quentin Deldycke <quentindeldycke at gmail.com> writes:
>
> > I have a class, itself linked to multiple sub-classes, when i iterate
> over
> > them, i only acces fields from the 'root' table.
> >
> > I don't understand how odb works at this moment. At the global scope,
> > ODB queries the 'root' object, then at each iterator, ODB select the
> > different sub-objects.
>
> Ok, I assume you are using polymorphic inheritance in which case, for
> derived classes, their data members are stored in multiple tables. So
> when you query for a base class, ODB loads you actual, dynamic instances
> of the objects. To put it another way, when you query for the base, the
> result of the query is a mixture of various derived objects (returned as
> their base interface).
>
>
> > Is there any way to:
> >
> >    - disable select for sub objects when they are not directly accessed?
> >    - force select for sub objects at global scope?
>
> I am not sure what you mean by the last item, but the best way to
> achieve what you want is with ODB views. Not only can you select
> just the data members from the base class only, you can go a step
> further and only select a subset of data members that you actually
> need. See Chapter 10, "Views" in the ODB manual.
>
> Also, generally, when you have a performance/database load issue
> with a query, ODB views are the answer.
>
> Boris
>


More information about the odb-users mailing list