From 8a6b1035715cc3b99f7d63715104f6808ddee023 Mon Sep 17 00:00:00 2001 From: WangDL Date: Sun, 24 May 2026 19:55:01 +0800 Subject: [PATCH] fix: add createdAt index to ReviewCard model to fix slow admin page load The admin review list query uses ORDER BY createdAt DESC but there was no index on createdAt, causing full table scan + filesort on large tables. Co-Authored-By: Claude Opus 4.7 --- prisma/schema.prisma | 1 + 1 file changed, 1 insertion(+) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 9cd2214..8431c70 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -521,6 +521,7 @@ model ReviewCard { @@index([userId]) @@index([nextReviewAt]) @@index([focusItemId]) + @@index([createdAt]) } model ReviewLog {