Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

sp approach for SSRS with Extra Select, does it make any sense? Expand / Collapse
Author
Message
Posted Wednesday, June 4, 2014 9:23 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, November 20, 2014 11:58 AM
Points: 194, Visits: 483
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

Post #1577392
Posted Wednesday, June 4, 2014 9:59 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, November 13, 2014 9:37 AM
Points: 160, Visits: 704
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.
Post #1577403
Posted Thursday, June 19, 2014 4:56 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, November 20, 2014 11:58 AM
Points: 194, Visits: 483
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
Post #1584091
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse