Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Improve search responsiveness for group-constrained queries
CREATE INDEX IF NOT EXISTS "challenge_groups_gin_idx"
ON "challenges"."Challenge"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
Ensure that the groups column is of a type that supports GIN indexing, such as jsonb or an array type. If it is not, the index may not function as intended.

USING GIN ("groups");
1 change: 1 addition & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ model Challenge {
@@index([updatedAt])
@@index([typeId])
@@index([trackId])
@@index([groups], type: Gin, map: "challenge_groups_gin_idx")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
The use of a GIN index on the groups array field is appropriate for efficient querying of array contents. Ensure that the pg_trgm extension is enabled in your PostgreSQL database to support this index type, as it is required for GIN indexes on text arrays.

@@index([submissionStartDate])
@@index([submissionEndDate])
@@index([registrationStartDate])
Expand Down
Loading