Ich schreibe einen Bericht in SSRS, die eine lange Zeit dauert zu laufen. Hier ist, was passiert: Ich drücke um 9:46 Uhr auf den Knopf zum Ansehen von Berichten und um 9:56 Uhr sehe ich endlich, dass das Laden erscheint. Der Bericht erscheint dann eine Minute später. Ich steckte einige Debug-Displays in gibt, die sagt der folgende:Versucht, SSRS-Bericht Verzögerung herauszufinden
Start: 3/30/2016 9:56:16 AM
End: 3/30/2016 9:56:18 AM
Elapsed: 0:01
Also aus irgendeinem seltsamen Grund, SSRS 10 Minuten wartet, bevor der Bericht ausgeführt wird. Dies ist ein Problem, da der bereitgestellte Bericht ein Zeitlimit aufweist. Wie kann ich feststellen, was zwischen dem Drücken der Taste und dem Zeitpunkt der Verarbeitung des Berichts abläuft?
Zusätzlich: Die Protokolle zeigen nichts, das als ein Problem springt. SQL:
Term:
Select Term_Code, Term_Seq_Id, Start_Date, Long_Desc
From TERM
Where (End_Date Between '2004-05-07' AND GetDate())
Order By Term_Seq_Id Desc
RestrictionCount:
Select Count(*) as RestrictionCount from ReportUser Where LoginID = @User
Sektionen:
Select distinct Sctn_id_code, subj_code, crse_code, sctn_code, sctn_term_code
from siscrsi
where sctn_term_code = @Term and subj_code in (@Subject) and crse_code in (@Courses) and (Pid = @Instructors or @Instructors = '<ALL>')
order by sctn_term_code, subj_code, crse_code, sctn_code
Hochschulen:
If @RestrictionCount = 0
Select Coll_Code, Full_Name
From College
Order by Coll_Code
Else
Select Distinct c.Coll_Code, c.Full_Name
From College as c
Inner Join sirssoctonlineforms.dbo.ReportUser as ru on ru.Coll_Code = c.Coll_Code
Where ru.LoginID = @User
Order by Coll_Code
Themen:
Select distinct subj_code
From section_info
Where sctn_term_code = @Term and coll_code = @College and dept_code in (@Department)
order by subj_code
CoursesList:
Select Distinct Crse_Code, Subj_Code
From SISCRSI
Where Sctn_Term_Code = @Term
and Subj_Code = @Subject
and ((pid = @Instructors) or (@Instructors = '<ALL>'))
Order by Crse_Code
Instructors:
Select 'blank' as sctn_term_code, '<ALL>' as pid, '<ALL>' as name
union all
Select distinct sctn_term_code, pid, name
From sisinfo.dbo.SISCRSI instructor
where sctn_term_code = @Term
and subj_code = @Subject
order by name
Abteilungen:
If @RestrictionCount = 0
Select Dept_Code, Full_Name
From Dept
Where coll_code in (@College)
order by Dept_Code
Else
Select Distinct d.Dept_Code, Full_Name
From Dept d
Inner Join sirssoctonlineforms.dbo.ReportUser as ru on ru.Dept_code = d.Dept_Code
Where ru.LoginID = @User and d.Coll_Code in (@College)
Order by Dept_Code
Fragen:
Select count(*) as questionCount
From Questions q
Inner Join Form_Question fq on fq.Question_Id = q.Question_Id and q.Question_Format_Group <> 'Text'
Inner Join Response_Sets rs on rs.Form_Id = fq.Form_Id
Where rs.Sctn_Id_Code in (@SectionCodes)
NumberQuestions:
Select Top 1 dView.[Section Code], rSets.Form_ID, max(fq.Question_Order) as LastQuestion
From Denormalized_V as dView
Inner Join Response_sets as rSets on rSets.Sctn_ID_Code = dView.[Section Code]
Inner Join Form_Question as fq on fq.Form_ID = rSets.Form_ID
Where dView.[Section Code] in (@SectionCodes)
Group by [Section Code], rSets.Form_ID
Order by LastQuestion desc
InstructorPID:
If @Instructors = '<ALL>'
Select 'NoName' as Name, 'Z000000000' as pid
Else Begin
Select top 1 Name, pid
From SISCRSI
Where name = @Instructors
End
OptOutCount:
Select SectionInfo.Sctn_Id_Code as [Course Section ID], SectionInfo.Student_Cnt as [Total Students], Declined.Declined as [Total Declined]
From SECTION_INFO SectionInfo
Inner Join (
select Sctn_Id_Code, count(Sctn_Id_Code) as [Declined]
From declined
Where Form_Id > 1
and Sctn_ID_Code in (@SectionCodes)
Group By Sctn_Id_Code
) as Declined on SectionInfo.Sctn_Id_Code = Declined.Sctn_Id_Code
Der Hauptbericht Abfrage (das dauert weniger als drei Sekunden laufen):
If @nonTextQuestionCount > 0
Select *
From (
Select si.Sctn_Id_Code as [Section Code],
si.Subj_Code as [Subject],
si.Crse_Code as [Course], si.Sctn_Code as [Course Section],
fq.Question_Order as [Question Number],
Case r.Instructor_PID
When 'ALL' Then
@InstructorName
Else
CRSI.Name
End as [Instructor Name],
rs.Set_Id as [Respondent Code],
Case rp.reply_ID
When 1 Then
r.response
Else rp.Reply_Text
End as [Reply Text]
From SECTION_INFO si
Inner Join Response_Sets rs on si.sctn_id_code = rs.Sctn_Id_Code
Inner Join Responses r on r.Set_Id = rs.Set_Id
Inner Join Questions q on q.Question_Id = r.Question_Id
Inner Join Form_Question fq on fq.Question_Id = q.Question_Id and fq.Form_Id = rs.Form_Id
Inner Join Forms f on f.Form_Id = fq.Form_Id
Inner Join Replies rp on rp.Reply_Id = r.Reply_Id
Left Outer Join SISINFO..SISCRSI CRSI on CRSI.PID = r.Instructor_PID
and si.Sctn_Id_Code = CRSI.sctn_id_code
Where si.Sctn_Term_Code = @Term
and si.Subj_Code = @Subject and si.Crse_Code in (@Courses)
and ((@Instructors = '<ALL>') or (r.Instructor_PID = @Instructors or r.Instructor_PID = 'ALL'))
and si.Sctn_Code in (@Sections)
and fq.Form_Id <> 1
) as q1
Pivot (Max([Reply Text]) For [Question Number] in
([1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15], [16], [17], [18],
[19], [20], [21], [22], [23], [24], [25], [26], [27], [28], [29], [30], [31], [32], [33], [34], [35],
[36], [37], [38], [39], [40], [41], [42], [43], [44], [45], [46], [47], [48], [49], [50], [51], [52],
[53], [54], [55], [56], [57], [58], [59], [60], [61], [62], [63], [64]))
as p
group by subject, course, [subject], [course section], [Section Code], [Instructor_Pid],
[respondent code],[1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15],
[16], [17], [18], [19], [20], [21], [22], [23], [24], [25], [26], [27], [28], [29], [30], [31],
[32], [33], [34], [35], [36], [37], [38], [39], [40], [41], [42], [43], [44], [45], [46], [47],
[48], [49], [50], [51], [52], [53], [54], [55], [56], [57], [58], [59], [60], [61], [62], [63], [64]
order by [subject], [course], [course section]
Else
Select * From
(
Select rSets.set_id, dView.[Course section], dView.[Subject], dView.Course, dView.[Instructor pid],
answers.response, formQuestion.Question_Order, dView.[Section Code]
From Denormalized_V as dView
Inner Join response_sets as rSets on rSets.sctn_id_code = dView.[section code]
Inner Join responses as answers on answers.set_id = rSets.set_id
Inner Join questions as questions on questions.question_id = answers.question_id
Inner Join form_question as formQuestion on formQuestion.question_id = questions.question_id
where Term = @Term and
[Subject] = @Subject and
Course in (@Courses) and
((@Instructors = '<ALL>') or (dView.[Instructor Pid] = @Instructors or dView.[Instructor Pid] = 'ALL')) and
dView.[Course Section] in (@Sections) and dView.[Survey Type] <> 'SOCT'
) t
Pivot (max(response) for question_order in ([1], [2], [3], [4], [5], [6], [7], [8])) as pvt
Warum veröffentlichen Sie die Abfrage nicht für jeden Datensatz, damit wir sehen können, was Ihren Bericht verlangsamt. – SnakeFoot
Ich fügte die 14 Abfragen wie angefordert hinzu. –
Woher hast du das Log? Ist es möglich, dass Sie auf die ReportServerService-Protokolldatei in Ihrem SSRS-Ordner zugreifen und dann überprüfen können, wann die Sitzung gerendert wurde? – cqi