• 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)

  • 相关阅读:
    实现实体类和Xml相互转化
    创建型设计模式之原型模式(Prototype)
    创建型设计模式之建造者模式(Builder)
    行为型设计模式之状态模式(State)
    行为型设计模式之职责链模式(Chain of Responsibility)
    行为型设计模式之解释器模式(Interpreter)
    行为型设计模式之模板方法(Template Method)
    结构型设计模式之享元模式(Flyweight)
    结构型设计模式之外观模式(Facade)
    获取必应壁纸
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13351468.html
Copyright © 2020-2023  润新知