Skip to content

Commit f71d354

Browse files
committed
Added missing index for audit counts
1 parent acd267f commit f71d354

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ServiceControl.Audit.Persistence.PostgreSQL/PostgreSQLPersistenceInstaller.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,14 @@ CREATE INDEX IF NOT EXISTS idx_processed_messages_by_query ON processed_messages
156156
await cmd.ExecuteNonQueryAsync(cancellationToken);
157157
}
158158

159+
await using (var cmd = new NpgsqlCommand(@"
160+
CREATE INDEX IF NOT EXISTS idx_processed_messages_audit_counts ON processed_messages (
161+
receiving_endpoint_name, processed_at
162+
);", connection))
163+
{
164+
await cmd.ExecuteNonQueryAsync(cancellationToken);
165+
}
166+
159167
// Create saga_snapshots table
160168
await using (var cmd = new NpgsqlCommand(@"
161169
CREATE TABLE IF NOT EXISTS saga_snapshots (

0 commit comments

Comments
 (0)