Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If a report uses multiple tables it should not appear on SQL Perf Main report when not all tables are present #232

Closed
PiJoCoder opened this issue May 10, 2023 · 2 comments
Assignees
Labels
wave 3 - complete consider this issue for next wave of fixes

Comments

@PiJoCoder
Copy link
Collaborator

In this case there are multiple tables in the report datasets. So if one of the tables are missing, but the main one is there - dbo.tbl_dm_db_file_space_usage, the report will be shown as clickable in the SQL Perf Main

insert into @tbl_reports (ReportName, ReportDisplayName, ReportDescription, VersionApplied, Category, ValidationObject, SeqNo, DataCollection,Manditory, CategorySeq)
values ('Tempdb_Space_Use_C', 'Tempdb Space Usage', 'Breakdown of space usage in tempdb', 1|2|4|8, 'Performance', 'dbo.tbl_dm_db_file_space_usage', 4000, 'Tempdb and Trans Collector', 1,3000)

And yet when you click the report, you can get a failure because another table is missing

image

@PiJoCoder
Copy link
Collaborator Author

Possible solution: re-architect DataSet_Reports queries to somehow account for multiple tables, not just one.
One quirky solution, that may work is:

select
CategorySeq, Category, ReportName, ReportDisplayName, ReportDescription, DataCollection, SeqNo, case when (Sum(ReportAvailable) - Count(ReportAvailable)) = 0 then 1 else 0 end    ReportAvailable
from 
(
select  CategorySeq,Category, ReportName, ReportDisplayName, ReportDescription, DataCollection, case when indx.rowcnt >0 then 1 else 0 end  ReportAvailable, SeqNo
 from @tbl_reports  rep  
 left outer join sysindexes indx on ( OBJECT_ID (rep.ValidationObject) = indx.id and indx.indid in (0,1,300)) 
 ) t
 group by CategorySeq, Category, ReportName, ReportDisplayName, ReportDescription, DataCollection, SeqNo
 order by CategorySeq, SeqNo, ReportName

@PiJoCoder PiJoCoder added the wave 2 - complete consider this issue for next wave of fixes label May 10, 2023
@PiJoCoder PiJoCoder added wave 3 - complete consider this issue for next wave of fixes and removed wave 2 - complete consider this issue for next wave of fixes labels Jun 28, 2023
@PiJoCoder PiJoCoder changed the title If a report uses multiple tables it may be shown on SQL Perf Main report but not all tables are present If a report uses multiple tables it should not appear on SQL Perf Main report because not all tables are present Aug 14, 2023
@PiJoCoder PiJoCoder changed the title If a report uses multiple tables it should not appear on SQL Perf Main report because not all tables are present If a report uses multiple tables it should not appear on SQL Perf Main report when not all tables are present Aug 14, 2023
@hacitandogan hacitandogan self-assigned this Aug 14, 2023
hacitandogan added a commit to hacitandogan/SqlNexus that referenced this issue Sep 1, 2023
…n SQL Perf Main report when not all tables are present

worked on the microsoft#232
@hacitandogan
Copy link
Contributor

This modification can be tested via just renaming some tables and seeing corresponding reports disappearing from SQL Perf Main. This should prevent errors similar to the screenshot on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wave 3 - complete consider this issue for next wave of fixes
Projects
None yet
Development

No branches or pull requests

2 participants