From 3d3292fd3d29e21abfee49394522dc365e03f66c Mon Sep 17 00:00:00 2001 From: ta264 Date: Thu, 14 Oct 2021 21:53:41 +0100 Subject: [PATCH] Fixed: Add missing index to improve book import performance --- .../Datastore/Migration/015_fix_indexes.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/NzbDrone.Core/Datastore/Migration/015_fix_indexes.cs diff --git a/src/NzbDrone.Core/Datastore/Migration/015_fix_indexes.cs b/src/NzbDrone.Core/Datastore/Migration/015_fix_indexes.cs new file mode 100644 index 000000000..35b64aef6 --- /dev/null +++ b/src/NzbDrone.Core/Datastore/Migration/015_fix_indexes.cs @@ -0,0 +1,17 @@ +using FluentMigrator; +using NzbDrone.Core.Datastore.Migration.Framework; + +namespace NzbDrone.Core.Datastore.Migration +{ + [Migration(15)] + public class FixIndexes : NzbDroneMigrationBase + { + protected override void MainDbUpgrade() + { + Delete.Index().OnTable("Books").OnColumn("AuthorId"); + Delete.Index().OnTable("Books").OnColumns("AuthorId", "ReleaseDate"); + + Create.Index().OnTable("Editions").OnColumn("BookId"); + } + } +}