Skip to content

Commit 76e7d30

Browse files
authored
Merge branch 'main' into fix/software_value_failure
2 parents 4a68cc7 + 44c6b90 commit 76e7d30

23 files changed

Lines changed: 2374 additions & 364 deletions
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROP INDEX CONCURRENTLY IF EXISTS "idx_memberIdentities_verified_email_lower_value";
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
-- The existing idx_memberIdentities_email_verified_trgm covers the right partial
2+
-- conditions (verified = true, type = 'email', deletedAt IS NULL) but is a GIN
3+
-- trigram index -- PostgreSQL will not use it for equality joins on
4+
-- lower(mi.value) against input emails, for example:
5+
--
6+
-- JOIN ON lower(mi.value) = input_email
7+
-- WHERE mi.verified = true AND mi.type = 'email' AND mi."deletedAt" IS NULL
8+
--
9+
-- The only usable B-tree index (idx_memberIdentities_lower_value) only carries
10+
-- the partial condition deletedAt IS NULL, so PG must heap-fetch every matched
11+
-- row to re-check verified and type, which degrades as the table grows.
12+
--
13+
-- This B-tree partial index lets the planner do a direct nested-loop index scan
14+
-- (one lookup per input email) with no extra heap fetches for verified/type.
15+
16+
CREATE INDEX CONCURRENTLY IF NOT EXISTS "idx_memberIdentities_verified_email_lower_value"
17+
ON "memberIdentities" (lower(value))
18+
WHERE verified = true
19+
AND type = 'email'
20+
AND "deletedAt" IS NULL;

frontend/package-lock.json

Lines changed: 23 additions & 177 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)