Re: searching based on 2 keys



> Hello,
>
>Suppose I have the following table:
>
>key value
>---- -----
>
>2 foo
>24 bar
>12 baz
>
>Now I need an efficient algorithm so that I can search based on either
>the key or the value. One of the solutions is to use 2 tables - but we
>are heavily memory constrained and that is not a solution. Are there
>any other suggestions that I can try?

What are the ranges of the key? From what to what (i.e. 0 to 100000?).
What is the nature of the values? Will they always be strings of 3
chars? I don't know enough about your problem to suggest a data
structure in line with your memory restrictions.

.



Relevant Pages

  • Re: OT: Why is C so popular?
    ... > about the indent program at the time? ... if foo: ...
    (Debian-User)
  • Re: how to deserialize variable element/node
    ... string bar; ... baz[] Baz; ... Your two XML fragments would have to be represented in an XML schema by ...
    (microsoft.public.dotnet.xml)
  • Re: Regular Expressions...
    ... (foo, bar, baz) ... an object which allows access to the grouped matches as a sequence. ...
    (comp.lang.python)
  • Re: macros
    ... (:method ((foo foo) ... (baz baz)) ... in Anonymous C Lisper's post (bar bar)" ... latter so you know that this is actually the generic function you want). ...
    (comp.lang.lisp)
  • Re: creating several rows with one insert?
    ... Is there some clever way to cause this to happen in SQL, ... SQL> create table t1as select 'foo' from dual ... union all select 'bar' from dual union all select 'baz' from dual; ...
    (comp.databases.oracle.misc)