跟一个朋友,不错公司的主管交流时,对于mysql中条件查询和排序时 与索引的关系
mysql> explain select * from article where title='希望光伏企业挺过2个月' o
rder by id desc\\\\\\\\G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: article
type: index
possible_keys: NULL
key: PRIMARY
key_len: 4
ref: NULL
rows: 567
Extra: Using where
1 row in set (0.00 sec)
mysql> select * from article where title='希望光伏企业挺过2个月';
+----+-------------+---------+--------+-----------------------------+----------+
-----------+-------+-------------+---------+---------+--------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------+--------+--
---------+--------+------------+------------+
| id | category_id | user_id | app_id | title | subtitle |
professor | money | cooperation | project | address | discription