-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed performance degradation if recovering with big numbers of snaps… #3138
Conversation
@@ -273,7 +273,8 @@ protected AbstractQueryExecutor(QueryConfiguration configuration, Akka.Serializa | |||
WHERE {Configuration.PersistenceIdColumnName} = @PersistenceId | |||
AND {Configuration.SequenceNrColumnName} <= @SequenceNr | |||
AND {Configuration.TimestampColumnName} <= @Timestamp | |||
ORDER BY {Configuration.SequenceNrColumnName} DESC"; | |||
ORDER BY {Configuration.SequenceNrColumnName} DESC | |||
LIMIT 1"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -110,9 +110,10 @@ protected override void PostStop() | |||
try | |||
{ | |||
using (var connection = CreateDbConnection()) | |||
using (var nestedCancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(_pendingRequestsCancellation.Token)) | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good solution on using CreateLinkedTokenSource
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look good. Thanks for your contribution!
The reason for this degradation is SQL-driver rows pre-fetch. Furthermore, the current implementation of SelectSnapshotAsync reads only one row, so there is no reason to query more than one snapshot row.