Leonardo Santagada wrote:
> On Oct 4, 2008, at 12:36 PM, Wichert Akkerman wrote:
>> Adam wrote:
>>> Thanks for that, guys, I've not used a mailing list like this
>>> before so
>>> unsure how to respond.
>>> If ZODB stores the Package.Module.Class name in the pickle would it
>>> possible for me to simply rename them in the binary file?
> Possible it is, but probably harder than just doing what they said
>>> My confusion here is that I've globally imported everything from the
>>> packages into the current namespace of my main module. ZODB
>>> shouldn't be
>>> aware I've moved the modules since for all intents and purposes to
>>> Python, they are still there.
>> It doesn't matter where you import it from or to - python uses the
>> location of the actual implementation and ZODB uses that. If you
>> move your implementation to another place you have to either update
>> all objects in the ZODB or add module aliases.
> I would like to know from where does it get that info? I would guess
> from "__module__".
> Why doesn't zodb has a table of some form for this info? I heard that
> sometimes for very small objects the string containing this
> information can use up to 30% of the whole space of the file (using
> FileStorage). How does RelStorage store this?
I believe this was what the python pickle protocol 2 was created for.
However I think when someone last looked the potential space savings
with real world data did not justify making the change (Hanno has a
branch in svn for this).
For more information about ZODB, see the ZODB Wiki:
ZODB-Dev mailing list - ZODB-Dev@zope.org