Repository navigation
fix(evault-core): index MetaEnvelope.ontology to stop group-grant label scans - #1213
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Problem
By-ID reads and updates take 6–9 seconds when
_aclgrants access through group membership. The membership query inGroupMembershipService.membersOf()scans everyMetaEnvelope(1,789,882 in production) to reach 2,959 Group/Chat records.Fix
Adds an index on
MetaEnvelope.ontology, created at startup with the other indexes, so the lookup seeks straight to group records.membersOf()is unchanged, so finding a group by itsenamefield still works.Envelope.valueis deliberately not indexed: it holds arbitrary payloads, and an oversized value could make writes fail.Testing
Benchmark on 1M unrelated records plus 3k groups (Neo4j 5.15; 4.4 was similar):
NodeByLabelScanNodeIndexSeekThese runs reproduce the scan but not production's latency, so the times don't predict production times.
After deploying
Not yet verified on production. Member requests stay slow until the index finishes building on those 1.79M nodes.
SHOW INDEXESlistsmeta_envelope_ontology_indexasONLINE