From ff6737314f2a452c9341a3652951d3137dd8fba4 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Thu, 31 Mar 2016 00:37:53 +0200 Subject: [PATCH] Added additional index to episodes table to speed up certain queries. --- .../095_add_additional_episodes_index.cs | 16 ++++++++++++++++ src/NzbDrone.Core/NzbDrone.Core.csproj | 1 + 2 files changed, 17 insertions(+) create mode 100644 src/NzbDrone.Core/Datastore/Migration/095_add_additional_episodes_index.cs diff --git a/src/NzbDrone.Core/Datastore/Migration/095_add_additional_episodes_index.cs b/src/NzbDrone.Core/Datastore/Migration/095_add_additional_episodes_index.cs new file mode 100644 index 000000000..5d7a08b62 --- /dev/null +++ b/src/NzbDrone.Core/Datastore/Migration/095_add_additional_episodes_index.cs @@ -0,0 +1,16 @@ +using FluentMigrator; +using NzbDrone.Core.Datastore.Migration.Framework; + +namespace NzbDrone.Core.Datastore.Migration +{ + [Migration(95)] + public class add_additional_episodes_index : NzbDroneMigrationBase + { + protected override void MainDbUpgrade() + { + Create.Index().OnTable("Episodes").OnColumn("SeriesId").Ascending() + .OnColumn("SeasonNumber").Ascending() + .OnColumn("EpisodeNumber").Ascending(); + } + } +} diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj index 23856c85f..07605932e 100644 --- a/src/NzbDrone.Core/NzbDrone.Core.csproj +++ b/src/NzbDrone.Core/NzbDrone.Core.csproj @@ -253,6 +253,7 @@ +