Reputation: 285
I have a huge unique string list (1.000.000.000+ lines). I need to know if a string does exist in this list or not. What is the fastest way to do it ?
I guess I need a very simple database engine with a Btree index which lets me do fast lookup ... and MySQL may be too slow and complex for this.
Upvotes: 1
Views: 709
Reputation:
If this is all you need to do, you should take a long look at tries and related data structures specialized for strings (e.g. suffix array). With this many strings, you are guaranteed to have a lot of overlap, and these data structures can eliminate such overlap (saving not only memory but also processing time).
Upvotes: 2