Skip to content

Commit

Permalink
Merge pull request #2003 from HicServices/task/RDMP-245-enable-speed
Browse files Browse the repository at this point in the history
Performance Improvement
  • Loading branch information
rdteviotdale authored Sep 24, 2024
2 parents 4d123d7 + be8341e commit 7fa25ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@





# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [8.3.1] - Unreleased

- Improve Performance of regenerating problems with child providers

## [8.3.0] - 2024-09-23

- Add New Find & Replace, currently available via User Settings
Expand Down
18 changes: 7 additions & 11 deletions Rdmp.Core/Providers/CatalogueProblemProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using Rdmp.Core.CommandExecution.AtomicCommands;
Expand Down Expand Up @@ -43,18 +44,13 @@ public override void RefreshProblems(ICoreChildProvider childProvider)
_childProvider = childProvider;

//Take all the catalogue items which DON'T have an associated ColumnInfo (should hopefully be quite rare)
var orphans = _childProvider.AllCatalogueItems.Where(ci => ci.ColumnInfo_ID == null);

//now identify those which have an ExtractionInformation (that's a problem! they are extractable but orphaned)
_orphanCatalogueItems = new HashSet<int>(
orphans.Where(o => _childProvider.AllExtractionInformations.Any(ei => ei.CatalogueItem_ID == o.ID))

//store just the ID for performance
.Select(i => i.ID));

var catalogueIDs = _childProvider.AllCatalogueItems.Where(ci => ci.ColumnInfo_ID == null).Select(i => i.ID).ToList();
var extractionInfoIDs = _childProvider.AllExtractionInformations.Select(ei => ei.CatalogueItem_ID).ToList();
var orphans = catalogueIDs.Intersect(extractionInfoIDs);
_orphanCatalogueItems = orphans.ToHashSet<int>();
_usedJoinables = new HashSet<int>(
childProvider.AllJoinableCohortAggregateConfigurationUse.Select(
ju => ju.JoinableCohortAggregateConfiguration_ID));
childProvider.AllJoinableCohortAggregateConfigurationUse.Select(
ju => ju.JoinableCohortAggregateConfiguration_ID));

_joinsWithMismatchedCollations = childProvider.AllJoinInfos.Where(j =>
!string.IsNullOrWhiteSpace(j.PrimaryKey.Collation) &&
Expand Down

0 comments on commit 7fa25ed

Please sign in to comment.