I think the actual answer you're looking for has nothing to do with a database, but simply a fast(er) search algorithm.
Since your data is sorted in order, try a binary search. It is faster (with a big-O of ln(n)).
Basically the way you accomplish this is to go to the middle of the list and check if the value there is > or < the value you're searching for. If it is less than, you go to the middle between the start and your current point or if it's greater than, you go to the middle between the end and your current point.
If that doesn't make any sense... I'll try to illustrate:
Code:
here's a sorted array with 9 elements:
1 2 3 4 4 5 6 7 9
let's say you want to search for 2.
1) start = index 0, end = index 8
2) go to the middle: 8 / 2 = 4
1 2 3 4 4 5 6 7 9
^
3) if it is > your search value, end = index 4, repeat step 2
if it is < your search value, start = index 4, repeat step 2
if it == your search value, you're done.
I may be overexplaining a bit, but I just want to make sure I'm being clear.
hth