Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 3
    It'd be a lot more flexible too, making more complex searches easier to do. Commented Feb 12, 2014 at 8:05
  • 2
    It'll be very fast. Honestly, even unindexed it'll likely be faster than manually doing the search in your code. Commented Feb 12, 2014 at 8:20
  • 4
    @user3201185: In the grand scheme of things, 10,000 is not very many items at all. Databases are built to handle much much higher loads while maintaining high performance. Commented Feb 12, 2014 at 9:11
  • 2
    @user3201185 it'll probably be measured in milliseconds, and most of that will be network time for such a simple search. Commented Feb 12, 2014 at 16:05
  • 1
    While flexibility in the future may very well be a bonus, if you don't need it and your sizes truly are limited (say up to 20K), please consider using an in-memory map as was suggested below! Depending on how you're slurping in the data, it will be extremely fast to build in memory and lookups should be say <1ms on any kind of decent machine! To put this in context, I just wrote a .Net app using Dictionary that did 10K string-based lookups in 1ms. Your speed with PHP may vary, but your biggest adversary will be change in requirements. Commented Feb 13, 2014 at 2:53