Skip to content

Conversation

@kkartunov
Copy link
Contributor

Additional performance tweak for picachui

Additional performance tweak for picachui
-- Improve search responsiveness for group-constrained queries
CREATE INDEX IF NOT EXISTS "challenge_groups_gin_idx"
ON "challenges"."Challenge"
USING GIN ("groups");

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 array. Using GIN on unsupported types can lead to unexpected behavior or performance issues.

@@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.

[⚠️ performance]
The use of a GIN index on the groups array field is appropriate for improving query performance involving array operations. However, ensure that the pg_trgm extension is enabled in your PostgreSQL database if you plan to use trigram-based searches with this index. Without it, certain operations may not perform as expected.

@kkartunov kkartunov merged commit 38c74bd into develop Nov 12, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants