zoukankan      html  css  js  c++  java
  • mysql 执行计划走分区

    mysql> EXPLAIN PARTITIONS   select count(*) from  history where clock<1438876800;
    +----+-------------+---------+------------+-------+---------------+-----------+---------+------+------+--------------------------+
    | id | select_type | table   | partitions | type  | possible_keys | key       | key_len | ref  | rows | Extra                    |
    +----+-------------+---------+------------+-------+---------------+-----------+---------+------+------+--------------------------+
    |  1 | SIMPLE      | history | p20150806  | index | NULL          | history_1 | 12      | NULL | 5250 | Using where; Using index |
    +----+-------------+---------+------------+-------+---------------+-----------+---------+------+------+--------------------------+
    1 row in set (0.00 sec)
    
    mysql>  EXPLAIN PARTITIONS   select count(*) from  history where clock<143899999;
    +----+-------------+---------+------------+-------+---------------+-----------+---------+------+------+--------------------------+
    | id | select_type | table   | partitions | type  | possible_keys | key       | key_len | ref  | rows | Extra                    |
    +----+-------------+---------+------------+-------+---------------+-----------+---------+------+------+--------------------------+
    |  1 | SIMPLE      | history | p20150806  | index | NULL          | history_1 | 12      | NULL | 5250 | Using where; Using index |
    +----+-------------+---------+------------+-------+---------------+-----------+---------+------+------+--------------------------+
    1 row in set (0.00 sec)
    
    mysql>  EXPLAIN PARTITIONS   select count(*) from  history where clock<1439049600;
    +----+-------------+---------+-------------------------------+-------+---------------+-----------+---------+------+-------+--------------------------+
    | id | select_type | table   | partitions                    | type  | possible_keys | key       | key_len | ref  | rows  | Extra                    |
    +----+-------------+---------+-------------------------------+-------+---------------+-----------+---------+------+-------+--------------------------+
    |  1 | SIMPLE      | history | p20150806,p20150807,p20150808 | index | NULL          | history_1 | 12      | NULL | 71310 | Using where; Using index |
    +----+-------------+---------+-------------------------------+-------+---------------+-----------+---------+------+-------+--------------------------+
    1 row in set (0.00 sec)

  • 相关阅读:
    Core Text 实现富文本显示
    音视频直播服务平台总结
    WWDC2017那些事
    Swift网络请求(Moya篇)
    [转贴]孙正耀退休感言
    不要让专业限制了你的高度
    你会搞科研吗?
    上传服务端
    AysnTask+HttpClient实现上传
    TextView改变颜色
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13351468.html
Copyright © 2011-2022 走看看