SQL添加order by后性能非常慢(也有可能是查询条件)!求高手帮忙优化下。。。 SELECT TOP 50 * FROM vw_App_Appointment WHERE 1 = 1 AND user_department_id = 1000 ORDER BY appointment_id DESC
此句代码时候后,执行时间非常慢,大于需要40多S。
SELECT TOP 50 * FROM vw_App_Appointment WHERE 1 = 1 AND user_department_id = 1000
SELECT TOP 50 * FROM vw_App_Appointment ORDER BY appointment_id DESC
而当这两句分别执行时候,大约也就1S左右。