I was wondering whether the instant search using jQuery would cause a massive load on a database (MySQL). I know there are a lot of factors to consider, but for argument’s sake let’s say you have 30,000 records to flick through?
I was wondering whether the instant search using jQuery would cause a massive load
Share
Indexing
Indexing helps, but indexing also slows down INSERT/UPDATE/DELETE statements…
MySQL also limits the amount of space you can use to index columns in a table, and it depends on the engine type:
Data types
Choose the right data type for the job.
Not long ago, I noticed that a question on SO was listing TEXT as the data type but only using ~100 characters. They reported back to say they saw the query time decrease to a
thirdtenth of the original when they changed the data type to VARCHAR.Optimal Query
Be aware that wildcarding the left side of a LIKE expression renders an index on the column useless. If you need that sort of search, look at leveraging Full Text Search (FTS) using either MySQL’s native
MATCH .. AGAINSTsyntax or 3rd party support like Sphinx. It’s hard to offer more insight without seeing a query.