[elephant-devel] Secondary DB behavior

Ian Eslick eslick at csail.mit.edu
Sat Jan 28 19:37:21 UTC 2006


This was not clear in the documentation, but secondary db's appear to
have the following behavior.

btree - an indexed btree
inverted - an secondary index of btree
fn - A function that computes the secondary key given the value given to
btree

Write pkey/value1 into btree
inverted has fn(value1)/pkey

Change the association of pkey by writing
pkey/value2 into btree

inverted now has:
fn(value1)/pkey
fn(value2)/pkey

Namely, each secondary index contains the entire history of the values
of pkey and associates
them with pkey.  If you are sorting and searching objects by using
secondary indices this is
not very useful. 

Is this the intended functionality?  This could be a setup problem on my
end or the way secondary
indices were intended to work.  In which case it makes sense for me to
make sure that when
a secondary value changes, the original secondary key/value pair is
deleted from the secondary
index.  I just discovered this and the uniqueness of mappings to pkey in
the above example is
crucial for my application.

Thank you,
Ian



More information about the elephant-devel mailing list