I had an interesting case recently. The customer dealing with large MySQL data warehouse had the table which was had data merged into it with INSERT ON DUPLICATE KEY UPDATE statements. The performance was extremely slow. I turned out it is caused by hundreds of daily partitions created for this table. What is the most interesting (and surprising) not every statement is affected equally as you can see from the benchmarks above:
I got the following test table created:
PLAIN TEXT SQL:
- CREATE TABLE `p10` (
- `id` int(10) UNSIGNED NOT NULL,
- `c` int(10) UNSIGNED NOT NULL,
- PRIMARY KEY (`id`),
- KEY(c)
- ) ENGINE=InnoDB
- PARTITION BY RANGE(id) (
- …