For less than a few hundred-thousand entries, a simple search ("grep" function) will do as well as anything. If the computer can keep all the data in physical memory at the same time, even a sequential search is fast-enough. Don't solve a problem until you have verified that it actually hurts.