I have the following query that runs quickly (0.5 secs):
select ZipListMatrix.Z ipListMatrixID, ZipListMatrix.Z ipID,
ZipListMatrix.C arrierRouteID,Z ipListMatrix.Li stID,
ZipListMatrix.Q uantity,List.Di splayOrder
from ZipListMatrix
join List
join UserList on List.ListID = UserList.ListID
on ZipListMatrix.L istID = List.ListID
where UserList.UserIn foID = 869
and ZipListMatrix.Z ipID = 23112
order by ZipListMatrix.Z ipID
But as soon as I change the order by to "order by ZipListMatrix.Z ipID,
ZipListMatrix.L istID" the query runs very slow (7.5 secs).
The table ZipListMatrix has 3.3 million records. I have indexes on ZipID,
ListID
When I do an "explain".. .I see the dreaded: Using Temporary, Using Filesort
Can anyone help? I don't know what to do to speed up the query!
-bruce duncan