tags:

views:

41

answers:

2

I have two mysql db on one machine. db1 and db2. If db1 is intensive in use, is querys for db2 wait for db1 querys finish? in other words is mysql use paralell computing for querys in different databases?

For example big query1 comes to db2. It computes 5 seconds. And after 1 sec comes little query2 for db1, it computes 1 second. Will query2 result be returned after 5 sec. (wait for query1) or returned after 1 sec. immediately?

A: 

Under what you describe, both queries will run in parallel.

OmerGertel
A: 

Databases won't conflict with each other. You can think of them more as logical groupings of tables. Queries within the same database won't conflict with each other either, unless they are using the same tables. Even then multiple SELECTs can happen at once on the same tables.

You really only get "conflicts" when a table is being modified (UPDATE, DELETE, INSERT). Even then InnoDB tables can run modification and select queries at the same time. MyISAM tables almost always "conflict" since it uses table locking for modifications.

Brent Baisley