Hi
I'm using a couple of same-size tables to store tuples of numbers so that their index is there ID. When (tab)reading all tables at the given index, I get back the hole tuple. Mostly I have an ID and I need to look up some value which is obviously an inexpensive task.
But sometimes I know two values (the combination of the two values is unique) and I need to find the corresponding ID (index where both values are found in their respective tables). I'm currently doing a reverse lookup by scanning the table(s) which is more expensive than the forward lookup.
Let's assume memory usage is less of a concern, is there an complementary way to store the data (x tuples of same size) that allows for a quick reverse lookup?
ID -> (x, y): easy
(x, y) -> ID: ??
Roman