Reputation: 30
Does MySql put their queries in something like a queue or one of the queries will be accepted and other ones receive an error?
If there is something like a queue, what is its basis? does it work on based on time or something else?
Update: I supposed that every query is unique and happen to be a new record.
Upvotes: 0
Views: 453
Reputation: 108816
For ordinary insert queries of the type that can never create a duplicate key value, SQL table servers (MySQL and the rest) always perform them all.
You can think of the table server as containing a query queue: that's useful even if it is greatly oversimplified. Modern table servers contain vast amounts of code oriented around handling concurrent users correctly.
When two users issue queries at nearly the same time, you cannot rely on the table server to perform them in a particular order, just that they will all complete correctly.
Upvotes: 1