利用EXPLAIN处理以下询问:
SELECT cha.cid AS cid,
cha.data AS dl
FROM cha, c_users
WHERE uid = 808
AND cha.cid = c_users.cid;
- it does a full scan on
cha
table - uses the multi column index(
cid
,uid
) fromc_users
.
为什么不使用<代码>cha的主要指数,而是用完整的表格扫描。 是否有更好的办法选择询问/表。
Edit: cha.cid is my primary key. Added after the comment below.