We're using SQL Server 2005 with Reporting Services.
We have a number of reports, each containing a relatively simple SQL query - by "relatively" I mean that we do have a few joins, but nothing worse than that. We do not call any stored procedures in our queries - this is not a case of parameter sniffing.
When executing one of these reports (let's call it report A) through Reporting Services, it takes an extremely long time to complete - on the order of tens of minutes or even hours. When executing the corresponding SQL query in Query Analyzer, it completes in a few seconds.
The number of rows returned from the database can be as few as 1 - yet, the report never completes.
The other reports are working fine.
Looking in the ExecutionLog table on the Reporting Services, I can see that most of the time is in TimeDataRetrieval (and we're talking millions of seconds here...) - those times the report actually completes. If the report is manually aborted, TimeDataRetrieveal is zero and TimeProcessing is absurdly high instead.
I've looked into the logs of Reporting Services, but everything looks normal.
Now, before you start suggesting "lock" - well, our queries do have the nolock hint turned on.
As it stands, I've reached the limit of my imagination trying to find the error. Any thoughts, insights would be gladly appreciated.
/Christoffer