Creating or dropping a partitioned table on InnoDB can become a quite expensive operation, on my laptop i'm seeing the following times for a simple table with 100 or 1000 partitions (using 5.1.58 right now as i'm testing on stock Ubuntu 11.10):
mysql> CREATE TABLE t1 (id INT PRIMARY KEY )
engine=innodb PARTITION BY HASH(id) PARTITIONS 100;
Query OK, 0 rows affected (5.21 sec)
mysql> drop table t1;
Query OK, 0 rows affected (5.11 sec)
mysql> CREATE TABLE t1 (id INT PRIMARY KEY )
engine=innodb PARTITION BY HASH(id) PARTITIONS 1000;
Query OK, 0 rows affected (52.76 sec)
So the time to create a partitioned InnoDB table grows linearly with the number of partitions at a 'speed' of about 20 partitions per second, and during that time the hard disk LED is always on. The rate for creating regular InnoDB tables on this machine is about 10 tables per second by the way.
MyIsam on …
[Read more]