Added NONCLUSTERED INDEX on EventSourceId in table [dbo].[Events] in TableCreationScript
When running the following query without index:
SELECT [Id], [EventSourceId], [Name], [Version], [TimeStamp], [Data], [Sequence] FROM [Events] WHERE [EventSourceId] = @EventSourceId AND [Sequence] >= @EventSourceMinVersion AND [Sequence] <= @EventSourceMaxVersion ORDER BY [Sequence]
On an eventstore with 1074011 records the result takes 28235 milliseconds.
With index created it takes: 62 milliseconds
Updated Newtonsoft to version 4.0.8.0
Added NONCLUSTERED INDEX on EventSourceId in table [dbo].[Events] in TableCreationScript
When running the following query without index:
On an eventstore with 1074011 records the result takes 28235 milliseconds. With index created it takes: 62 milliseconds