From b5f83647d96adcbb9cd13e8427afd07218889211 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Mon, 20 Aug 2018 11:54:08 -0500 Subject: [PATCH] revert to using Contains() Join() was super slow... ref #357 --- src/FilterLists.Services/Snapshot/Snapshot.cs | 2 +- src/FilterLists.Services/Snapshot/SnapshotBatch.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FilterLists.Services/Snapshot/Snapshot.cs b/src/FilterLists.Services/Snapshot/Snapshot.cs index 1e6351e6e..e2857cf11 100644 --- a/src/FilterLists.Services/Snapshot/Snapshot.cs +++ b/src/FilterLists.Services/Snapshot/Snapshot.cs @@ -15,7 +15,7 @@ namespace FilterLists.Services.Snapshot { public class Snapshot { - private const int BatchSize = 250; + private const int BatchSize = 1000; private readonly FilterListsDbContext dbContext; private readonly FilterListViewUrlDto list; private readonly Data.Entities.Snapshot snapEntity; diff --git a/src/FilterLists.Services/Snapshot/SnapshotBatch.cs b/src/FilterLists.Services/Snapshot/SnapshotBatch.cs index a1af7099e..6272480b4 100644 --- a/src/FilterLists.Services/Snapshot/SnapshotBatch.cs +++ b/src/FilterLists.Services/Snapshot/SnapshotBatch.cs @@ -33,7 +33,7 @@ public async Task SaveAsync() } private IQueryable GetExistingRules() => - dbContext.Rules.Join(lines, rule => rule.Raw, line => line, (rule, line) => rule); + dbContext.Rules.Where(r => lines.Contains(r.Raw)); private List CreateNewRules(IQueryable existingRules) => lines.Except(existingRules.Select(r => r.Raw)).Select(r => new Rule {Raw = r}).ToList();