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

  • 相关阅读:
    Win10 下使用 ionic 框架开发 android 应用之搭载开发环境
    C# 图片压缩
    [安卓应用发布]HOLO一键锁屏
    SRS中增加身份验证
    实际搭建SRS测试的初步问题总结
    推荐一款优秀的开源流媒体服务器系统:SRS(Simple RTMP Server)
    C#--格式化数值数据
    操作系统学习笔记系列(二)-操作系统结构
    操作系统学习笔记系列(一)- 导论
    C语言文件读写
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13351468.html
Copyright © 2020-2023  润新知