mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 10:52:08 +01:00
perf: add missing indexes for session filtering and sorting
- Add compound index on (companyId, language) for language filtering - Add compound index on (companyId, messagesSent) for message count sorting - Add compound index on (companyId, avgResponseTime) for response time sorting These indexes optimize the session dashboard queries that filter by language or sort by messagesSent/avgResponseTime, preventing full table scans.
This commit is contained in:
@ -147,6 +147,9 @@ model Session {
|
||||
@@index([companyId, category])
|
||||
@@index([companyId, escalated])
|
||||
@@index([companyId, forwardedHr])
|
||||
@@index([companyId, language])
|
||||
@@index([companyId, messagesSent])
|
||||
@@index([companyId, avgResponseTime])
|
||||
}
|
||||
|
||||
/// *
|
||||
|
||||
Reference in New Issue
Block a user