I have a problem ,when rebuild or update statistics is complete for some tables after that at first time when i run my query(select query) ,it runs too slowly and duration of this query is about 30 min ,but after that when i run it again duration is about 3 sec ,how to solve it ?
i set statistics IO on query and got this results :
--Second Time
Table 'table1'. Scan count 42, logical reads 963118, physical reads 0, read-ahead reads 274, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
--First Time
Table 'table1'. Scan count 42, logical reads 977019, physical reads 1143, read-ahead reads 946797, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.