[pybsddb] Making calls to keys() more efficient (or, how to do inequality gets on keys?)
Francisco Olarte (M)
folarte at peoplecall.com
Fri Jun 18 16:28:22 CEST 2010
Unfortunately, the db in question is not a btree, so I couldn't use the
> I wound up using a more frequent purge interval in the short-term, which
> gave me enough time to put the timestamp in the value, where I could use a
> secondary index to get the range of expired keys I needed.
> If you are actually using so many keys, you can use range key request in
>> Berkeley DB. I am not sure we support it yet in pybsddb. I can not check
>> it now. But if not, and you need it, just ask and I would add it to the
>> new pybsddb version.
> Is range key request limited to btrees? If not, then I'd vote for it to be
> included in pybsddb as well.
Probably everybody supposed a btree because the only reason we could think
off for putting a timestamp at the front of the key was to use an ordered
map, and the btree is the ordered map implementation in BDB. Range key
request is normally limited to ordered data structures. If you are using
hashes you don't have an order relation defined ( btrees normally need
less-than defined on the keys, you can derive equal from it ( a equals b is
the same as not (a less than b or b less than a) , hashes need a hash
function plus an equals function, and they are unordered, in fact traversing
ordering usually changes as the hash table is updated and needs to be
> pybsddb mailing list
> pybsddb at jcea.es
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pybsddb