I am not getting the reason why query 1 is taking 10 seconds,query 2 and query 3 taking 1 second to execute even if they are same only order is different
1.SELECT TOP 10000 * FROM tbl1
WHERE
len(empid) = 4 and
isnumeric(empid) = 1 ORDER BY empid desc
2.SELECT TOP 10000 * FROM tbl1
WHERE
len(Employee_ID) = 4 and
isnumeric(empid) = 1
3.SELECT TOP 10000 * FROM tbl1
WHERE
len(empid) = 4 and
isnumeric(empid) = 1 ORDER BY empid


Bikesh SrivastavaRank #108 · 20.3K reputationPosted Aug 4, 2016, 4:34 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 4, 2016, 4:43 AM EDT
Tapan PatelRank #614 · 3.9K reputationPosted Aug 4, 2016, 4:56 AM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Aug 4, 2016, 4:56 AM EDT
Jisny AvRank #4,868 · 321 reputationPosted Aug 11, 2016, 2:43 AM EDT