none
SSRS Performance

    Question

  • Can't seem to find anything on the internet but I had a quick question.  I created a view with some joins in it.  I have a ssrs report that will be pulling form this view.  Would there be a performance difference pulling from a view vs writing the code behind the view in the dataset?  My assumption is pulling from a view may be quicker vs submitting that query through the network. 

    thanks.


    Mike

    Wednesday, December 11, 2013 1:46 PM

Answers

  • Here is a good discussion on this topic. (http://stackoverflow.com/questions/439056/is-a-view-faster-than-a-simple-query) Generally, in my experience a View can add a performance boost, but is also reusable. If the view is indexed you can see dramatic increases in performance.
    • Marked as answer by mr4100 Wednesday, December 11, 2013 3:37 PM
    Wednesday, December 11, 2013 3:08 PM

All replies

  • Here is a good discussion on this topic. (http://stackoverflow.com/questions/439056/is-a-view-faster-than-a-simple-query) Generally, in my experience a View can add a performance boost, but is also reusable. If the view is indexed you can see dramatic increases in performance.
    • Marked as answer by mr4100 Wednesday, December 11, 2013 3:37 PM
    Wednesday, December 11, 2013 3:08 PM
  • I'll have to disagree with the first response.  There should be no difference, generally speaking.  That linked discussion is both confusing and, IMO, poorly argued.  Your question, and the one in the link, ask a simple question with no additional qualifications.  The "answer" in the linked discussion is based on indexed views and a lot of specific situations - not all of them the same.  An indexed view is not the same thing as using "the code behind the view", so the comparison is one of apples to oranges.  In addition, nothing is ever free in the database.  The boost you get with an indexed view has a cost - so you need to weigh the benefit vs. the cost. 

    Reading the linked discussion should give you some things to consider - your reasoning for creating the view, how it will be used, how it will be RE-used, etc. If we ignore indexed view, then I can see no reason why a view should improve performance.  If you are really interested, you can try both techniques and compare - which is always a useful thing to do when in doubt.  And finally, sql server has its share of bugs so there may be some situations where a view performs better (or worse) than the underlying query.  Here is one old example where the view performed worse (including explanation):

    select from view slower

    Wednesday, December 11, 2013 3:43 PM
  • I did a test and it seems the view was a tad quicker kicking back the results.  In my situation, the view has better performance for me.  Thanks everyone for your input.


    Mike

    Wednesday, December 11, 2013 6:30 PM