7 月 212015
 

新分区数量不变,老分局数据加倍,看新分区的性能是否收到影响。

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。还是有影响的。

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny