MySQL - Parallel SELECTS - Is One Client Waiting For Another?

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

+3
source share
2 answers

This is only due to the fact that you are doing this from the same computer, if the searches are from two different machines, they will go at the same time. Do you really want one person to be able to link your MySQL server by simply opening a bunch of browser windows and clicking refresh?

0
source

. select MyISAM . , " ". innoDB .

0

Source: https://habr.com/ru/post/1705344/


All Articles