Xray
1h 6h 24h 48h 3d 5d 7d 14d 30d ‹
Last 1 hour▾
Ends now. Anything up to this cluster's 30-day retention.
Start and end times
Cancel
Interpreted in UTC (change it at the right of this bar). Earliest available: 2026-10-19 17:17:27.
› →|
updated 1d ago
Sample data. This database was generated by scripts/seed_dev_db.py — every service, deploy, person and figure on this page is synthetic. Names are sample.*@seed.invalid and image tags are prefixed SEED-. Nothing here happened.
← query trends

Query shape trend

plan BEDC0EDE · last 1h

Optimizer suggestions — proposals from claude-opus-5-5, 3d ago; suggests only, a human applies

index Add a lookup index on Phi.email
The issueThe only filter is `WHERE p.email=$email` on `(p:Phi)`. Nothing in the statement suggests Phi.email is indexed. Without an index the planner has to run a NodeByLabelScan over every Phi node and check email on each one before it expands HAS_PROTECTED_DATA_IN to Patient. That fits the avg of 1152 ms and p95 of 1933 ms for a query that should only return a handful of rows. The scan cost also grows with the number of Phi nodes, and these are PHI records that keep accumulating.
The fixCreate a range index on :Phi(email) so the planner can start with NodeIndexSeek on p, then expand the relationship to reach the few connected Patient nodes. If email is truly one-per-Phi-node, use a uniqueness constraint instead (CREATE CONSTRAINT phi_email_unique IF NOT EXISTS FOR (p:Phi) REQUIRE p.email IS UNIQUE). It gives you the same backing index and also enforces the data rule. Check for duplicates before creating it. The query text doesn't need to change.
Add this index
CREATE INDEX phi_email IF NOT EXISTS FOR (p:Phi) ON (p.email)
Expected: Each call should go from a full label scan (around 1 s) to an index seek plus a small expansion, likely single-digit milliseconds. This only runs 4 times a week, so total time saved is small (about 4.6 s/week). The main benefit is that latency stops growing with the size of Phi, and full scans of sensitive PHI data stop. If notification volume increases, this lookup becomes far more frequent. · Evidence: Run `SHOW INDEXES YIELD labelsOrTypes, properties WHERE 'Phi' IN labelsOrTypes` to confirm no index covers email yet. Compare PROFILE before and after: the plan should change from NodeByLabelScan(p:Phi) + Filter to NodeIndexSeek(p:Phi(email)), with far fewer db hits. Then watch the p95 for shape BEDC0EDE over the next 7 days. Before choosing the unique constraint, run `MATCH (p:Phi) WITH p.email AS e, count(*) AS c WHERE c > 1 RETURN count(*)` to check for duplicate emails.

Status: proposed · all suggestions

No rollups for this shape in the window.