From: <cg...@cd...> - 2000-06-02 21:17:56
|
ji...@ex... said: > The other thing that is confusing me is the row-id concept. I can't > seem to be grasping it. Can you elaborate here so I can get the mental > picture of what is actually happening. That's easy. On the user level, you want rowids. Furthermore, you want as little hassle as possible mapping rowids to actual storage locations, so you cook up a scheme like I did with the <block,offset> encoded in a single bunch of bytes, represented externally as an opaque integer. However, on the storage level, you don't want such a scheme, because it prevents you from moving stuff around in order to optimize storage. So you introduce indirection: the user gets a logical rowid, which points to a translation page and an offset within the translation pages - at this location, you store the actual physical rowid, which is the physical page/offset location that contains the actual data. When you shuffle the data around because of storage needs (JDBM currently only does this when expanding allocation, but it could do all sorts of stuff), the new location is recorded by rewriting the physical rowid in the logical rowid location. A bit like the MacOS memory allocation stuff. -- Cees de Groot http://www.cdegroot.com <cg...@cd...> GnuPG 1024D/E0989E8B 0016 F679 F38D 5946 4ECD 1986 F303 937F E098 9E8B Forge your CipherSaber and list it: http://www.xs4all.nl/~cg/ciphersaber/ |