[ZODB-Dev] ZODB design. Size and saving records

Andreas Jung lists at zopyx.com
Sun Jun 22 12:07:36 EDT 2008



--On 22. Juni 2008 08:54:14 -0700 tsmiller <tsmiller at gnixterhouse.com> 
wrote:


>
> I have two questions.
> 		1)  When I already have a storeNumber and I save a record to
>
>              			db.dbRoot['books'][storeNumber][bookNumber] = record
>
> 		 I have to set the _p_changed flag on the 'books' IOBTREE structure to
> get the book to save.

I don't see why you need to set _p_changed here. The change should be 
noticed automatically.



>
> 		Which means that it saves the ENTIRE 'books' IOBTREE' structure every
> time a save a single book.  (at least it looks like it is doing this).

Such a change will write only the data of corresponding bucket back to the 
ZODB but not the complete object. That's why we are having BTrees.

> When I edit a book and save it the database grows by more than 64k.  And
> it looks like it will get worse and worse as more books are added.
>
> 		Am I looking at this correctly.  Or am I doing something really
> ignorant?

Your code using IOBTrees looks fine (except the unnecessary usage of 
_p_changed). Your observations or conclusions appear weird to me.

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zodb-dev/attachments/20080622/3d47f1d9/attachment-0001.bin


More information about the ZODB-Dev mailing list