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:57:55.
› →|
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 C242D5FA · last 1h

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

index Index Organization.tildaid for the study.srcorgid join and the recruiterOrg lookup
The issue`MATCH(org:Organization) WHERE org.tildaid=study.srcorgid` and `OPTIONAL MATCH (recruiterOrg:Organization{tildaid: adv.orgid})` both look up Organization by a value that is only known at runtime. Without an index on Organization(tildaid), each one becomes a NodeByLabelScan plus a Filter, and it runs once for every lead/study/patient row. That fits the gap between the 183 ms average and the 470 ms p95.
The fixFirst run SHOW INDEXES / SHOW CONSTRAINTS. If nothing covers Organization(tildaid) yet, create a range index on it. With the index, both lookups become NodeIndexSeek. If tildaid is meant to be a unique business key, a uniqueness constraint would be better (CREATE CONSTRAINT ... REQUIRE o.tildaid IS UNIQUE), because it also backs lookups with an index. Check for duplicates before adding the constraint.
Add this index
CREATE INDEX organization_tildaid IF NOT EXISTS FOR (o:Organization) ON (o.tildaid)
Expected: If a label scan is happening now, each Organization lookup should drop from scanning every Organization node to a single seek, likely cutting several ms to tens of ms per call. With only 2 runs in 7 days, the total saving is small (well under 366 ms a week). The index would mainly help other statements that also filter Organization by tildaid. · Evidence: PROFILE the statement before and after. Look for NodeByLabelScan(Organization) changing to NodeIndexSeek on Organization(tildaid), and for lower db hits on those operators.
index Make sure the Lead entry point uses a tildaid lookup
The issue`MATCH(lead:Lead {tildaid: $id})` is where the whole query starts. If Lead(tildaid) has no index, the query begins by scanning every Lead node, and every later expansion waits on that scan.
The fixIf SHOW INDEXES shows nothing covering Lead(tildaid), create the index (or a uniqueness constraint if tildaid is unique per Lead). The anchor then becomes a single NodeIndexSeek.
Add this index
CREATE INDEX lead_tildaid IF NOT EXISTS FOR (l:Lead) ON (l.tildaid)
Expected: If a scan is happening now, the cost of finding the starting node should drop from proportional to the number of Leads to roughly constant. If an index already exists, nothing changes. · Evidence: In PROFILE, the first operator should show NodeIndexSeek on Lead(tildaid), not NodeByLabelScan. Then compare p95 over the next window.
index Index User.tildaid for the recruiter lookup
The issue`OPTIONAL MATCH (user:User{tildaid: adv.userid})` looks up a User by a runtime value taken from the advocate. Without an index on User(tildaid), this is a label scan over all Users for every advocate row.
The fixIf nothing covers User(tildaid) yet, create a range index on it (or a uniqueness constraint if tildaid is a key). The optional lookup then becomes a NodeIndexSeek.
Add this index
CREATE INDEX user_tildaid IF NOT EXISTS FOR (u:User) ON (u.tildaid)
Expected: This removes a per-row scan of all Users if one exists today. Because the statement runs so rarely, the total benefit is small, but every other User-by-tildaid lookup in dashrsvc would also get faster. · Evidence: PROFILE should show NodeIndexSeek on User(tildaid) for the user OPTIONAL MATCH. SHOW INDEXES should confirm the index is ONLINE.

Status: proposed · all suggestions

No rollups for this shape in the window.