I have a list of queries that I use to warmup my InnoDB database tables. Currently, I run these queries sequentially and they take some time to run. I was wondering if there was a way I could run them in parallel to speed up the time it takes to run all the queries?
Asked
Active
Viewed 2,006 times
3
-
InnoDB is not like an internal combustion engine. It doesn't need warming up. Perhaps you might like to rephrase the question so that it makes sense. – John Gardeniers Dec 21 '10 at 20:31
-
1Caches are part of high performance systems, and their performance is described by temperature. Even if InnoDB somehow doesnt have any caching, the OS does, so it's not a terrible thought. – jldugger Dec 21 '10 at 22:12
-
Maybe I should have used the term "preload" instead of "warmup." I didn't come up with this concept myself: see http://goo.gl/4z6mj and http://goo.gl/UC2o0 – smusumeche Dec 22 '10 at 04:32
1 Answers
1
You can simply open multiple connections to the database server from the same host or from several hosts. Then, you can split the INDEPENDENT queries over the established connections.
The InnoDB engine will take care of the required locking. As you may know, InnoDB engine supports row-level locking which will speedup the queries (compared to MyISAM) when there is a high contention (concurrent update/select queries).

Khaled
- 36,533
- 8
- 72
- 99
-
how would I go about opening multiple connections via an SSH terminal? – smusumeche Dec 22 '10 at 04:40
-
You can create a small PHP/perl script to execute a subset of the queries. Then, execute the script in background and run it again with the next subset of queries and so on. – Khaled Dec 22 '10 at 07:21
-
If you don't like/know scripting, you can using `mysql -uroot -pPassword DB_NAME < SQL_file1 &` to execute the 1st subset. Then, move on to the 2nd file and so on. – Khaled Dec 22 '10 at 07:22