SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSRS Faster than Management Studio!?


SSRS Faster than Management Studio!?

Author
Message
Oblivion
Oblivion
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 68
Hi all,

When I run a stored procedure as a direct query in Management studio it's taking ~18 seconds to complete, however when I run the exact same stored procedure in SSRS it's taking about 3 seconds for the query to be called and the report to fully render. I could understand if it was the other way around, but I'm a bit baffled by this. Any ideas?

Thanks.
sql_lock
sql_lock
Hall of Fame
Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)

Group: General Forum Members
Points: 3353 Visits: 1999
In that past I see this for 2 reasons

1 - "SET" option differ in SSMS than the default connection to the server i.e. ARITHMETIC ABORT (check server setting and your query options within SSMS)

2 - If you are debugging the SP and provide local variables then I have also seen a different execution plan selected.
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)

Group: General Forum Members
Points: 63246 Visits: 13298
Another side effect from SSMS is that it has to display all the rows in the result set. It might do it not so efficiently as SSRS.
(just a wild guess here)

Anyway, to really compare you would have to take a look at the execution plan and rule out caching as well.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Oblivion
Oblivion
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 68
Koen Verbeeck (4/9/2014)
Another side effect from SSMS is that it has to display all the rows in the result set. It might do it not so efficiently as SSRS.
(just a wild guess here)

Anyway, to really compare you would have to take a look at the execution plan and rule out caching as well.


I'm not sure how to check the execution plan for the procedure when it's called from Reporting Services as I've not looked at that before. Is there an easy way?

Caching is disabled on the reporting, and if I change aspects of the stored procedure the changes are reflected live in the report on a normal report refresh, so I'm confident there's no caching going on.
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)

Group: General Forum Members
Points: 63246 Visits: 13298
Oblivion (4/9/2014)
Koen Verbeeck (4/9/2014)
Another side effect from SSMS is that it has to display all the rows in the result set. It might do it not so efficiently as SSRS.
(just a wild guess here)

Anyway, to really compare you would have to take a look at the execution plan and rule out caching as well.


I'm not sure how to check the execution plan for the procedure when it's called from Reporting Services as I've not looked at that before. Is there an easy way?


I think you can capture it using Profiler. (at least the query)
The plan might be retrieved from a DMV as well, but that's a bit out of my comfort zone.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
sql_lock
sql_lock
Hall of Fame
Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)

Group: General Forum Members
Points: 3353 Visits: 1999
If it is currently in the cache then use the query below (replacing the check with your SP name).

SELECT  UseCounts ,
Objtype ,
[text] ,
query_plan
FROM sys.dm_exec_cached_plans
CROSS APPLY sys.dm_exec_sql_text(plan_handle)
CROSS APPLY sys.dm_exec_query_plan(plan_handle)
WHERE [text] LIKE '%check%'



Note: It can take a while to run, so please plan accordingly.
g.britton
g.britton
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3249 Visits: 1763
SSRS designer caches query results by default. So, if it has cached results, it won't rerun the query at all

Gerald Britton, MCSE-DP, MVP
Toronto PASS Chapter
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search