Skip to content

Commit 286b9fe

Browse files
committed
Enable no table scan and fix one more index
1 parent fde25bf commit 286b9fe

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/providers/WorkflowCore.Persistence.MongoDB/Services/MongoPersistenceProvider.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,10 @@ static void CreateIndexes(MongoPersistenceProvider instance)
112112
instance.EventSubscriptions.Indexes.CreateOne(new CreateIndexModel<EventSubscription>(
113113
Builders<EventSubscription>.IndexKeys
114114
.Ascending(x => x.EventName)
115-
.Ascending(x => x.EventKey),
116-
new CreateIndexOptions { Background = true, Name = "idx_namekey" }));
115+
.Ascending(x => x.EventKey)
116+
.Ascending(x => x.SubscribeAsOf)
117+
.Ascending(x => x.ExternalToken),
118+
new CreateIndexOptions { Background = true, Name = "idx_namekey_v2" }));
117119

118120
instance.ScheduledCommands.Indexes.CreateOne(new CreateIndexModel<ScheduledCommand>(
119121
Builders<ScheduledCommand>.IndexKeys

test/WorkflowCore.Tests.MongoDB/MongoDockerSetup.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ public MongoDockerSetup()
1919
public async Task InitializeAsync()
2020
{
2121
await _mongoResource.InitializeAsync();
22-
// TODO: Should be enabled
23-
// var command = new BsonDocument { { "setParameter", 1 }, { "notablescan", 1 } };
24-
// _mongoResource.Client.GetDatabase("admin").RunCommand<BsonDocument>(command);
22+
var command = new BsonDocument { { "setParameter", 1 }, { "notablescan", 1 } };
23+
_mongoResource.Client.GetDatabase("admin").RunCommand<BsonDocument>(command);
2524
ConnectionString = _mongoResource.ConnectionString;
2625
}
2726

0 commit comments

Comments
 (0)