I have the following script:
I have a database with a specific MyISAM table about 4 million rows in size. I use stored procedures (MySQL Version 5.1) and, in particular, to search on these lines by various criteria. Several indexes are listed in this table, and queries through this stored procedure are usually very fast (<1s). Basically I use a prepared statement and create and execute some dynamic SQL in this sp search. After completing the prepared statement, I execute "DEALLOCATE PREPARED stmt;"
Most queries execute in a second (I use LIMIT to get just 15 rows at any time). However, there are some rare queries that take longer (say, 2-3 seconds). As far as I can optimize the search table.
I have developed a web application and I can run and see the results of quick queries in a second on my development machine.
However, if I open two instances of the browser and perform a simultaneous search (against the development machine), one with a longer running query, and the other with a faster query, the results are returned at the same time, that is, it seems as if the fast query was waiting completing a slower query before returning results. that is, both requests will take 2-3 seconds ...
Is there a reason for this? Since I thought MyISAM handles SELECTS independently, and this is currently not the kind of behavior I am experiencing ...
Thanks in advance! Tim
source
share