Re: B+ tree: How to obtain key from value

From: Jonathan Leffler <jleffler_at_earthlink.net>
Date: Sat, 14 Jul 2007 05:25:56 GMT
Message-ID: <E7Zli.6949$rR.6516_at_newsread2.news.pas.earthlink.net>


Dimitry wrote:
> I am looking for solution (technique) that will allow me, while using
> traditional B+ tree, to obtain key from value without creating
> "reversed" table. Some overhead is acceptable but not "reversed"
> table. Looping is also not an option.

Homework?

Generally, a B+Tree is an indexing structure that identifies a record. The record contains the key - and auxilliary data. So, you should be able to extract the key from the record, if you know the structure of the record. If you don't, you're on a hiding to nothing - there could be multiple keys that refer to the same data, in general, so there's no way to determine the key (nor, even, a key) from the value.

-- 
Jonathan Leffler                   #include <disclaimer.h>
Email: jleffler_at_earthlink.net, jleffler_at_us.ibm.com
Guardian of DBD::Informix v2007.0226 -- http://dbi.perl.org/
Received on Sat Jul 14 2007 - 07:25:56 CEST

Original text of this message