From d4b03f8224c337ac1b515dddf67e9570b0600fc0 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Mon, 17 Jul 2017 21:11:17 +0200 Subject: [PATCH] IMprove MongoDB query performance. --- .../Contents/MongoContentRepository_EventHandling.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Squidex.Domain.Apps.Read.MongoDb/Contents/MongoContentRepository_EventHandling.cs b/src/Squidex.Domain.Apps.Read.MongoDb/Contents/MongoContentRepository_EventHandling.cs index 7cdd4a0b5..35d6d89dc 100644 --- a/src/Squidex.Domain.Apps.Read.MongoDb/Contents/MongoContentRepository_EventHandling.cs +++ b/src/Squidex.Domain.Apps.Read.MongoDb/Contents/MongoContentRepository_EventHandling.cs @@ -62,6 +62,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Contents { return ForAppIdAsync(@event.AppId.Id, async collection => { + await collection.Indexes.CreateOneAsync(Index.Ascending(x => x.SchemaId).Descending(x => x.LastModified)); await collection.Indexes.CreateOneAsync(Index.Ascending(x => x.ReferencedIds)); await collection.Indexes.CreateOneAsync(Index.Ascending(x => x.IsPublished)); await collection.Indexes.CreateOneAsync(Index.Text(x => x.DataText));