Procedure taking long time to exeucte

Sunil 2016-12-12 23:59:22


This SP taking long time to get results. Basically in the main select query I am using one view and in that view i am using one scalar function. That causing the problem and I can't avoid that function call in the view. Is there any way I can increase the performance of this SP.


Aaron Bertrand 2017-01-08 17:13:58
The expensive index scan in the SELECT TOP 1 query (the one with the estimated cost of 28.0% relative to the batch) is caused by an RTRIM() operation against the ACCT_ID column in dbo.IVW_ACCT. Why is this RTRIM() operation necessary?