Skip to content

Commit c3c9649

Browse files
authored
feat: add index for member api (CM-764) (#3588)
1 parent 434444c commit c3c9649

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

backend/src/database/migrations/U1762789440__optimize_member_api.sql

Whitespace-only changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_msa_segment_activitycount_desc_member
2+
ON public."memberSegmentsAgg" ("segmentId", "activityCount" DESC, "memberId");
3+
4+
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_members_displayname_trgm
5+
ON public."members"
6+
USING gin (LOWER("displayName") gin_trgm_ops);
7+
8+
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_memberidentities_email_verified_trgm
9+
ON public."memberIdentities"
10+
USING gin (LOWER("value") gin_trgm_ops)
11+
WHERE verified = true
12+
AND type = 'email';

0 commit comments

Comments
 (0)