Reputation: 957
We have a development server which runs SQL Server 2012 (SQL Server 11.0.2100)
. We have configured separate SSRS
instance as we are running multiple projects on the same server.
SQL Server: WIN-SRVR\SQL2012 SSRS Instance: WIN-SRVR\SQL2012SSRS
We have a database in 2012 instance. SSRS
instance Dataset pointing to 2012.
Now the scenario is when we execute stored procedure it takes less than 1 second to return the dataset. while the same report takes almost 10 mins to render on the page. I have tried to generate directly from http:// WIN-SRVR/Reportserver2012
from the browser as well as Report Builder. Every time it takes a lot of time to display the report.
Points I have checked are:
Activity Monitor shows one suspended query while generating this.
ReportServer.dbo.GetSessionData;1
I could see expensive or waiting query is: EXEC #am_get_querystats
Checked for resource locking on the databases and this shows that ReportServer.dbo.GetSessionData;1 is getting blocked by ReportServer.dbo.WriteLockSession;1. This continues for ~ 2 minutes the lock is released and the report finishes generating.
Troubleshoot I have tried
Nothing helps.
Following are the screenshot of Activity Monitor
Anyone having an idea why does this happen when SQL query doesn't take any time. but report rendering takes a lot of time to display the data.
DECLARE @fromdate VARCHAR(50)
DECLARE @todate VARCHAR(50)
DECLARE @usagetypeid NVARCHAR(10)
DECLARE @paytype INT
DECLARE @userid INT
SET @fromdate = '01/01/2017'
SET @todate = '09/06/2017'
SET @usagetypeid = '0'
SET @paytype = 0
SET @userid = 1
SELECT CONVERT(VARCHAR, pb.PaymentDate, 103) AS PaymentDate ,
pm.OldFormNo AS PropertyFormNo ,
ROUND(CAST(pb.ReceiptNo AS NUMERIC), 0) AS ReceiptNo ,
ISNULL(pm.OwnerFirstName, '') + ' ' + ISNULL(pm.OwnerMiddleName, '')
+ ' ' + ISNULL(pm.OwnerLastName, '') AS UserPersonName ,
pm.OwnerFirstName AS 'OwnerFirstName' ,
pb.PaidAmount ,
pb.PayableAmount ,
pb.ChequeDDno AS ChequeNo ,
pb.BillPaymentId
FROM propertymaster pm
JOIN PropertyBillPayment pb ON pm.PropertyId = pb.PropertyId
WHERE pb.PaymentDate BETWEEN CONVERT(DATE, @fromdate)
AND CONVERT(DATE, @todate)
AND pm.UsageTypeId = CASE WHEN @usagetypeid = 0 THEN pm.UsageTypeId
ELSE @usagetypeid
END
AND pb.isDeleted = 0
AND pb.cancel = 0
ORDER BY pb.PaymentDate DESC
Upvotes: 2
Views: 4830
Reputation: 8697
The first step is to find out what takes so much time, you can find it using ExecutionLog3 view of your ReportServer database. This view contains TimeDataRetrieval, TimeProcessing and TimeRendering columns and you can filter it by TimeStart and ItemPath.
Onced you know for sure it's rendering you can investigate on pagination. If instead it's TimeDataRetrieval than you should tune your query
Upvotes: 1