[ZODB-Dev] How do I find out the size of a subtree of the object graph?

David Glick davidglick at onenw.org
Mon Sep 14 10:43:10 EDT 2009


On Sep 14, 2009, at 7:04 AM, Jim Fulton wrote:
> On Mon, Sep 14, 2009 at 7:10 AM, Chris Withers  
> <chris at simplistix.co.uk> wrote:
>> Jim Fulton wrote:
>>>
>>> ZODB doesn't provide any direct support because it has no notion  
>>> of tree.
>>
>> Does it have any notion of object size on disk for a given object?
>
> Not directly, but you can do:
>
>  len(ob._p_jar.db().storage.load(ob._p_oid, '')[0])+42


What's the extra 42 for?  Aside from life, the universe, and  
everything...


David Glick
Web Developer
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment

http://www.onenw.org
davidglick at onenw.org
work: (206) 286-1235 x32
mobile: (206) 679-3833

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup






More information about the ZODB-Dev mailing list