如何优化SQL语句,提高查询速度 急!! ALTER PROCEDURE [dbo].[GetLEDShowData] as select rank () over (order by testtime desc) xh,Stationinfo.StationName,Report.Dpress,ZDayDunShuiHaoDian.Consumption1,History.* from History left join Stationinfo on History.StationName=Stationinfo.Agreement left join Report on Report.StationName=History.StationName left join ZDayDunShuiHaoDian on ZDayDunShuiHaoDian.StationName=History.StationName where History.ID in(select max(ID) from History group by StationName) and Report.ID in(select max(ID) FROM Report group by StationName) and ZDayDunShuiHaoDian.ID in(select max(ID) from ZDayDunShuiHaoDian group by StationName) order by Testtime desc 这是我写的SQL存储过程,在SQL 2005中运行好几分钟才能查出数据来。如果要是在C#中调用那就更慢了。如果更改才能提高查询速度呢?急!