From 425d06991d21dcbdf9c7cd37e0717883680e358b Mon Sep 17 00:00:00 2001 From: swapnamol-abraham Date: Wed, 17 Dec 2025 12:49:17 +0000 Subject: [PATCH 1/3] TD-6520 : Refractored the SP to fix DTU Spike --- .../Hierarchy/GetNodePathNodes.sql | 40 ++++++++++++------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetNodePathNodes.sql b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetNodePathNodes.sql index 43e41a31c..c7b93adb2 100644 --- a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetNodePathNodes.sql +++ b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetNodePathNodes.sql @@ -11,25 +11,37 @@ -- 22-06-2023 RS Switched order of joins to ensure catalogue node is always returned first. -- 24-08-2023 RS Proper fix for ordering issue - STRING_SPLIT doesn't return substrings in order. -- 08-09-2023 RS A further fix for ordering issue that works on SQL Server 2019 (for developer installs). +-- 17-12-2025 SA TD-6520 - Refractored the SP to fix the DTU spike. ------------------------------------------------------------------------------- CREATE PROCEDURE [hierarchy].[GetNodePathNodes] ( - @NodePathId INT + @NodePathId INT ) - AS - BEGIN + SET NOCOUNT ON; - SELECT - CAST(value AS INT) AS NodeId, - COALESCE(fnv.Name, cnv.Name) AS Name - FROM hierarchy.NodePath np - CROSS APPLY hub.fn_Split(NodePath, '\') as ss - INNER JOIN hierarchy.NodeVersion nv ON nv.NodeId = ss.value - LEFT JOIN hierarchy.CatalogueNodeVersion cnv ON cnv.NodeVersionId = nv.Id - LEFT JOIN hierarchy.FolderNodeVersion fnv ON fnv.NodeVersionId = nv.Id - WHERE np.Id = @NodePathId - ORDER BY ss.idx - + -- If NodePath is NVARCHAR, keep types consistent to avoid implicit conversions + ;WITH PathParts AS + ( + SELECT + ordinal, + TRY_CAST(s.value AS int) AS NodeIdInt + FROM hierarchy.NodePath AS np + CROSS APPLY STRING_SPLIT(np.NodePath, N'\', 1) AS s -- 1 = ordinal + WHERE np.Id = @NodePathId + ) + SELECT + pp.NodeIdInt AS NodeId, + COALESCE(fnv.Name, cnv.Name) AS Name + FROM PathParts AS pp + JOIN hierarchy.NodeVersion AS nv + ON nv.NodeId = pp.NodeIdInt + LEFT JOIN hierarchy.CatalogueNodeVersion AS cnv + ON cnv.NodeVersionId = nv.Id + LEFT JOIN hierarchy.FolderNodeVersion AS fnv + ON fnv.NodeVersionId = nv.Id + WHERE pp.NodeIdInt IS NOT NULL + ORDER BY pp.ordinal + OPTION (RECOMPILE); -- helps if @NodePathId cardinality varies a lot END \ No newline at end of file From d575c13a3603734e253113d4cc8a27713b764c35 Mon Sep 17 00:00:00 2001 From: swapnamol-abraham Date: Fri, 19 Dec 2025 10:30:34 +0000 Subject: [PATCH 2/3] TD-5278: Remove the year from the Footer copyright notice --- LearningHub.Nhs.WebUI/Views/Shared/_FooterPartial.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LearningHub.Nhs.WebUI/Views/Shared/_FooterPartial.cshtml b/LearningHub.Nhs.WebUI/Views/Shared/_FooterPartial.cshtml index 2c6e87651..7a78b2da0 100644 --- a/LearningHub.Nhs.WebUI/Views/Shared/_FooterPartial.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Shared/_FooterPartial.cshtml @@ -19,7 +19,7 @@ } - + From eac0a3f50ceeb4222a8d803a0be46e6f6f5210fa Mon Sep 17 00:00:00 2001 From: swapnamol-abraham Date: Fri, 19 Dec 2025 11:06:01 +0000 Subject: [PATCH 3/3] TD-5716-Issue showing '404' error on the screen when adding the resourses to bookmarks from home page --- LearningHub.Nhs.WebUI/Views/Home/Dashboard.cshtml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Views/Home/Dashboard.cshtml b/LearningHub.Nhs.WebUI/Views/Home/Dashboard.cshtml index 59528c734..feea87393 100644 --- a/LearningHub.Nhs.WebUI/Views/Home/Dashboard.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Home/Dashboard.cshtml @@ -24,11 +24,11 @@
- - - - - + + + + +