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


sp approach for SSRS with Extra Select, does it make any sense?


sp approach for SSRS with Extra Select, does it make any sense?

Author
Message
mario17
mario17
SSC-Addicted
SSC-Addicted (472 reputation)SSC-Addicted (472 reputation)SSC-Addicted (472 reputation)SSC-Addicted (472 reputation)SSC-Addicted (472 reputation)SSC-Addicted (472 reputation)SSC-Addicted (472 reputation)SSC-Addicted (472 reputation)

Group: General Forum Members
Points: 472 Visits: 683
Hi,

I'm working on new site now and we have a req that all sp for our SSRS reports utilized that approach, the very last SELECT comes from predefined #SSRSTable, so local sp are very bigin terms of number of lines, rationale behind this is that SSRS will be able to update columns/fields if any change happened in dataset (?).

I know that it's not true but probably there are some other reasons I'm not aware of ? Not counting that local dbd paid by line? :-) I always try to make my sp compact and optimized in terms of everything.

Thansk for your feedback.
Mmario

This is our typical structure of sp:

Create sp..

Create Table #SSSRTable ( -- ????
c1 ...
c2...
c3)

INSERT #SSSRTable --- ???
SELECT C1,c2,c3 FROM source s -- all main logic is here
JOIN 1..
JOIN 2..
Join 3.

SELECT C1, C2, C3 --- ???
FROM #SSSRTable
END


cafescott
cafescott
SSC-Addicted
SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)

Group: General Forum Members
Points: 400 Visits: 733
I think the merits of this approach depend on the details. Obviously, if you create a temp table, then insert data into it via a join, then query the temp table, this takes extra time than if you performed the query without the temp table. However, does the extra time matter?

I once worked on a long stored procedure with various persistent tables and a junior programmer told me that I should remove these to improve performance. I replied that since the routine is running in the morning that there is no need to save the extra milliseconds; and meanwhile, I had the data in persistent tables in case something was wrong, and I could quickly find what the issue was. The primary goal of the routine was accuracy, and if there was any problem with my final output my job could be at risk unless I could figure out the issue ASAP.

Performance isn't everything. It all depends on what is the highest priority for what you are doing.
mario17
mario17
SSC-Addicted
SSC-Addicted (472 reputation)SSC-Addicted (472 reputation)SSC-Addicted (472 reputation)SSC-Addicted (472 reputation)SSC-Addicted (472 reputation)SSC-Addicted (472 reputation)SSC-Addicted (472 reputation)SSC-Addicted (472 reputation)

Group: General Forum Members
Points: 472 Visits: 683
After training in query tuning and getting all time and io statistics, I confirmed that it doesn't make any sense to do this anymore, starting from SQLSERver 2008.
It's just plain overhead.

M
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