新分区数量不变,老分局数据加倍,看新分区的性能是否收到影响。
mysql> explain partitions select * from test_2 where name > 100000 \G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: test_2
partitions: p2
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 197735
Extra: Using where
1 row in set (0.00 sec)
mysql> explain partitions select * from test_2 where name < 100000 \G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: test_2
partitions: p1
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 110573
Extra: Using where
1 row in set (0.00 sec)
Tue Jul 21 15:16:39 CST 2015
end Tue Jul 21 15:18:24 CST 2015
插入5000行:01:45
mysql> explain partitions select * from test_2 where name > 100000 \G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: test_2
partitions: p2
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 2590496
Extra: Using where
1 row in set (0.00 sec)
mysql> explain partitions select * from test_2 where name < 100000 \G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: test_2
partitions: p1
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 115499
Extra: Using where
1 row in set (0.00 sec)
Tue Jul 21 16:25:40 CST 2015
end Tue Jul 21 16:28:24 CST 2015
插入5000行: 2:44
测试下来发现,p2分区数据从110573 加到 2590496时候,p1分区插入5000行的时间从01:45 变成了 2:44。还是有影响的。