[Bug]: LiteLLM_SpendLogs has no (api_key, startTime) index — budget-window spend reseed seq-scans the table and can saturate the DB (P2028)
![[Bug]: LiteLLM_SpendLogs has no (api_key, startTime) index — budget-window spend reseed seq-scans the table and can saturate the DB (P2028)](https://www.chat-gpts.plus/wp-content/uploads/2026/08/35766-fe47e8e3-768x403.jpg)
这个报错通常出现在 LiteLLM 代理实例在高流量下启动预算窗口计数器(Redis 冷启动、TTL 过期)时,LiteLLM_SpendLogs 表缺少 (api_key, startTime) 复合索引导致顺序扫描排空数据库 CPU,进而触发 Prisma P2028 事务超时。优先排查 Lit








