Commit 84365dd
committed
feat: add new index, constraints on isQueued
Our queuing logic will be slow if we dont use an index.
isQueued is most of the time true, since emailoutbox table accounts for historical data and all sent emails have isQueued set to true.
So the index will actually be quite selective.
We can't just use the partial index on isQueued because its build on tenancyId, and the queuing query doesnt check tenancy id.1 parent 9dad2d8 commit 84365dd
2 files changed
Lines changed: 8 additions & 1 deletion
File tree
- apps/backend/prisma
- migrations/20260213004424_email_outbox_is_queued_index
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
833 | 833 | | |
834 | 834 | | |
835 | 835 | | |
836 | | - | |
| 836 | + | |
837 | 837 | | |
838 | 838 | | |
839 | 839 | | |
| |||
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
| 889 | + | |
889 | 890 | | |
890 | 891 | | |
891 | 892 | | |
| |||
0 commit comments