Re: [ZODB-Dev] BTrees and id mapping (was Re: Data.fs size grows non-stop)

2009-12-14 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Pedro Ferreira wrote:
> David Glick wrote:
>> Pedro Ferreira wrote:
>>   
>>> Hello all,
>>>
>>> So, I've been experimenting with a new structure for our date indexes, 
>>> and I was considering using an IOBTree that would map integer timestamps 
>>> to BTree-based sets. As for the sets, I considered two options:
>>>   
>>> 
>> Be careful with using timestamps as IOBTree keys.  By default this type 
>> of BTree uses the system integer, which on many systems is 32 bits.  
>> That means that you'll overflow the maximum allowed key for timestamps 
>> beyond the year 2038.  It won't even give an error; it will just 
>> silently overflow and overwrite existing values in the BTree.
>>   
> Yes, I know. That's one of the reasons I'm using mmdd integers 
> instead (the other one being i only need 1 day resolution).
> 
> Thanks a lot for the tip!

An LOBTree uses a guaranteed-to-be-long (64 bits) integer for the keys,
if you need that.


Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksmsuMACgkQ+gerLs4ltQ6mNgCgwBpVRaUli7a7Ij1NQYYHsxif
OD0AnjgAGY1TB6GAadx1qSmwW/8w5c1a
=ZJRe
-END PGP SIGNATURE-

___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] BTrees and id mapping (was Re: Data.fs size grows non-stop)

2009-12-14 Thread Pedro Ferreira
David Glick wrote:
> Pedro Ferreira wrote:
>   
>> Hello all,
>>
>> So, I've been experimenting with a new structure for our date indexes, 
>> and I was considering using an IOBTree that would map integer timestamps 
>> to BTree-based sets. As for the sets, I considered two options:
>>   
>> 
> Be careful with using timestamps as IOBTree keys.  By default this type 
> of BTree uses the system integer, which on many systems is 32 bits.  
> That means that you'll overflow the maximum allowed key for timestamps 
> beyond the year 2038.  It won't even give an error; it will just 
> silently overflow and overwrite existing values in the BTree.
>   
Yes, I know. That's one of the reasons I'm using mmdd integers 
instead (the other one being i only need 1 day resolution).

Thanks a lot for the tip!

Pedro
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev