Skip to content

Index the audit endpoint filter by time sent on SQL Server - #6190

Merged
warwickschroeder merged 3 commits into
masterfrom
warwick/audit-endpoint-time-sent-index
Nov 26, 2026
Merged

warwickschroeder merged 3 commits into
masterfrom
warwick/audit-endpoint-time-sent-index

Conversation

@warwickschroeder

@warwickschroeder warwickschroeder commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What this fixes

On SQL, the audit list filtered by endpoint has no index that covers both the filter and its time_sent sort.

  • **Adds index on (ReceivingEndpointName, TimeSent) for SQL
  • The included column keeps the count query cheap as well as the page.

Tests

  • ServiceControl.Audit.Persistence.Tests.SqlServer (new EndpointFilterPlanReuseTests): listing a busy endpoint then a quiet one, and the reverse, keeps the count and the page under 1,000 logical reads on the shared plan.
  • ServiceControl.Audit.Persistence.Tests.SqlServer (SlowMigrationOperationApprovals): approves the new CreateIndex.

@warwickschroeder
warwickschroeder merged commit 27d7500 into master Nov 26, 2026
36 checks passed
@warwickschroeder
warwickschroeder deleted the warwick/audit-endpoint-time-sent-index branch November 26, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants