0

We're using SSRS 2012 with a number of reports driven by a Query.CommandText reference to a stored procedure executing dynamic sql (sp-executesql). These are consumed from a web application where the user specifies the report, criteria, etc. After a few days, the report requests will timeout, even though the underlying stored procedure executes within a few seconds (the same stored procedure feeds a search result screen and the report). Other reports that do not use dynamic sql continue to execute fine. The only remedy we've found is to restart the SSRS service. After the initial spin-up, the same report will execute within a few seconds.

The SSRS logs don't seem point to any issue, though I'm certainly not an expert reading them. Comparing a slow to a quick one only seems to differ by the time stamps evenly spread out between the start and the end. We do see "ReportProcessingException: There is no data for the field at position xx", but on both the slow and fast runs. Running the report from the Reports portal takes about 10 minutes when it's in slow mode.

My suspicion is that some caching is going on and SSRS is influencing the SQL execution plan.

Any suggestions or requests for more specifics would be very welcome.

Reuven Trabin
  • 451
  • 7
  • 18
  • Lookup parameter sniffing. If you are using stored procedure then lookup OPTIMIZE FOR UKNOWN as a solution. I recently learned that dynamic queries in SSRS can also fall victim of parameter sniffing. – Ross Bush Jun 04 '14 at 01:49
  • Try adding the hint OPTION (RECOMPILE). Also run sp_updatestats. – Mike Honey Jun 04 '14 at 04:10
  • Thanks for the suggestions. I'm waiting for the timeout condition to occur again to test these (before I restart SSRS). Since the stored procedure that populates the report is the same that is used on the web page to search and report, I would think the execution plan would be the same, which still leaves this question open in my mind. I'll provide more details when I have them. – Reuven Trabin Jun 04 '14 at 23:36

0 Answers0