标签:art 参考 efault cond from clu date simple exists
参考 https://dev.mysql.com/doc/refman/5.7/en/optimizer-hints.html
Hint Name | Description | Applicable Scopes |
---|---|---|
BKA, NO_BKA | Affects Batched Key Access join processing | Query block, table |
BNL, NO_BNL | Affects Block Nested-Loop join processing | Query block, table |
MAX_EXECUTION_TIME | Limits statement execution time | Global |
MRR, NO_MRR | Affects Multi-Range Read optimization | Table, index |
NO_ICP | Affects Index Condition Pushdown optimization | Table, index |
NO_RANGE_OPTIMIZATION | Affects range optimization | Table, index |
QB_NAME | Assigns name to query block | Query block |
SEMIJOIN, NO_SEMIJOIN | Affects semijoin strategies | Query block |
SUBQUERY | Affects materialization, IN-to-EXISTS subquery stratgies | Query block |
表级hint,
索引级别的hint
子查询的hint
控制SQL执行时间的hint
还有个QB_NAME(name)没搞明白。。。
测试了下,好像故意写错了,也没什么影响
mysql> explain select /*+ BNA(fuck_wisedu)*/ a.clusterid,a.ip,a.bak_date,a.start_time,a.end_time,state from mysql_backup_job a left join mysql_conf b on a.ip=b.ip where bak_date = ‘2020-07-08‘ and b.group_id=‘23333‘ and state = ‘OK‘ ;
+----+-------------+-------+------------+------+-------------------------------------------------------+-------------------------------+---------+----------------+-------+----------+------------------------------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+-------+------------+------+-------------------------------------------------------+-------------------------------+---------+----------------+-------+----------+------------------------------------+
| 1 | SIMPLE | a | NULL | ref | ip_idx,date_idx | date_idx | 3 | const | 15574 | 10.00 | Using where |
| 1 | SIMPLE | b | NULL | ref | IDX_IP | IDX_IP | 47 | mysql_bak.a.ip | 1 | 10.00 | Using index condition; Using where |
+----+-------------+-------+------------+------+-------------------------------------------------------+-------------------------------+---------+----------------+-------+----------+------------------------------------+
2 rows in set, 1 warning (0.00 sec)
标签:art 参考 efault cond from clu date simple exists
原文地址:https://www.cnblogs.com/Coye/p/13269666.html