pjvds / ncqrs

Ncqrs Framework - The CQRS Framework for .NET
Other
541 stars 162 forks source link

Updated Newtonsoft 4.0.8.0 and added index on MSSQL Events Table #86

Closed jansaris closed 12 years ago

jansaris commented 12 years ago

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:

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

bonder commented 12 years ago

Would love to get this in! ;)