-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Saving scorecards in production is slow and causes SqlTimeoutExceptio…
…n. The slowest part is calculating probability. Change the calculation so it can be done at read time, removing the slowest part of the save. #619
- Loading branch information
1 parent
2a05709
commit 72688e5
Showing
89 changed files
with
146 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-704 Bytes
(97%)
Stoolball.Data.SqlServer.IntegrationTests/StoolballDataSourceIntegrationTests.dacpac
Binary file not shown.
Binary file modified
BIN
-704 Bytes
(97%)
...ball.Data.SqlServer.IntegrationTests/StoolballStatisticsDataSourceIntegrationTests.dacpac
Binary file not shown.
Binary file modified
BIN
-704 Bytes
(97%)
...SqlServer.IntegrationTests/StoolballStatisticsMaxResultsDataSourceIntegrationTests.dacpac
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
Stoolball.Data.UmbracoMigrations/038_Remove_Probability/StatisticsRemoveProbability.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Microsoft.Extensions.Logging; | ||
using Stoolball.Data.SqlServer; | ||
using Umbraco.Cms.Infrastructure.Migrations; | ||
|
||
namespace Stoolball.Data.UmbracoMigrations | ||
{ | ||
/// <summary> | ||
/// Removes the probability column and the stored procedure to populate it. Probability is now calculated differently as part of the SELECT. | ||
/// </summary> | ||
public partial class StatisticsRemoveProbability : MigrationBase | ||
{ | ||
public StatisticsRemoveProbability(IMigrationContext context) : base(context) | ||
{ | ||
} | ||
|
||
protected override void Migrate() | ||
{ | ||
Logger.LogDebug("Running migration {MigrationStep}", typeof(StatisticsRemoveProbability).Name); | ||
|
||
if (ColumnExists(Tables.PlayerInMatchStatistics, "Probability")) | ||
{ | ||
Delete.Column("Probability").FromTable(Tables.PlayerInMatchStatistics).Do(); | ||
Execute.Sql("DROP PROCEDURE IF EXISTS usp_Statistics_UpdateProbability").Do(); | ||
} | ||
else | ||
{ | ||
Logger.LogDebug("The database column {DbTable}.{DbColumn} does not exist, skipping", Tables.PlayerInMatchStatistics, "Probability"); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.