MySQL Forums
Forum List  »  Quality Assurance

Concurrent SELECTS - one select waits for the other??
Posted by: Timothy Mifsud
Date: March 12, 2009 10:15AM

Hi,

I have the following scenario:

I have a database with a particular MyISAM table of about 4million rows. I use stored procedures and one in particular to search through these rows on various criteria. This table has several indexes on it, and the queries through this stored procedure are normally very fast. Basically I use a prepared statement and create and execute some dynamic SQL in this search sp. After executing the prepared statement, I perform "DEALLOCATE PREPARED stmt;"

Most of the queries run in under a second (I use LIMIT to get just 15 rows at any time). However, there are particular (and very rare/convoluted) queries which take longer to run (say 6-10s). I have developed a web application and I can run and see the results of the fast queries in under a second.

However, if I open two browser instances and do a simultaneous search, one with the long running query, and the other with the fast query, the results are returned at the same time, i.e. it seems as if the fast query waits for the slower query to finish before returning the results.

I am quite new to MySQL and it might be something obvious that I am missing, but I am not performing any updates, just selects, so why should the quick query in one browser show me the results only after the slow query (in the other browser) finishes?

Thanks in advance!
Tim

Options: ReplyQuote


Subject
Views
Written By
Posted
Concurrent SELECTS - one select waits for the other??
2697
March 12, 2009 10:15AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.