[email protected]
[Top] [All Lists]

Re: multi-indexed tdb

Subject: Re: multi-indexed tdb
From: "Stefan (metze) Metzmacher"
Date: Thu, 03 Aug 2006 09:01:21 +0200
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Volker Lendecke schrieb:
> Hi!
> 
> Attached find a trivial wrapper around tdb that might make
> multi-indexed tdb files sane.
> 
> The idea is that for the modifying functions you provide a
> callback function that creates a list of index strings out
> of a record. Thanks to Jeremy for this good idea, I had
> something more complicated in mind.
> 
> The tdb_multindex.c lib creates a random primary key for you
> and sets the index records to that primary key under a tdb
> transaction. That's basically the whole idea.
> 
> What's missing is tdb_reindex and tdb_traverse_indexed

Hi Volker,

I had a simular idea:-)

I thought about having a separate hash array different
subkeys, (the idea a virtuel named databases)
so that the traverse call would not need to go through
all records and filter out the wrong ones. Instead
a traverse call would only go through the correct records.

This would also be very useful for implementing ldb partitions
and ldb indexes for the whole tree, the partition and a container.

But your version looks good, and seems very simple.

Maybe a private pointer to the index fn would be useful,
so that the caller could pass a struct to it,
otherwise the index fn need to parse the TDB_DATA blob.

Also a magic version key would be good, so that the file
and be easy identified as a tdb with multiple indexes.

metze
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFE0Z9Bm70gjA5TCD8RAouUAKCBT6tbUydBM3tNS3fCWDlF3Ss6HwCfaUtI
iDScComKEZ2cajWBqLLEjfs=
=6tmq
-----END PGP SIGNATURE-----

<Prev in Thread] Current Thread [Next in Thread>