Skip to content

Commit

Permalink
Fix: get last diff request performance
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Oct 22, 2023
1 parent 87d0ec1 commit 4b579d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/postgres/rollback.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (r Rollback) LastDiff(ctx context.Context, ptr int64, keyHash string, skipR
query.Where("value is not null")
}

err = query.Order("id desc").Limit(1).Scan(ctx)
err = query.OrderExpr("timestamp desc, id desc").Limit(1).Scan(ctx)
return
}

Expand Down

0 comments on commit 4b579d4

Please sign in to comment.