开发者

MYSQL using temporary when Group By

I have this query:

开发者_运维问答
SELECT m.Number
FROM table m
WHERE m.IdA = _IdA
    AND m.IdB = _IdB
    AND m.IdC = _IdC
GROUP BY m.Number
ORDER BY m.Number;

Where _IdA, _IdB & _IdC are the parameters. If I check it with EXPLAIN it says no using temporary, but if the values of those parameters doesn't return any row EXPLAIN says "using temporary"

I'd like to avoid using temporary....Any ideas?


Create a composite index (IdA, IdB, IdC, Number).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜