On Mar 25, 2005, at 4:00 AM, Mario Ruggier wrote: > On Mar 25, 2005, at 1:42 AM, David Binger wrote: > >> One interesting feature that may not be obvious is that iterating >> over all of >> the instances in the BTree does not, by itself, actually load the >> pickles of >> any of the (Persistent) instances stored as values in the tree. It >> does force >> the loading of the BNodes, but that is much less data. > > But not for a persistent dict? I.e. looping over its keys() will force > the loading of all the values(), whatever they may be (persistent or > not, objects or containers) ? > The typical case, I think, is that you have a mapping whose keys are either strings or ints, and the values are instances of (some subclass of) Persistent. If you loop over the keys, values, or items of the mapping, whether it is a PersistentDict or BTree, (without accessing attributes of the values), the keys will all be loaded into RAM, but only "ghost" versions of the values are loaded. The "ghost" versions still have their pickled __dict__ contents stored on disk until your program makes an attribute access. The behavior that is different, between PersistentDict and BTree is that any access to a key in the PersistentDict must load all of the keys into memory. Reference to a key in a BTree only loads the keys in the BNodes that are on the branch that leads to the key you want. > How did the presentation go at pycon yesterday afternoon? Pretty well, I think. There were some interesting questions and conversations afterword with people that use and like relational databases and SQL. Questions asked: How do you do a query? Is the whole data set loaded into memory when you perform a select? How do you change schemas? How do you do backups? What happens if the power goes out during a commit? When would ZODB be better than Durus?