[ZODB-Dev] Fetching multiple objects from the database with a single load.

Leszek Syroka leszek.marek.syroka at cern.ch
Tue Apr 6 02:42:49 EDT 2010


Hello,

I am optimizing  an application in which fetching objects from the ZODB 
seems to be a bottleneck. The problem is I would like to fetch an object 
that contains some persistent fields. For example:

class A (Persistent):

     def __init__(self):
         self._primaryAuthors = PersistentList()
         self._coAuthors = PersistentList()
         self._speakers = PersistentList()

After that there is a need to fetch every single persistent field 
(_primaryAuthors , _coAuthors,  __speakers etc. ) from this object, 
which takes a lot of time. It seems that access time to the ZODB takes 
significantly more time than operations performed inside the database to 
load an object. Is there a possibility to fetch an object and its all 
persistent field with a single access to the ZODB? Changing fields to 
non persistent is rather impossible due to complications in the 
application's architecture.

Best regards
Leszek


More information about the ZODB-Dev mailing list