Open andreasohlund opened 12 months ago
Outbox records are deleted with where Dispatched = 'true' and DispatchedAt < @DispatchedBefore and since the outbox index only contains DispatchedAt (and Dispatched as the filter) this leads to the database indicating (correctly) that the index isn't optimal.
where Dispatched = 'true' and DispatchedAt < @DispatchedBefore
DispatchedAt
Dispatched
This will also likely leads to poor performance deleting large number of outbox records.
Index containing both the Dispached and the DispatchedAt column
Dispached
Index only contains the DispatchedAt column
All versions
No response
Not really sure if you're talking about the correct column?
https://github.com/Particular/NServiceBus.Persistence.Sql/blob/5d40a9014a11833f41548b23b1a45a72123dc1ed/src/ScriptBuilder/Outbox/Create_MsSqlServer.sql
DispatchedAt is indexed. You mean Dispatched?
Describe the bug
Description
Outbox records are deleted with
where Dispatched = 'true' and DispatchedAt < @DispatchedBefore
and since the outbox index only containsDispatchedAt
(andDispatched
as the filter) this leads to the database indicating (correctly) that the index isn't optimal.This will also likely leads to poor performance deleting large number of outbox records.
Expected behavior
Index containing both the
Dispached
and theDispatchedAt
columnActual behavior
Index only contains the
DispatchedAt
columnVersions
All versions
Steps to reproduce
Relevant log output
No response
Additional Information
Workarounds
Possible solutions
Additional information