I have a simple stored procedure that looks like this
SELECT * FROM CUSTOMERS ORDER BY LASTNAME , FIRSTNAME
The customer table has over 100 fields.
It returns 20K records, I have an index on lastname, firstname.
The execution plan say 46% Sort, 54% table scan.
It appears to take 25 -45 seconds to run . When called and traced in Activity Monitor from a web app. In Query analyzer it takes 10 seconds. Any suggestions how I can speed it up.