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
).
精彩评论