perf(db): add targeted composite indexes

This commit is contained in:
2026-04-30 16:13:35 +03:30
parent 054bb5a582
commit 99eb4c2594
6 changed files with 72 additions and 7 deletions

View File

@@ -80,6 +80,7 @@ class WorkspaceMembership(BaseModel):
indexes = [
models.Index(fields=["workspace"], name="membership_workspace_idx"),
models.Index(fields=["user"], name="membership_user_idx"),
models.Index(fields=["workspace", "is_active", "user"], name="membership_ws_active_user_idx"),
]
constraints = [
models.UniqueConstraint(