I am using MySQL and I would like to know if I make multiple select statements simultaneously in order to get information from the information schema, how are these queries handled? Could this cause some potential database malfunction?
-
How would you present them to the database simultaneously?Andrew Mortimer– Andrew Mortimer2015-08-15 15:59:46 +00:00Commented Aug 15, 2015 at 15:59
-
Possible duplicate of stackoverflow.com/questions/4629979/…nha– nha2015-08-15 16:08:15 +00:00Commented Aug 15, 2015 at 16:08
-
@mort: we may have multiple clients using the information schema. By simultaneously I mean, one client can run a select query and before this ends another one runs select. will this result in a mess? thank you for your timeAlex– Alex2015-08-15 16:14:28 +00:00Commented Aug 15, 2015 at 16:14
-
@nha: I checked, and we are not asking the same thing, unfortunatelyAlex– Alex2015-08-15 16:16:41 +00:00Commented Aug 15, 2015 at 16:16
-
@Alex you mean different clients on different machines ?nha– nha2015-08-15 16:25:46 +00:00Commented Aug 15, 2015 at 16:25
|
Show 7 more comments
1 Answer
Since your are using the myISAM storage engine and are worrying about concurrent SELECT statements:
READ (SELECT) can happen concurrently as long as there is no WRITE (INSERT, UPDATE, DELETE or ALTER TABLE). Ie. you can have either one writer or several readers.
Otherwise the operations are queued and executed as soon as possible. There is a special case : concurrent inserts.
Note : if you are wondering about the choice between the two main mySQL storage engines myISAM and InnoDB, InnoDB is usually a good choice, please read this SO question.