perf(Segment Membership): Members list improvements#7924
Conversation
…dentities Replace FINAL in the members-list query with a two-stage LIMIT 1 BY identifier dedup: the inner query resolves the page's identifiers reading only small columns, the outer materialises the full traits JSON for that page. FINAL parses the wide traits JSON for the whole environment before filtering, and that JSON split over many per-path files fans out into thousands of object-storage GETs on a cold read. Filter is_deleted = false in both read queries; neither excluded soft-deleted identities before, so they appeared in the list and counts. beep boop Claude-Session: https://claude.ai/code/session_01EgZ5iHpDASZzCapiHRxHLB
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Docker builds report
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7924 +/- ##
=======================================
Coverage 98.63% 98.63%
=======================================
Files 1497 1497
Lines 58989 59013 +24
=======================================
+ Hits 58183 58207 +24
Misses 806 806 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|
Visual Regression17 screenshots compared. See report for details. |
matthewelwell
left a comment
There was a problem hiding this comment.
Marking as requested changes, but I'm happy for the change to be a response to my comment for documentation purposes, although ideally I'd like to see an elaboration on the comment.
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Contributes to #7593.
In this PR, we make two changes to the Segment Membership read path:
FINALin the list query. Adopt a two-stageLIMIT 1 BY identifierdedup and limit trait reads to a page.is_deleted = falsein both read queries. Neither excluded soft-deleted identities before, so deleted identities appeared in the members list and were counted.How did you test this code?
Added new unit tests.
Verified the queries against production. A 52k-identity environment, default first page (no search term),
LIMIT 11, returning 11 rows:FINAL(before)FINALLIMIT 1 BYLIMIT 1 BY(this PR)