From 46eab7a611601d1a59b30298faaeaa74abc53752 Mon Sep 17 00:00:00 2001 From: Andreas Thomas Date: Fri, 4 Oct 2024 21:17:45 +0200 Subject: [PATCH] perf: add database indices (#2192) --- internal/db/src/schema/audit_logs.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/db/src/schema/audit_logs.ts b/internal/db/src/schema/audit_logs.ts index 388f1f013b..7b93649054 100644 --- a/internal/db/src/schema/audit_logs.ts +++ b/internal/db/src/schema/audit_logs.ts @@ -78,6 +78,10 @@ export const auditLog = mysqlTable( }, (table) => ({ workspaceId: index("workspace_id_idx").on(table.workspaceId), + bucketId: index("bucket_id_idx").on(table.bucketId), + event: index("event_idx").on(table.event), + actorId: index("actor_id_idx").on(table.actorId), + time: index("time_idx").on(table.time), }), ); @@ -115,6 +119,7 @@ export const auditLogTarget = mysqlTable( }, (table) => ({ pk: primaryKey({ columns: [table.auditLogId, table.id] }), + auditLog: index("audit_log_id").on(table.auditLogId), }), );