Xray
daily rollups 1h 6h 24h 48h 3d 5d 7d 14d 30d ‹
Last 14 days▾
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 23:33:18.
› →|
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 3423BD53 · last 14d

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

index Make sure the Document lookup by tildaid is index-backed (preferably a uniqueness constraint)
The issueThe query starts with `MATCH (d:Document {tildaid: $docId})`. Every later clause depends on this one anchor. If `Document.tildaid` has no index or constraint, the planner has to scan every :Document node and filter on tildaid. A label scan whose cost grows with the number of Documents would explain a p95 of 1500 ms against an average of 218 ms better than anything else in the visible text. tildaid looks like a global ID, so it should be unique.
The fixRun `SHOW CONSTRAINTS` and `SHOW INDEXES`, and look for an entry covering `(:Document).tildaid`. If there is none, add a uniqueness constraint. It creates a backing range index and also lets the planner treat the lookup as returning at most one row. If you can't guarantee uniqueness yet, use `CREATE INDEX document_tildaid IF NOT EXISTS FOR (n:Document) ON (n.tildaid)` instead. If either one already exists, skip this suggestion: the anchor is fine, and the slow runs come from somewhere else (see the other items).
Add this index
CREATE CONSTRAINT document_tildaid_unique IF NOT EXISTS FOR (n:Document) REQUIRE n.tildaid IS UNIQUE
Expected: If no index exists today, the anchor should change from a NodeByLabelScan + Filter to a NodeUniqueIndexSeek. That is likely to cut the slow executions to single-digit milliseconds for this step. If an index already exists, expect no change. · Evidence: `SHOW CONSTRAINTS` / `SHOW INDEXES` output for Document.tildaid. An EXPLAIN of the statement whose first operator is NodeUniqueIndexSeek or NodeIndexSeek on Document(tildaid) rather than NodeByLabelScan. p95 for shape 3423BD53 after the deploy.
none PROFILE the full statement: the sub-artifact and fallback-site section is cut off in this shape
The issueIn the normalised text, the part between `MATCH (d:Document …)` and `WITH d, saT, lastSaR, s, fnPrefix, collect(DISTINCT s2) AS fallbackSites` was swallowed by a comment with mis-encoded characters. The MATCH/OPTIONAL MATCH clauses that bind saT, lastSaR, s, s2 and fnPrefix can't be seen. `collect(DISTINCT s2)` is only used to check whether exactly one fallback site exists. That suggests an unanchored or wide expansion to candidate sites, which would get collected and de-duplicated in memory for every row. That is the most likely source of the 1.5 s outlier, but it can't be confirmed or rewritten from this text.
The fixPull the full statement text from the application source or query.log and run PROFILE with a docId from a slow run. Look for a NodeByLabelScan, or a large Expand(All), feeding the collect of s2. Possible fixes: index-back whatever property is used to find s2 (for example a site-number or study property), or cap the collection, since you only need to tell 0, 1 and more than 1 apart. Applying `[x IN collect(DISTINCT s2) WHERE x IS NOT NULL][..2]` doesn't save the expansion, so limit the expansion itself, e.g. with a CALL subquery and LIMIT 2. No rewrite is given here, because writing one against the truncated text would mean inventing clauses.
Expected: Unknown until profiled. If the fallback-site expansion is unanchored, anchoring it or limiting it to 2 rows could take most of the remaining cost out of the slow executions. · Evidence: A PROFILE of the full statement showing db hits and rows per operator, especially the operators before the EagerAggregation for fallbackSites. Also compare the 1500 ms run's docId against typical ones.
none No index needed for the DslPlanDefinition {studyId} filter, and the overall impact is small
The issue`OPTIONAL MATCH (site)-[:PLAN_DEFINITION_TO_SITE]-(pd:DslPlanDefinition {studyId: d.studyId})` is anchored on the already-bound `site`. The planner expands from site and filters pd on studyId and delpending. An index on DslPlanDefinition.studyId would not be used here, and could tempt the planner into a seek plus join that costs more than the expansion. Also, the shape ran only 10 times in 7 days for 2.2 s in total, so the only worthwhile target is the single slow outlier.
The fixLeave this clause as it is. `coalesce(pd.delpending, false) = false` is a cheap per-row filter after a short expansion. Focus on the anchor index and the hidden fallback-site section. If the outlier was a cold page cache or the first-run plan compile, check the planning time and page faults for that run in query.log. Neither of those problems is fixed by schema changes.
Expected: No change from this clause. With only about 10 runs a week, even a large per-call improvement saves very little total time. · Evidence: A PROFILE showing Expand(All)/OptionalExpand from site with low row counts on the pd branch. The query.log entry for the slow run, showing whether planning time or page faults made up most of the 1500 ms.

Status: proposed · all suggestions

No rollups for this shape in the window.