I have a 2 gb mysql table with 500k rows and I run the following query on a system with no load.
select * from mytable
where name in ('n1', 'n2', 'n3', 'n4', ... bunch more... )
order by salary
It takes a filesort and between 50 and 70 seconds to complete.
When removing the order by salary and doing the sorting in the application, the total runtime (including the sorting) cuts to about 25-30 seconds. But that's still far too much.
Any idea how I can speed this up?
Thank you.