-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
545 additions
and
218 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
apps/backend/prisma/migrations/20241228033652_more_event_indices/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- It's very common to query by userId, projectId, and eventStartedAt at the same time. | ||
-- We can use a composite index to speed up the query. | ||
-- Sadly we can't add this to the Prisma schema itself because Prisma does not understand composite indexes of JSONB fields. | ||
-- So we have to add it manually. | ||
CREATE INDEX idx_event_userid_projectid_eventstartedat ON "Event" ((data->>'projectId'), (data->>'userId'), "eventStartedAt"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.