I have a sql(2005) view which is running very very slow its takes 5 mins to run. But when i rip out the query from view and run it naked it hardly takes 5-6 seconds.
Can some one please advise me on how i can check what’s going wrong with the view
Thanks
Amit
As a first step I would ensure your statistics are up to date:
or use UPDATE STATISTICS which is what exec sp_updatestats calls under the covers (with ALL parameter).
If that doesn’t help, then examine the query plans for differences.