I have a major in math - I know what you were talking about. Try using a hash before declaring it unusable.
Remember - you're building a data structure against which to compare items. So, memory is not a major issue for this tool. Thus, translation of [0,5000) is very simple - my %x; $x{$_} = 1 for 0 .. 5000-1;
Frankly, I think you haven't fully described what it is you're trying to build. You describe an auditing tool for 250M transactions/day in your original post, but now you want to have the auditing criteria be input via a webform. Those aren't very compatible. Auditing tools really should be auditing against the specifications. If your specifications are determined by inputs into a webform, then nothing can help you.
Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.