From 51f2897a33baaeeeebb77ffe7cf1c3d4f3736d53 Mon Sep 17 00:00:00 2001 From: mschill Date: Thu, 16 Jul 2026 08:26:07 -0400 Subject: [PATCH 1/5] =?UTF-8?q?C2026-044=20=E2=80=93=20ve=5FGetParentItem?= =?UTF-8?q?=20Performance=20Improvement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/VEPROMS User Interface/PROMSFixes.Sql | 33 ++++++++++++--------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/PROMS/VEPROMS User Interface/PROMSFixes.Sql b/PROMS/VEPROMS User Interface/PROMSFixes.Sql index 5209a3a7..035bf245 100644 --- a/PROMS/VEPROMS User Interface/PROMSFixes.Sql +++ b/PROMS/VEPROMS User Interface/PROMSFixes.Sql @@ -5547,6 +5547,12 @@ ELSE PRINT 'Function: ve_GetItemDerivedApplicability Error on Creation' GO ------- + +-- ============================================= +-- Author: Matthew Schill +-- Modify date: 07/14/2026 +-- Description: Reworked ve_GetParentItem for Performance improvement +-- ============================================= /****** Object: UserDefinedFunction [dbo].[vefn_GetParentItem] Script Date: 03/28/2012 17:58:48 ******/ IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[ve_GetParentItem]') AND OBJECTPROPERTY(id,N'IsScalarFunction') = 1) DROP FUNCTION [ve_GetParentItem]; @@ -5555,29 +5561,28 @@ GO Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE Copyright 2012 - Volian Enterprises, Inc. All rights reserved. *****************************************************************************/ -CREATE FUNCTION [dbo].[ve_GetParentItem] (@ItemID int) RETURNS int +CREATE OR ALTER FUNCTION [dbo].[ve_GetParentItem4] (@ItemID int) RETURNS int WITH EXECUTE AS OWNER AS BEGIN DECLARE @ParentID int; -WITH Itemz([ItemID],[IsFound]) as +WITH Itemz([ItemID]) as ( -select ii.itemid,0 from items ii where ii.itemid = @ItemID +select ii.itemid from items ii WITH (NOLOCK) where ii.itemid = @ItemID union all -select ii.previousid,0 from items ii +select ii.previousid from items ii WITH (NOLOCK) join itemz zz on ii.itemid = zz.itemid where ii.previousid is not null -and zz.isfound = 0 -union all -select ii.itemid,1 -from parts pp -join itemz zz on pp.itemid = zz.itemid -join items ii on ii.contentid = pp.contentid ) -select top 1 @ParentID = itemid from itemz -where isfound = 1 OPTION (MAXRECURSION 10000) +select top 1 @ParentID = ii.itemid +from itemz +inner join parts pp WITH (NOLOCK) on pp.itemid = itemz.itemid +inner join items ii WITH (NOLOCK) on ii.contentid = pp.contentid +OPTION (MAXRECURSION 10000) + RETURN @ParentID END + GO IF (@@Error = 0) PRINT 'ScalerFunction [vefn_GetParentItem] Succeeded' @@ -25051,8 +25056,8 @@ BEGIN TRY -- Try Block DECLARE @RevDate varchar(255) DECLARE @RevDescription varchar(255) - set @RevDate = '06/29/2026 7:00 AM' - set @RevDescription = 'Update to Grid Deletion Audits' + set @RevDate = '07/16/2026 8:30 AM' + set @RevDescription = 'Reworked ve_GetParentItem for Performance improvement' Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription From 48054f5bf14a0e6f27402c9cf514519e0d9eeb0e Mon Sep 17 00:00:00 2001 From: mschill Date: Thu, 16 Jul 2026 08:26:52 -0400 Subject: [PATCH 2/5] =?UTF-8?q?C2026-044=20=E2=80=93=20ve=5FGetParentItem?= =?UTF-8?q?=20Performance=20Improvement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/VEPROMS User Interface/PROMSFixes.Sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PROMS/VEPROMS User Interface/PROMSFixes.Sql b/PROMS/VEPROMS User Interface/PROMSFixes.Sql index 035bf245..40b8b28e 100644 --- a/PROMS/VEPROMS User Interface/PROMSFixes.Sql +++ b/PROMS/VEPROMS User Interface/PROMSFixes.Sql @@ -5561,7 +5561,7 @@ GO Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE Copyright 2012 - Volian Enterprises, Inc. All rights reserved. *****************************************************************************/ -CREATE OR ALTER FUNCTION [dbo].[ve_GetParentItem4] (@ItemID int) RETURNS int +CREATE OR ALTER FUNCTION [dbo].[ve_GetParentItem] (@ItemID int) RETURNS int WITH EXECUTE AS OWNER AS BEGIN From a13b03a13688dae5973c5ceeb89980939a1ea9e9 Mon Sep 17 00:00:00 2001 From: mschill Date: Thu, 16 Jul 2026 08:48:11 -0400 Subject: [PATCH 3/5] =?UTF-8?q?C2026-044=20=E2=80=93=20ve=5FGetParentItem?= =?UTF-8?q?=20Performance=20Improvement=20Added=20Included=20columns=20to?= =?UTF-8?q?=20Index?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/VEPROMS User Interface/PROMSFixes.Sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/PROMS/VEPROMS User Interface/PROMSFixes.Sql b/PROMS/VEPROMS User Interface/PROMSFixes.Sql index 40b8b28e..ab6f422e 100644 --- a/PROMS/VEPROMS User Interface/PROMSFixes.Sql +++ b/PROMS/VEPROMS User Interface/PROMSFixes.Sql @@ -5589,6 +5589,18 @@ IF (@@Error = 0) PRINT 'ScalerFunction [vefn_GetParentItem] Succeeded' ELSE PRINT 'ScalerFunction [vefn_GetParentItem] Error on Creation' go +IF EXISTS (SELECT * FROM dbo.sysIndexes WHERE name like 'IX_PartsItemID') + DROP INDEX [IX_PartsItemID] ON [dbo].[tblParts]; +GO + +CREATE NONCLUSTERED INDEX IX_PartsItemID +ON [dbo].[tblParts] ([ItemID] ASC) +INCLUDE([ContentID],[DeleteStatus],[FromType]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +GO + +PRINT 'Added IX_PartsItemID Index. Speeds up Getting Parent Items' +GO + /****** Object: UserDefinedFunction [dbo].[vefn_CanTransitionBeCreated] Script Date: 10/14/2012 02:03:30 ******/ IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vefn_CanTransitionBeCreated]') AND OBJECTPROPERTY(id,N'IsScalarFunction') = 1) DROP FUNCTION [vefn_CanTransitionBeCreated]; From d7c2300021f9af8c65c9b4a8d71b71dbc2d96d39 Mon Sep 17 00:00:00 2001 From: John Jenko Date: Fri, 17 Jul 2026 10:11:43 -0400 Subject: [PATCH 4/5] F2026-017 Blank line was sometimes missing after the Note and Caution text. This was a 64-bit build difference that affected the text width calculations. --- PROMS/Formats/fmtall/SUMSAMall.xml | Bin 129000 -> 129000 bytes PROMS/Formats/fmtall/SUMall.xml | Bin 128934 -> 128934 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/PROMS/Formats/fmtall/SUMSAMall.xml b/PROMS/Formats/fmtall/SUMSAMall.xml index 4b073fb5f1f19f68edcf8eab19314656fadd820c..0cdcb99296dc3525146150145ae0ab549c8d8138 100644 GIT binary patch delta 39 scmaFyp8dsp_6=MM84V}@Uo5{_YhfHCggIGjAy@OJMcX$mVl)c{0CxHj*8l(j delta 35 qcmaFyp8dsp_6=MMC;wZluvu$i93zM^S!*Fz^QJ}HH!Wf`3k3jC1QBxp diff --git a/PROMS/Formats/fmtall/SUMall.xml b/PROMS/Formats/fmtall/SUMall.xml index 3873bf8bb1e966484400c70b021bc43b0ec8cd52..0cfbc9024d2f330d94a599ac727400864dd1aa87 100644 GIT binary patch delta 31 pcmV+)0O0?o?+2#u2e87T0Wp(7q$#uPqErC^F@r&*w?U) Date: Tue, 21 Jul 2026 10:24:46 -0400 Subject: [PATCH 5/5] C2026-046 - Decrease check if need to update ROs. --- .../VEPROMS.CSLA.Library/Extension/ROFSTExt.cs | 4 +++- .../Session/ROWorkingDraftAsk.cs | 18 ++++++++++++++++++ .../VEPROMS.CSLA.Library.csproj | 1 + PROMS/Volian.Controls.Library/DisplayRO.cs | 5 ++++- 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 PROMS/VEPROMS.CSLA.Library/Session/ROWorkingDraftAsk.cs diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs index 0098d346..f2e4ffc2 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs @@ -326,7 +326,9 @@ namespace VEPROMS.CSLA.Library // all of the calls aways set the flags to not update the RO values public static ROFst UpdateRoFst(RODbInfo rdi, DocVersion docver, ROFstInfo origROFst, ROFstInfoProgressBarRefresh myProgressBarRefresh) { - if (myProgressBarRefresh != null) myProgressBarRefresh(0, 100, "Starting Update"); + ROWorkingDraftAsk.ClearWorkingDrafts(); + + if (myProgressBarRefresh != null) myProgressBarRefresh(0, 100, "Starting Update"); int origFSTid = origROFst.ROFstID; diff --git a/PROMS/VEPROMS.CSLA.Library/Session/ROWorkingDraftAsk.cs b/PROMS/VEPROMS.CSLA.Library/Session/ROWorkingDraftAsk.cs new file mode 100644 index 00000000..f78280ac --- /dev/null +++ b/PROMS/VEPROMS.CSLA.Library/Session/ROWorkingDraftAsk.cs @@ -0,0 +1,18 @@ + +using System.Collections.Generic; + +namespace VEPROMS.CSLA.Library +{ + public static class ROWorkingDraftAsk + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")] + private static List WorkingDrafts = new List(); + + public static void AddWorkingDrafts(int wd) => WorkingDrafts.Add(wd); + + public static void ClearWorkingDrafts() => WorkingDrafts.Clear(); + + public static bool ContainsWorkingDraft(int wd) => WorkingDrafts.Contains(wd); + + } +} diff --git a/PROMS/VEPROMS.CSLA.Library/VEPROMS.CSLA.Library.csproj b/PROMS/VEPROMS.CSLA.Library/VEPROMS.CSLA.Library.csproj index 1b9a09b2..db431669 100644 --- a/PROMS/VEPROMS.CSLA.Library/VEPROMS.CSLA.Library.csproj +++ b/PROMS/VEPROMS.CSLA.Library/VEPROMS.CSLA.Library.csproj @@ -396,6 +396,7 @@ + diff --git a/PROMS/Volian.Controls.Library/DisplayRO.cs b/PROMS/Volian.Controls.Library/DisplayRO.cs index 7c271a05..86ff26cb 100644 --- a/PROMS/Volian.Controls.Library/DisplayRO.cs +++ b/PROMS/Volian.Controls.Library/DisplayRO.cs @@ -652,7 +652,7 @@ namespace Volian.Controls.Library { //do nothing - is still checked out } - else if (changedDocVersion && !askedAboutchangedDocVersion) + else if (changedDocVersion && !askedAboutchangedDocVersion && !ROWorkingDraftAsk.ContainsWorkingDraft(_docVersionInfo.VersionID)) { if (MessageBox.Show($"There exists a newer ROFST for this RO database that was loaded for other sets.\r\n\r\nDo you want to update this set's ROs to be consistent/use the latest loaded ROFST?", "Load ROs", MessageBoxButtons.YesNo) == DialogResult.Yes) { @@ -671,10 +671,13 @@ namespace Volian.Controls.Library updatedROs = true; askedAboutchangedDocVersion = false; + ROWorkingDraftAsk.ClearWorkingDrafts(); } else { askedAboutchangedDocVersion = true; + if (!ROWorkingDraftAsk.ContainsWorkingDraft(_docVersionInfo.VersionID)) + ROWorkingDraftAsk.AddWorkingDrafts(_docVersionInfo.VersionID); } }