I need help to improve the performance of this view

This view returns around 380K rows and it takes around 2 minutes. There is not really a baseline to tell ,if it is slow or fast , but the goal is the improve its performance. The only tweak I did is the replacement of ' distinct' with 'Group bys'. Any pointers towards tweaking this query will be helpful.

avatar image By Amey 1 asked Nov 13 at 04:29 PM
more ▼
(comments are locked)
avatar image Aaron Bertrand ♦ Nov 30 at 05:48 PM

Returns 380K rows to where? An SSMS grid? Does it make sense to return 380K rows to anything? You might consider not returning all 380K rows anywhere and instead implement paging - 100 or 1000 rows at a time. It's possible your perception of "slow" is because it takes 2 minutes to return all the data across the network and render it in some grid, not because the query is slow or there is anything wrong with the view.

10|10000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 50 attachments (including images) can be used with a maximum of 209.7 MB each and 209.7 MB total.