• Mysql explain 查看分区表


    mysql> explain select * from ClientActionTrack where startTime>'2016-08-25 00:00:00' and startTime<'2016-08-25 23:59:00';
    +----+-------------+-------------------+------+---------------+------+---------+------+-------+-------------+
    | id | select_type | table             | type | possible_keys | key  | key_len | ref  | rows  | Extra       |
    +----+-------------+-------------------+------+---------------+------+---------+------+-------+-------------+
    |  1 | SIMPLE      | ClientActionTrack | ALL  | NULL          | NULL | NULL    | NULL | 33868 | Using where |
    +----+-------------+-------------------+------+---------------+------+---------+------+-------+-------------+
    1 row in set (0.00 sec)
    
    
    mysql> explain extended select * from ClientActionTrack where startTime>'2016-08-25 00:00:00' and startTime<'2016-08-25 23:59:00';
    +----+-------------+-------------------+------+---------------+------+---------+------+-------+----------+-------------+
    | id | select_type | table             | type | possible_keys | key  | key_len | ref  | rows  | filtered | Extra       |
    +----+-------------+-------------------+------+---------------+------+---------+------+-------+----------+-------------+
    |  1 | SIMPLE      | ClientActionTrack | ALL  | NULL          | NULL | NULL    | NULL | 33868 |   100.00 | Using where |
    +----+-------------+-------------------+------+---------------+------+---------+------+-------+----------+-------------+
    1 row in set, 1 warning (0.00 sec)
    
    mysql> explain partitions select * from ClientActionTrack where startTime>'2016-08-25 00:00:00' and startTime<'2016-08-25 23:59:00';
    +----+-------------+-------------------+------------+------+---------------+------+---------+------+-------+-------------+
    | id | select_type | table             | partitions | type | possible_keys | key  | key_len | ref  | rows  | Extra       |
    +----+-------------+-------------------+------------+------+---------------+------+---------+------+-------+-------------+
    |  1 | SIMPLE      | ClientActionTrack | p20160825  | ALL  | NULL          | NULL | NULL    | NULL | 33868 | Using where |
    +----+-------------+-------------------+------------+------+---------------+------+---------+------+-------+-------------+
    1 row in set (0.00 sec)
    
    
    
    mysql> explain partitions SELECT *  from ClientActionTrack  PARTITION (p20160825);
    +----+-------------+-------------------+------------+------+---------------+------+---------+------+-------+-------+
    | id | select_type | table             | partitions | type | possible_keys | key  | key_len | ref  | rows  | Extra |
    +----+-------------+-------------------+------------+------+---------------+------+---------+------+-------+-------+
    |  1 | SIMPLE      | ClientActionTrack | p20160825  | ALL  | NULL          | NULL | NULL    | NULL | 33868 | NULL  |
    +----+-------------+-------------------+------------+------+---------------+------+---------+------+-------+-------+
    1 row in set (0.00 sec)

  • 相关阅读:
    oracle的nvl和sql server的isnull
    Distinct和Group by去除重复字段记录
    shell(2):正则表达式
    一把年纪时,我决定学习区块链
    到这个年纪为什么我还要开始学习理解参与区块链?
    孤荷凌寒自学python第八十六天对selenium模块进行较详细的了解
    孤荷凌寒自学python第八十五天配置selenium并进行模拟浏览器操作1
    孤荷凌寒自学python第八十四天搭建jTessBoxEditor来训练tesseract模块
    孤荷凌寒自学python第八十三天初次接触ocr配置tesseract环境
    孤荷凌寒自学python第八十二天学习爬取图片2
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13350354.html
Copyright © 2020-2023  润新知