I have a search function on my site that needs to search through ~2000 items (this table never changes, it will always have the same number of items) stored in MySQL. All it needs to do is search by name or 'LIKE' the name and return the id. I have thought of two approaches to this:
- Query database using ajax on keyup(), this seems like it would be expensive with many people searching
Which approach is better? Or if you have a better approach I am open to suggestions.