Closed
Description
As per subject, the "Mapping to class/routine coverage" process is taking a long time to complete. Running locally takes between 15-20 minutes on average (over 50mins in Azure DevOps).
I've put a couple of debug lines at various points in TestCoverage.Data.Run.MapRunCoverage() to track timings, flagged with the original COS comments where possible, here's my findings:
[10/29/2024 09:44:54] MapRunCoverage Started, pRunIndex is: 1
[10/29/2024 09:44:54] "Executing worse performing approach query"
[10/29/2024 09:44:54] opening cursor
[10/29/2024 09:44:55] running "Copy any other metrics captured/requested as well"
[10/29/2024 09:44:55] Sql statment is: INSERT OR UPDATE %NOLOCK %NOCHECK INTO TestCoverage_Data.Coverage_RtnLine (Coverage,element_key,RtnLine) SELECT target.ID,map.ToLine,NVL(oldMetric.RtnLine,0) + SUM(metric.RtnLine) FROM TestCoverage_Data.Coverage source JOIN TestCoverage_Data.CodeUnitMap map "_$c(9)_"ON source.Hash = map.FromHash JOIN TestCoverage_Data.Coverage_RtnLine metric "_$c(9)_"ON metric.Coverage = source.ID "_$c(9)_"AND metric.element_key = map.FromLine JOIN TestCoverage_Data.Coverage target "_$c(9)_"ON target.Run = source.Run "_$c(9)_"AND target.Hash = map.ToHash "_$c(9)_"AND target.TestPath = source.TestPath LEFT JOIN TestCoverage_Data.Coverage_RtnLine oldMetric "_$c(9)_"ON oldMetric.ID = target.ID "_$c(9)_"AND oldMetric.element_key = map.ToLine WHERE source.Run = ? "_$c(9)_"AND source.Ignore = 0"_$c(9)_"AND source.Calculated = 0 GROUP BY target.ID,map.ToLine
[10/29/2024 10:01:59] Sql statment completed
[10/29/2024 10:01:59] Exiting with status tSC:1
Running the sqlstatement as a straight count(*) without the insert on SMP just sits waiting forever:
However when I remove the join back to "TestCoverage_Data.Coverage target" the query returns instantly
Can anyone help me with this please?
Thanks as always :)
EDIT:
The straight count did eventually return a result after 46min: