Xray
1h 6h 24h 48h 3d 5d 7d 14d 30d ‹
Last 48 hours▾
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-20 10:28:01.
› →|
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 41

stored 47h ago all 41

Neo4j query shapes on test26 over the last 48h, grouped by plan hash. Click a column to sort; p95 drift (late-half ÷ early-half of the window) ranks the queries getting slower.

Columns
Views
Export CSV
Query shape Count Avg p95 ▴ Max p95 drift
MATCH (org:Organization)-[:ORGANIZATION_TO_WORKPLAN_CFG]->(cfg:WorkplanCfg{tildaid:$cfgId}) RETURN org.tildaid AS orgId
MATCH (org:Organization)-[:ORGANIZATION_TO_WORKPLAN_CFG]->(cfg:WorkplanCfg{tildaid:$cfgId}) RETURN org.tildaid AS orgId
workplansvc
2 0 ms <1 ms 0 ms flat
MATCH (o:Organization{tildaid:$orgId})-[:ORGANIZATION_TO_CONTACT_AREA]->(ca:ContactArea{tildaid:$categoryId, delpending:false}) RETURN coalesce(ca.seedKey, ?) AS seedKey
MATCH (o:Organization{tildaid:$orgId})-[:ORGANIZATION_TO_CONTACT_AREA]->(ca:ContactArea{tildaid:$categoryId, delpending:false}) RETURN coalesce(ca.seedKey, ?) AS seedKey
workplansvc
2 0 ms <1 ms 0 ms flat
MATCH (cfg:WorkplanCfg{tildaid:$cfgId}) RETURN cfg.recipientOverrideList
MATCH (cfg:WorkplanCfg{tildaid:$cfgId}) RETURN cfg.recipientOverrideList
workplansvc
2 0 ms <1 ms 0 ms flat
MATCH (wp:WorkPlanInstance {hasBlockedVariables: true}) WHERE wp.state <> ? AND coalesce(wp.variableWaitCheckedAt, ?) < $before RETURN wp.tildaid ORDER BY coalesce(wp.variableWaitCheckedAt, ?) LIMIT $limit
MATCH (wp:WorkPlanInstance {hasBlockedVariables: true}) WHERE wp.state <> ? AND coalesce(wp.variableWaitCheckedAt, ?) < $before RETURN wp.tildaid ORDER BY coalesce(wp.variableWaitCheckedAt, ?) LIMIT $limit
workplansvc
10 <1 ms 2 ms 1 ms flat
MATCH (cfg:WorkplanCfg)-[:WORKPLAN_CFG_TO_INSTANCE]->(wp:WorkPlanInstance) WHERE wp.checkpointRejectCascadePendingAt > ? AND coalesce(wp.state, ?) <> $archivedState AND $nowMs - coalesce(wp.checkpointRejectCascadeClaimedAt, ?) >= ? OPTIONA…
MATCH (cfg:WorkplanCfg)-[:WORKPLAN_CFG_TO_INSTANCE]->(wp:WorkPlanInstance) WHERE wp.checkpointRejectCascadePendingAt > ? AND coalesce(wp.state, ?) <> $archivedState AND $nowMs - coalesce(wp.checkpointRejectCascadeClaimedAt, ?) >= ? OPTIONAL MATCH (org:Organization {tildaid: cfg.orgid}) OPTIONAL MATCH (reviewer:User {tildaid: wp.checkpointRejectCascadeReviewerId}) RETURN wp.tildaid AS instanceId, coalesce(wp.checkpointRejectCascadeGateItemId, ?) AS gateItemId, coalesce(wp.checkpointRejectCascadeReviewerId, ?) AS reviewerId, coalesce(reviewer.name, ?) AS reviewerName, coalesce(reviewer.email, ?) AS reviewerEmail, coalesce(wp.checkpointRejectCascadeNotes, ?) AS notes, cfg.tildaid AS cfgId, coalesce(org.alias, ?) AS orgAlias LIMIT $limit
workplansvc
10 <1 ms 2 ms 1 ms flat
MATCH (cfg:WorkplanCfg)-[:WORKPLAN_CFG_TO_INSTANCE]->(wp:WorkPlanInstance)-[:WORKPLAN_INSTANCE_TO_MILESTONE]->(:WorkPlanMilestone)-[:REL_WORKPLAN_INSTANCE_MILESTONE_TO_ITEM]->(item:WorkplanInstanceMilestoneItem) WHERE coalesce(item.depende…
MATCH (cfg:WorkplanCfg)-[:WORKPLAN_CFG_TO_INSTANCE]->(wp:WorkPlanInstance)-[:WORKPLAN_INSTANCE_TO_MILESTONE]->(:WorkPlanMilestone)-[:REL_WORKPLAN_INSTANCE_MILESTONE_TO_ITEM]->(item:WorkplanInstanceMilestoneItem) WHERE coalesce(item.dependencyResolutionRequestedAt, ?) > ? AND $nowMs - item.dependencyResolutionRequestedAt >= $windowMs AND wp.state <> ? AND NOT EXISTS { MATCH (ctx:WorkPlanContext{workplanConfigId: wp.tildaid, contextType:?}) } OPTIONAL MATCH (org:Organization {tildaid: cfg.orgid}) RETURN DISTINCT wp.tildaid AS id, cfg.tildaid AS cfgId, coalesce(org.alias, ?) AS orgAlias LIMIT $limit
workplansvc
10 <1 ms 2 ms 1 ms flat
MATCH (j:ZipExtractionJob {status: $status}) WHERE coalesce(j.attempts, ?) < $max_attempts AND j.lastAttemptAt < timestamp() - $stale_ms MATCH (d:Document {tildaid: j.zipDocId}) WHERE coalesce(d.archived, false) = false CALL (j) { MATCH (m…
MATCH (j:ZipExtractionJob {status: $status}) WHERE coalesce(j.attempts, ?) < $max_attempts AND j.lastAttemptAt < timestamp() - $stale_ms MATCH (d:Document {tildaid: j.zipDocId}) WHERE coalesce(d.archived, false) = false CALL (j) { MATCH (m:ZipExtractionMember {zipDocId: j.zipDocId}) RETURN count(m) AS ledger_rows, max(m.updatedAt) AS last_member_at } WITH j, d, ledger_rows, last_member_at // A crash between recording the job and the first ledger write leaves no // members at all; fall back to the job's own timestamp so those are still // found rather than sitting unnoticed forever. WHERE CASE WHEN ledger_rows = ? THEN true ELSE last_member_at < timestamp() - $stale_ms END // Who uploaded the archive: the resume acts as them, so the member documents it // creates through docsvc (and the processing they trigger) are attributed to them. OPTIONAL MATCH (d)-[:UPLOADED_BY]->(uploader:User) WITH j, ledger_rows, head(collect(uploader.email)) AS uploader_email RETURN j.zipDocId AS zip_doc_id, j.orgAlias AS org_alias, coalesce(j.attempts, ?) AS attempts, ledger_rows AS ledger_rows, uploader_email ORDER BY j.lastAttemptAt ASC LIMIT $limit
docproc
2 <1 ms 2 ms 1 ms flat
MATCH (r:TmfEvaluationRun {status: $running}) WHERE r.deltimestamp = ? AND coalesce(r.updatedat, r.createdat) < $cutoff RETURN r.tildaid AS tildaid, r.trainingId AS trainingId, r.tmfVersion AS tmfVersion, r.startedBy AS startedBy ORDER BY …
MATCH (r:TmfEvaluationRun {status: $running}) WHERE r.deltimestamp = ? AND coalesce(r.updatedat, r.createdat) < $cutoff RETURN r.tildaid AS tildaid, r.trainingId AS trainingId, r.tmfVersion AS tmfVersion, r.startedBy AS startedBy ORDER BY coalesce(r.updatedat, r.createdat) ASC LIMIT $limit
docproc
2 <1 ms 2 ms 1 ms flat
MATCH (d:Document {status: $status, archived: true})-[:DOC_TO_ORG]->(o:Organization) RETURN d.tildaid, o.tildaid, o.alias LIMIT ?
MATCH (d:Document {status: $status, archived: true})-[:DOC_TO_ORG]->(o:Organization) RETURN d.tildaid, o.tildaid, o.alias LIMIT ?
docsvc
2 <1 ms 2 ms 1 ms flat
MATCH (item:WorkplanInstanceMilestoneItem) WHERE item.cfgMilestoneItemId = $cfgMilestoneItemId AND item.scopeId IN $scopeIds RETURN item.scopeId AS scopeId, item.tildaid AS id
MATCH (item:WorkplanInstanceMilestoneItem) WHERE item.cfgMilestoneItemId = $cfgMilestoneItemId AND item.scopeId IN $scopeIds RETURN item.scopeId AS scopeId, item.tildaid AS id
workplansvc
2 <1 ms 2 ms 1 ms flat
MATCH (item:WorkplanInstanceMilestoneItem{cfgMilestoneItemId:$cfgMilestoneItemId, scopeId:$scopeId}) RETURN item
MATCH (item:WorkplanInstanceMilestoneItem{cfgMilestoneItemId:$cfgMilestoneItemId, scopeId:$scopeId}) RETURN item
workplansvc
2 <1 ms 2 ms 1 ms flat
MATCH (wp:WorkPlanInstance{tildaid:$instanceId})-[:WORKPLAN_INSTANCE_TO_MILESTONE]->(m:WorkPlanMilestone)-[:REL_WORKPLAN_INSTANCE_MILESTONE_TO_ITEM]->(item:WorkplanInstanceMilestoneItem) WHERE item.tildaid <> $currentItemId AND item.itemTy…
MATCH (wp:WorkPlanInstance{tildaid:$instanceId})-[:WORKPLAN_INSTANCE_TO_MILESTONE]->(m:WorkPlanMilestone)-[:REL_WORKPLAN_INSTANCE_MILESTONE_TO_ITEM]->(item:WorkplanInstanceMilestoneItem) WHERE item.tildaid <> $currentItemId AND item.itemType = ? AND coalesce(item.workOrderId, ?) <> ? MATCH (w:WorkOrder) WHERE w.tildaid = item.workOrderId AND coalesce(w.rfc_msgid, ?) <> ? RETURN item.tildaid as itemId, coalesce(item.itemConfig, ?) as itemConfig, coalesce(m.name, ?) as milestoneName, w.rfc_msgid as rfcMsgid, coalesce(w.email_subject, w.title, ?) as emailSubject, coalesce(item.activateRequestedAt, ?) as activateRequestedAt ORDER BY item.activateRequestedAt
workplansvc
2 <1 ms 2 ms 1 ms flat
MATCH (task:Task) WHERE task.task_number = ? AND EXISTS { (task)-[:BELONGS_TO]->(:Inbox{type:?})-[:MANAGED_BY]->(:Organization) } RETURN task.tildaid LIMIT ?
MATCH (task:Task) WHERE task.task_number = ? AND EXISTS { (task)-[:BELONGS_TO]->(:Inbox{type:?})-[:MANAGED_BY]->(:Organization) } RETURN task.tildaid LIMIT ?
tusker
5 <1 ms 2 ms 1 ms flat
MATCH (cfg:WorkplanCfg)-[:WORKPLAN_CFG_TO_INSTANCE]->(wp:WorkPlanInstance) WHERE wp.checkpointDecisionFollowupPendingAt > ? AND coalesce(wp.state, ?) <> $archivedState AND $nowMs - coalesce(wp.checkpointDecisionFollowupClaimedAt, ?) >= ? R…
MATCH (cfg:WorkplanCfg)-[:WORKPLAN_CFG_TO_INSTANCE]->(wp:WorkPlanInstance) WHERE wp.checkpointDecisionFollowupPendingAt > ? AND coalesce(wp.state, ?) <> $archivedState AND $nowMs - coalesce(wp.checkpointDecisionFollowupClaimedAt, ?) >= ? RETURN wp.tildaid AS instanceId, cfg.tildaid AS cfgId LIMIT $limit
workplansvc
10 <1 ms 2 ms 1 ms flat
UNWIND $itemIds AS iid MATCH (cfg:WorkplanCfg)-[:WORKPLAN_CFG_TO_INSTANCE]->(wp:WorkPlanInstance)-[:WORKPLAN_INSTANCE_TO_MILESTONE]->(m:WorkPlanMilestone)-[:REL_WORKPLAN_INSTANCE_MILESTONE_TO_ITEM]->(item:WorkplanInstanceMilestoneItem{tild…
UNWIND $itemIds AS iid MATCH (cfg:WorkplanCfg)-[:WORKPLAN_CFG_TO_INSTANCE]->(wp:WorkPlanInstance)-[:WORKPLAN_INSTANCE_TO_MILESTONE]->(m:WorkPlanMilestone)-[:REL_WORKPLAN_INSTANCE_MILESTONE_TO_ITEM]->(item:WorkplanInstanceMilestoneItem{tildaid: iid}) OPTIONAL MATCH (org:Organization {tildaid: cfg.orgid}) RETURN wp.tildaid AS instanceId, wp.scopeId AS siteId, cfg.tildaid AS cfgId, cfg.studyId AS studyId, coalesce(org.alias, ?) AS orgAlias, item.tildaid as id, coalesce(item.cfgMilestoneItemId, ?) as cfgMilestoneItemId, item.itemId as itemId, item.itemType as itemType, item.workOrderId as workOrderId, coalesce(item.edlEventId, ?) as edlEventId, coalesce(item.edlEventScopeId, ?) as edlEventScopeId, coalesce(item.edlScopeActivatedAt, ?) as edlScopeActivatedAt, coalesce(item.edlScopeCompletedAt, ?) as edlScopeCompletedAt, coalesce(item.taskActivatedAt, ?) as taskActivatedAt, coalesce(item.activateRequestedAt, ?) as activateRequestedAt, coalesce(item.workOrderResolvedAt, ?) as workOrderResolvedAt, coalesce(item.workOrderCompletedAt, ?) as workOrderCompletedAt, coalesce(item.workOrderLastSeenStatus, ?) as workOrderLastSeenStatus, coalesce(item.taskCompletedAt, ?) as taskCompletedAt, coalesce(item.skippedAt, ?) as skippedAt, coalesce(item.notApplicableAt, ?) as notApplicableAt, coalesce(item.itemConfig, ?) as itemConfig, coalesce(item.workOrderActivationFailedAt, ?) as workOrderActivationFailedAt, coalesce(item.workOrderActivationErrorCode, ?) as workOrderActivationErrorCode, coalesce(item.workOrderActivationErrorMessage, ?) as workOrderActivationErrorMessage
workplansvc
2 1 ms 2 ms 1 ms flat
MATCH (cfgItem:WorkPlanMilestoneItem) WHERE cfgItem.itemType = ? AND coalesce(cfgItem.cfgItemInvalid, false) = false AND cfgItem.checkpointLastComputedGenId > ? MATCH (wp:WorkPlanInstance)-[:WORKPLAN_INSTANCE_TO_MILESTONE]->(:WorkPlanMiles…
MATCH (cfgItem:WorkPlanMilestoneItem) WHERE cfgItem.itemType = ? AND coalesce(cfgItem.cfgItemInvalid, false) = false AND cfgItem.checkpointLastComputedGenId > ? MATCH (wp:WorkPlanInstance)-[:WORKPLAN_INSTANCE_TO_MILESTONE]->(:WorkPlanMilestone)-[:REL_WORKPLAN_INSTANCE_MILESTONE_TO_ITEM]->(item:WorkplanInstanceMilestoneItem) WHERE item.cfgMilestoneItemId = cfgItem.tildaid AND wp.state <> ? AND coalesce(item.checkpointQueuedAt, ?) > ? AND coalesce(item.checkpointCompletedAt, ?) = ? AND coalesce(item.checkpointRejectedAt, ?) = ? AND coalesce(item.skippedAt, ?) = ? AND coalesce(item.notApplicableAt, ?) = ? AND coalesce(item.checkpointGenId, ?) < cfgItem.checkpointLastComputedGenId AND (coalesce(item.checkpointScoreFailedAt, ?) = ? OR $nowMs - item.checkpointScoreFailedAt >= ?) RETURN item.tildaid AS instanceMilestoneItemId, wp.tildaid AS instanceId, cfgItem.tildaid AS cfgMilestoneItemId, cfgItem.checkpointLastComputedGenId AS lastComputedGenId ORDER BY item.checkpointQueuedAt LIMIT $limit
workplansvc
10 1 ms 2 ms 1 ms flat
MATCH (item:WorkPlanMilestoneItem{tildaid:$itemId}) OPTIONAL MATCH (item)-[depRel:WORKPLAN_MILESTONE_ITEM_DEPENDENCY]->(dep:WorkPlanMilestoneItemDependency)-[:DEPENDS_ON]->(depItem:WorkPlanMilestoneItem) RETURN item, collect(DISTINCT {depe…
MATCH (item:WorkPlanMilestoneItem{tildaid:$itemId}) OPTIONAL MATCH (item)-[depRel:WORKPLAN_MILESTONE_ITEM_DEPENDENCY]->(dep:WorkPlanMilestoneItemDependency)-[:DEPENDS_ON]->(depItem:WorkPlanMilestoneItem) RETURN item, collect(DISTINCT {dependsOnItemId: dep.dependsOnItemId, dependsOnMilestoneItemTildaid: coalesce(dep.dependsOnMilestoneItemTildaid, ?), dependencyType: dep.dependencyType, deferredDocumentCount: coalesce(dep.deferredDocumentCount, ?), deferredFormCount: coalesce(dep.deferredFormCount, ?), supplyReasoning: coalesce(dep.supplyReasoning, ?), gatesDownstreamItem: coalesce(dep.gatesDownstreamItem, false)}) as deps
workplansvc
2 1 ms 2 ms 1 ms flat
// Seeded from AIRun.status, not from a Document label scan: as a single MATCH the // planner drove this from (d:Document), scanning ?,? nodes every sweep to reach // ~? linked runs (?,? db hits measured). The status list is hoisted out of…
// Seeded from AIRun.status, not from a Document label scan: as a single MATCH the // planner drove this from (d:Document), scanning ?,? nodes every sweep to reach // ~? linked runs (?,? db hits measured). The status list is hoisted out of the // OR to make it seekable, and the collect/UNWIND is a planner barrier — without it // the Document scan was still preferred even with AIRun_status present. Degrades to // an AIRun label scan if that index is missing, so it is safe ahead of the migration. MATCH (ai:AIRun) WHERE ai.status IN [?, ?] AND ( (ai.status = ? AND ($cutoff_ms <= ? OR COALESCE(ai.updatedat, ai.createdat) < $cutoff_ms)) OR (ai.status = ? AND ($aborted_cutoff_ms <= ? OR COALESCE(ai.updatedat, ai.createdat) < $aborted_cutoff_ms)) ) WITH collect(ai) AS adoptable_runs UNWIND adoptable_runs AS ai MATCH (ai)-[:AI_RUN_TO_DOCUMENT_LATEST]->(d:Document) WHERE d.aiEnabled = true RETURN count(ai) AS total
docproc
19 1 ms 2 ms 1 ms flat
MATCH (cfg:WorkplanCfg)-[:WORKPLAN_CFG_TO_MILESTONE]->(milestone:WorkPlanMilestone)-[:WORKPLAN_MILESTONE_TO_MILESTONE_ITEM]->(item:WorkPlanMilestoneItem) WHERE item.itemType = ? AND coalesce(item.cfgItemInvalid, false) = false AND mileston…
MATCH (cfg:WorkplanCfg)-[:WORKPLAN_CFG_TO_MILESTONE]->(milestone:WorkPlanMilestone)-[:WORKPLAN_MILESTONE_TO_MILESTONE_ITEM]->(item:WorkPlanMilestoneItem) WHERE item.itemType = ? AND coalesce(item.cfgItemInvalid, false) = false AND milestone.scoringMode = ? AND item.checkpointPendingGenId > coalesce(item.checkpointLastComputedGenId, ?) AND (coalesce(item.checkpointGenerateRequestGenId, ?) <> item.checkpointPendingGenId OR $nowMs - coalesce(item.checkpointGenerateRequestSentAt, ?) >= ?) AND NOT (coalesce(item.checkpointUnsupportedGenId, ?) = item.checkpointPendingGenId AND coalesce(item.checkpointUnsupportedCount, ?) >= $maxUnsupported) AND coalesce(cfg.state, ?) <> ? OPTIONAL MATCH (org:Organization {tildaid: cfg.orgid}) RETURN item.tildaid AS cfgMilestoneItemId, cfg.tildaid AS cfgId, milestone.tildaid AS milestoneId, coalesce(item.itemConfig, ?) AS itemConfig, item.checkpointPendingGenId AS pendingGenId, coalesce(org.alias, ?) AS orgAlias, coalesce(item.checkpointPendingBy, ?) AS pendingBy LIMIT $limit
workplansvc
10 1 ms 4 ms 2 ms flat
MATCH (wp:WorkPlanInstance)-[:WORKPLAN_INSTANCE_TO_MILESTONE]->(:WorkPlanMilestone)-[:REL_WORKPLAN_INSTANCE_MILESTONE_TO_ITEM]->(item:WorkplanInstanceMilestoneItem) WHERE item.itemType = ? AND wp.state <> ? AND (coalesce(item.readyAt, ?) >…
MATCH (wp:WorkPlanInstance)-[:WORKPLAN_INSTANCE_TO_MILESTONE]->(:WorkPlanMilestone)-[:REL_WORKPLAN_INSTANCE_MILESTONE_TO_ITEM]->(item:WorkplanInstanceMilestoneItem) WHERE item.itemType = ? AND wp.state <> ? AND (coalesce(item.readyAt, ?) > ? OR coalesce(item.vaWoInstanceFetchRequestSentAt, ?) > ?) AND coalesce(item.workOrderId, ?) = ? AND coalesce(item.skippedAt, ?) = ? AND coalesce(item.notApplicableAt, ?) = ? AND coalesce(item.expectedAttachmentUnresolvedAt, ?) = ? AND (coalesce(item.vaWoInstanceFetchRequestSentAt, ?) = ? OR $nowMs - item.vaWoInstanceFetchRequestSentAt >= $windowMs) AND (coalesce(item.workOrderCreateUnresolvableAt, ?) = ? OR $nowMs - item.workOrderCreateUnresolvableAt >= $windowMs) RETURN item.tildaid AS id LIMIT $limit
workplansvc
10 1 ms 4 ms 2 ms flat
MATCH (d:Document) WHERE d.reviewStrategy = ? AND d.aiEnabled = true AND d.delpending = false AND d.primaryVersionId IS NOT NULL AND d.primaryVersionId <> ? MATCH (d)-[:HAS]->(a:DocumentAnnotation) WHERE a.completedAt IS NOT NULL AND a.com…
MATCH (d:Document) WHERE d.reviewStrategy = ? AND d.aiEnabled = true AND d.delpending = false AND d.primaryVersionId IS NOT NULL AND d.primaryVersionId <> ? MATCH (d)-[:HAS]->(a:DocumentAnnotation) WHERE a.completedAt IS NOT NULL AND a.completedAt > ? // Cap is scoped to THIS completion: a poison row keeps its sweep slot only // while the exhausted attempts were counted against the current completedAt; // a newer completion (different completedAt) gets a fresh budget. AND (COALESCE(d.burnAttempts, ?) < $attempt_cap OR COALESCE(d.burnAttemptsCompletedAt, -?) <> a.completedAt) AND NOT EXISTS { MATCH (d)-[:DOCUMENT_VERSION]->(rv:DocumentVersion) WHERE rv.uploadMethod = ? AND rv.renderedCompletedAt = a.completedAt } MATCH (d)-[:DOC_TO_ORG]->(o:Organization) RETURN d.tildaid AS document_id, d.primaryVersionId AS version_id, o.alias AS org_alias, a.completedAt AS completed_at, a.completedFieldsRevision AS completed_fields_revision, a.completedSignersRevision AS completed_signers_revision LIMIT $limit
docproc
3 1 ms 5 ms 2 ms flat
MATCH (cfg:WorkplanCfg)-[:WORKPLAN_CFG_TO_MILESTONE]->(:WorkPlanMilestone)-[:WORKPLAN_MILESTONE_TO_MILESTONE_ITEM]->(item:WorkPlanMilestoneItem) WHERE (item.itemType IN [?, ?] OR (item.itemType = ? AND coalesce(item.branchCaseHead, false) …
MATCH (cfg:WorkplanCfg)-[:WORKPLAN_CFG_TO_MILESTONE]->(:WorkPlanMilestone)-[:WORKPLAN_MILESTONE_TO_MILESTONE_ITEM]->(item:WorkPlanMilestoneItem) WHERE (item.itemType IN [?, ?] OR (item.itemType = ? AND coalesce(item.branchCaseHead, false) = true)) AND coalesce(item.cfgItemInvalid, false) = false AND item.gatePendingGenId > coalesce(item.gateLastComputedGenId, ?) AND (coalesce(item.gateResolveRequestGenId, ?) <> item.gatePendingGenId OR $nowMs - coalesce(item.gateResolveRequestSentAt, ?) >= ?) AND NOT (coalesce(item.gateUnsupportedGenId, ?) = item.gatePendingGenId AND coalesce(item.gateUnsupportedCount, ?) >= $maxUnsupported) AND coalesce(cfg.state, ?) <> ? OPTIONAL MATCH (item)-[:WORKPLAN_MILESTONE_ITEM_DEPENDENCY]->(dep:WorkPlanMilestoneItemDependency) WHERE coalesce(dep.gatesDownstreamItem, false) = true WITH cfg, item, dep ORDER BY dep.createdat ASC WITH cfg, item, collect(dep)[?] AS firstDep WHERE ((firstDep IS NOT NULL AND coalesce(item.branchGroupId, ?) = ?) OR (coalesce(item.branchCaseHead, false) = true AND coalesce(item.branchCaseDefault, false) = false)) AND coalesce(item.branchCaseAmbiguity, ?) = ? OPTIONAL MATCH (cfg)-[:WORKPLAN_CFG_TO_MILESTONE]->(:WorkPlanMilestone)-[:WORKPLAN_MILESTONE_TO_MILESTONE_ITEM]->(sib:WorkPlanMilestoneItem) WHERE coalesce(item.branchGroupId, ?) <> ? AND sib.branchGroupId = item.branchGroupId AND sib.tildaid <> item.tildaid AND coalesce(sib.branchCaseHead, false) = true AND coalesce(sib.branchCaseDefault, false) = false AND coalesce(sib.cfgItemInvalid, false) = false WITH cfg, item, firstDep, sib ORDER BY sib.branchCaseIndex ASC WITH cfg, item, firstDep, collect(sib.branchCaseSentence) AS siblingSentences OPTIONAL MATCH (org:Organization {tildaid: cfg.orgid}) RETURN item.tildaid AS cfgMilestoneItemId, cfg.tildaid AS cfgId, CASE WHEN coalesce(item.branchCaseHead, false) = true THEN coalesce(item.branchSourceCfgItemId, ?) ELSE coalesce(firstDep.dependsOnMilestoneItemTildaid, ?) END AS sourceMilestoneItemId, CASE WHEN coalesce(item.branchCaseHead, false) = true AND coalesce(item.branchCaseSentence, ?) <> ? THEN item.branchCaseSentence ELSE coalesce(firstDep.supplyReasoning, ?) END AS supplyReasoning, item.gatePendingGenId AS pendingGenId, coalesce(org.alias, ?) AS orgAlias, coalesce(item.branchCaseSentence, ?) AS caseSentence, siblingSentences, coalesce(item.branchCaseTree, ?) AS caseTree LIMIT $limit
workplansvc
10 2 ms 5 ms 2 ms flat
// Same AIRun.status seeding and collect/UNWIND barrier as // count_in_progress_and_aborted_ai_runs; see the note there. MATCH (ai:AIRun) WHERE ai.status IN [?, ?] AND ( (ai.status = ? AND ($cutoff_ms <= ? OR COALESCE(ai.updatedat, ai.crea…
// Same AIRun.status seeding and collect/UNWIND barrier as // count_in_progress_and_aborted_ai_runs; see the note there. MATCH (ai:AIRun) WHERE ai.status IN [?, ?] AND ( (ai.status = ? AND ($cutoff_ms <= ? OR COALESCE(ai.updatedat, ai.createdat) < $cutoff_ms)) OR (ai.status = ? AND ($aborted_cutoff_ms <= ? OR COALESCE(ai.updatedat, ai.createdat) < $aborted_cutoff_ms)) ) WITH collect(ai) AS adoptable_runs UNWIND adoptable_runs AS ai MATCH (ai)-[:AI_RUN_TO_DOCUMENT_LATEST]->(d:Document) WHERE d.aiEnabled = true // A batch run's documents it already finished are dropped here, before LIMIT, or a // page of finished rows hides the outstanding ones on every sweep. AND (size(COALESCE(ai.document_ids, [])) < ? OR ai.result_info IS NULL OR NOT d.tildaid IN [r IN COALESCE(apoc.convert.fromJsonMap(ai.result_info).document_results, []) WHERE r.success | r.document_id]) MATCH (d)-[:DOC_TO_ORG]->(o:Organization) OPTIONAL MATCH (d)-[:UPLOADED_BY]->(uploader:User) WITH ai, d, o, head(collect(uploader.email)) AS uploaded_by RETURN d.tildaid AS document_id, d.primaryVersionId AS version_id, ai.tildaid AS ai_run_id, d.studyId AS study_id, ai.run_type AS run_type, o.tildaid AS org_id, o.alias AS org_alias, COALESCE(ai.updatedat, ai.createdat) AS last_touched_ms, ai.status AS ai_run_status, COALESCE(ai.auto_retry_count, ?) AS current_retry_count, ai.status = ? AND COALESCE(ai.error_detail, ?) STARTS WITH $shutdown_abort_detail AS shutdown_abort, COALESCE(ai.shutdown_abort_count, ?) AS shutdown_abort_count, // carries the trace + identity of whoever caused this run; see origin_context() ai.request_info AS request_info, // who the document belongs to, for when request_info carries no identity uploaded_by ORDER BY COALESCE(ai.updatedat, ai.createdat) ASC LIMIT $limit
docproc
3 2 ms 5 ms 2 ms flat
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDe…
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDefinition{type:?}) match (sitePd)-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]->(w:WorkflowV2)<-[:TRIGGER_TO_WORKFLOW]-(t:Trigger{scope:?}) match (sitePd)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (sitePd)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) match (scopeUser)-[:STUDYSITEACTOR_TO_ACTOR]->(actor:Actor{delpending:false})<-[:STUDY_TO_ACTOR]-(st) where not exists((scopeUser)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) return distinct scopeUser.tildaid as scopeTildaid, t.scope as workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, scopeUser.roles as roles UNION // Second part for StudySite scope match (t:Trigger{scope:?})-[:TRIGGER_TO_WORKFLOW]->(w:WorkflowV2) match (w)<-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]-(scopeSite:DslPlanDefinition{type:?}) where not exists((scopeSite)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) with distinct t.scope as workflowScope, scopeSite match (scopeSite)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (scopeSite)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) return distinct scopeSite.tildaid as scopeTildaid, workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, null as roles
write docsvc
3 3 ms 5 ms 3 ms flat
MATCH (t:Task)-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(ptl:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(pa:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]->(pw:ParticipantWorkflow) WHERE t.state IN [?, ?] …
MATCH (t:Task)-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(ptl:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(pa:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]->(pw:ParticipantWorkflow) WHERE t.state IN [?, ?] AND ptc.status <> ? RETURN DISTINCT t.tildaid UNION MATCH (t:Task)-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(ptl:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(pc:ParticipantControl)-[:PARTICIPANT_CONTROL]-(pa:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]->(pw:ParticipantWorkflow) WHERE t.state IN [?, ?] AND ptc.status <> ? RETURN DISTINCT t.tildaid UNION match (t:Task)-[:CREATED_FROM_SPEC]-(ptd:ParticipantTodo)-[:PARTICIPANT_TODO]-(pc:ParticipantControl)-[:PARTICIPANT_CONTROL]-(pa:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]-(pw:ParticipantWorkflow) where t.state in [?, ?] and ptd.status <> ? return distinct t.tildaid
regsvc
1 3 ms 5 ms 3 ms flat
MATCH (t:Task)-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(ptl:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(pa:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]->(pw:ParticipantWorkflow) WHERE t.state IN [?, ?] …
MATCH (t:Task)-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(ptl:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(pa:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]->(pw:ParticipantWorkflow) WHERE t.state IN [?, ?] AND ptc.status <> ? RETURN DISTINCT t.tildaid UNION MATCH (t:Task)-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(ptl:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(pc:ParticipantControl)-[:PARTICIPANT_CONTROL]-(pa:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]->(pw:ParticipantWorkflow) WHERE t.state IN [?, ?] AND ptc.status <> ? RETURN DISTINCT t.tildaid UNION match (t:Task)-[:CREATED_FROM_SPEC]-(ptd:ParticipantTodo)-[:PARTICIPANT_TODO]-(pc:ParticipantControl)-[:PARTICIPANT_CONTROL]-(pa:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]-(pw:ParticipantWorkflow) where t.state in [?, ?] and ptd.status <> ? return distinct t.tildaid
regsvc
2 3 ms 5 ms 3 ms flat
MATCH (currentUser:User{deltimestamp:?,deltimestamp:?,email:$email}) WHERE (currentUser.isDummy IS NULL OR currentUser.isDummy <> true) OPTIONAL MATCH (supportUser:User{email:$supportUserEmail}) OPTIONAL MATCH (targetOrg:Organization{delpe…
MATCH (currentUser:User{deltimestamp:?,deltimestamp:?,email:$email}) WHERE (currentUser.isDummy IS NULL OR currentUser.isDummy <> true) OPTIONAL MATCH (supportUser:User{email:$supportUserEmail}) OPTIONAL MATCH (targetOrg:Organization{delpending:false, alias:$orgAlias}) // A deactivated (Inactive) org actor is not a membership (ENG-?). OPTIONAL MATCH (currentUser)-[:FOR_USER]-(orgActor:Actor{delpending:false})-[:ORGANIZATION_TO_ACTOR]-(targetOrg) WHERE coalesce(orgActor.state, ?) <> ? OPTIONAL MATCH (currentUser)-[supports:SUPPORTS_ORG]-(targetOrg) WITH *, false AS repOf // Evaluated only for non-members; members are decided by orgActor alone. WITH *, CASE WHEN orgActor IS NULL THEN EXISTS { MATCH (currentUser)<-[:FOR_USER]-(da:Actor{delpending:false})<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study{delpending:false})-[:STUDY_TO_ORG]->(targetOrg), (da)-[:APPOINTED_AS]->(dr:Role)<-[:APPOINTED_AS]-(sa:Actor{delpending:false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization{alias:$tildaScaleAlias}) WHERE st.srcorgid = targetOrg.tildaid AND da.state <> ? AND sa.state <> ? AND $orgDelegatedTag IN apoc.text.split(coalesce(dr.tags, ?), ?) } ELSE false END as delegated RETURN CASE WHEN orgActor is not null THEN currentUser WHEN delegated THEN currentUser WHEN repOf THEN currentUser WHEN supports is not null THEN coalesce(supportUser, currentUser) ELSE currentUser END as user, CASE WHEN orgActor is not null OR delegated OR repOf OR supports is not null THEN targetOrg ELSE null END as org, currentUser as tokenUser
studiosvc
4 3 ms 5 ms 4 ms flat
MATCH (currentUser:User{deltimestamp:?,deltimestamp:?,email:$email}) WHERE (currentUser.isDummy IS NULL OR currentUser.isDummy <> true) OPTIONAL MATCH (supportUser:User{email:$supportUserEmail}) OPTIONAL MATCH (targetOrg:Organization{delpe…
MATCH (currentUser:User{deltimestamp:?,deltimestamp:?,email:$email}) WHERE (currentUser.isDummy IS NULL OR currentUser.isDummy <> true) OPTIONAL MATCH (supportUser:User{email:$supportUserEmail}) OPTIONAL MATCH (targetOrg:Organization{delpending:false, alias:$orgAlias}) // A deactivated (Inactive) org actor is not a membership (ENG-?). OPTIONAL MATCH (currentUser)-[:FOR_USER]-(orgActor:Actor{delpending:false})-[:ORGANIZATION_TO_ACTOR]-(targetOrg) WHERE coalesce(orgActor.state, ?) <> ? OPTIONAL MATCH (currentUser)-[supports:SUPPORTS_ORG]-(targetOrg) WITH *, false AS repOf // Evaluated only for non-members; members are decided by orgActor alone. WITH *, CASE WHEN orgActor IS NULL THEN EXISTS { MATCH (currentUser)<-[:FOR_USER]-(da:Actor{delpending:false})<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study{delpending:false})-[:STUDY_TO_ORG]->(targetOrg), (da)-[:APPOINTED_AS]->(dr:Role)<-[:APPOINTED_AS]-(sa:Actor{delpending:false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization{alias:$tildaScaleAlias}) WHERE st.srcorgid = targetOrg.tildaid AND da.state <> ? AND sa.state <> ? AND $orgDelegatedTag IN apoc.text.split(coalesce(dr.tags, ?), ?) } ELSE false END as delegated RETURN CASE WHEN orgActor is not null THEN currentUser WHEN delegated THEN currentUser WHEN repOf THEN currentUser WHEN supports is not null THEN coalesce(supportUser, currentUser) ELSE currentUser END as user, CASE WHEN orgActor is not null OR delegated OR repOf OR supports is not null THEN targetOrg ELSE null END as org, currentUser as tokenUser
studiosvc
26 3 ms 5 ms 4 ms flat
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDe…
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDefinition{type:?}) match (sitePd)-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]->(w:WorkflowV2)<-[:TRIGGER_TO_WORKFLOW]-(t:Trigger{scope:?}) match (sitePd)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (sitePd)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) match (scopeUser)-[:STUDYSITEACTOR_TO_ACTOR]->(actor:Actor{delpending:false})<-[:STUDY_TO_ACTOR]-(st) where not exists((scopeUser)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) return distinct scopeUser.tildaid as scopeTildaid, t.scope as workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, scopeUser.roles as roles UNION // Second part for StudySite scope match (t:Trigger{scope:?})-[:TRIGGER_TO_WORKFLOW]->(w:WorkflowV2) match (w)<-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]-(scopeSite:DslPlanDefinition{type:?}) where not exists((scopeSite)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) with distinct t.scope as workflowScope, scopeSite match (scopeSite)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (scopeSite)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) return distinct scopeSite.tildaid as scopeTildaid, workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, null as roles
write workplansvc
16 4 ms 5 ms 4 ms flat
RETURN EXISTS { MATCH (cfg2:WorkplanCfg) WHERE cfg2.progressPending = true AND coalesce(cfg2.lastViewedAtMs, ?) > (timestamp() - ?) AND (timestamp() - coalesce(cfg2.lastProgressComputedAtMs, ?)) > coalesce(cfg2.progressComputeIntervalMs, ?…
RETURN EXISTS { MATCH (cfg2:WorkplanCfg) WHERE cfg2.progressPending = true AND coalesce(cfg2.lastViewedAtMs, ?) > (timestamp() - ?) AND (timestamp() - coalesce(cfg2.lastProgressComputedAtMs, ?)) > coalesce(cfg2.progressComputeIntervalMs, ?) } AS fleetProgressPending, EXISTS { MATCH (item:WorkplanInstanceMilestoneItem) WHERE item.itemType = ? AND coalesce(item.workOrderId, ?) <> ? AND coalesce(item.activationPending, false) = true AND coalesce(item.activationEligible, false) = true AND coalesce(item.activateRequestedAt, ?) = ? } AS activationPending, EXISTS { MATCH (cfg:WorkplanCfg) WHERE coalesce(cfg.workOrderEmailAutoSendTransitionPending, false) = true } AS autosendTransition, EXISTS { MATCH (wp2:WorkPlanInstance) WHERE wp2.instanceReadyDeterminationState = ? } AS readyDetermination, EXISTS { MATCH (cfg3:WorkplanCfg) WHERE coalesce(cfg3.instanceMilestoneItemCreationPending, false) = true AND (coalesce(cfg3.instanceItemCreationClaimedAtMs, ?) = ? OR (timestamp() - cfg3.instanceItemCreationClaimedAtMs) >= ?) } AS instanceItemCreation, EXISTS { MATCH (item2:WorkplanInstanceMilestoneItem) WHERE item2.itemType = ? AND (coalesce(item2.readyAt, ?) > ? OR coalesce(item2.vaWoInstanceFetchRequestSentAt, ?) > ?) AND coalesce(item2.workOrderId, ?) = ? AND coalesce(item2.skippedAt, ?) = ? AND coalesce(item2.notApplicableAt, ?) = ? AND (coalesce(item2.vaWoInstanceFetchRequestSentAt, ?) = ? OR (timestamp() - item2.vaWoInstanceFetchRequestSentAt) >= ?) AND (coalesce(item2.workOrderCreateUnresolvableAt, ?) = ? OR (timestamp() - item2.workOrderCreateUnresolvableAt) >= ?) } AS workOrderCreate
workplansvc
10 2 ms 5 ms 3 ms flat
UNWIND $site_ids AS sid OPTIONAL MATCH (s:Site {tildaid: sid, delpending: false}) OPTIONAL MATCH (s)<-[:PLAN_DEFINITION_TO_SITE]-(pd:DslPlanDefinition {delpending: false})-[:PLAN_DEFINITION_TO_STUDY]->(st:Study {tildaid: $study_id, delpend…
UNWIND $site_ids AS sid OPTIONAL MATCH (s:Site {tildaid: sid, delpending: false}) OPTIONAL MATCH (s)<-[:PLAN_DEFINITION_TO_SITE]-(pd:DslPlanDefinition {delpending: false})-[:PLAN_DEFINITION_TO_STUDY]->(st:Study {tildaid: $study_id, delpending: false}) OPTIONAL MATCH (pd)-[pdc:PLAN_DEFINITION_TO_CONTACT]->(actor:Actor {delpending: false})-[:FOR_USER]->(u:User) OPTIONAL MATCH (pdca:ContactArea {tildaid: pdc.contactAreaId}) OPTIONAL MATCH (pd)-[copdc:PLAN_DEFINITION_TO_CLINOP_CONTACT]->(co:ClinOp {deltimestamp: ?})-[:FOR_USER]->(cou:User) OPTIONAL MATCH (copdca:ContactArea {tildaid: copdc.contactAreaId}) WITH sid, s, collect(DISTINCT CASE WHEN pdc IS NOT NULL AND actor IS NOT NULL AND (u IS NULL OR u.status <> $deleted_status) THEN { t: coalesce(pdca.seedKey, ?), p: coalesce(pdc.isPrimary, false), e: coalesce(u.email, ?) } END) AS actorContactRows, collect(DISTINCT CASE WHEN copdc IS NOT NULL AND co IS NOT NULL AND (cou IS NULL OR cou.status <> $deleted_status) THEN { t: coalesce(copdca.seedKey, ?), p: coalesce(copdc.isPrimary, false), e: coalesce(cou.email, ?) } END) AS clinopContactRows WITH sid, s, actorContactRows + clinopContactRows AS pdContactRowsRaw WITH sid, s, [row IN pdContactRowsRaw WHERE row IS NOT NULL AND row.t IS NOT NULL AND row.e IS NOT NULL AND row.e <> ?] AS pd_rows RETURN sid AS site_id, coalesce(s.name, ?) AS site_name, pd_rows
workplansvc
2 2 ms 5 ms 3 ms flat
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDe…
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDefinition{type:?}) match (sitePd)-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]->(w:WorkflowV2)<-[:TRIGGER_TO_WORKFLOW]-(t:Trigger{scope:?}) match (sitePd)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (sitePd)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) match (scopeUser)-[:STUDYSITEACTOR_TO_ACTOR]->(actor:Actor{delpending:false})<-[:STUDY_TO_ACTOR]-(st) where not exists((scopeUser)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) return distinct scopeUser.tildaid as scopeTildaid, t.scope as workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, scopeUser.roles as roles UNION // Second part for StudySite scope match (t:Trigger{scope:?})-[:TRIGGER_TO_WORKFLOW]->(w:WorkflowV2) match (w)<-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]-(scopeSite:DslPlanDefinition{type:?}) where not exists((scopeSite)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) with distinct t.scope as workflowScope, scopeSite match (scopeSite)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (scopeSite)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) return distinct scopeSite.tildaid as scopeTildaid, workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, null as roles
regsvc
2 6 ms 10 ms 6 ms flat
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDe…
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDefinition{type:?}) match (sitePd)-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]->(w:WorkflowV2)<-[:TRIGGER_TO_WORKFLOW]-(t:Trigger{scope:?}) match (sitePd)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (sitePd)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) match (scopeUser)-[:STUDYSITEACTOR_TO_ACTOR]->(actor:Actor{delpending:false})<-[:STUDY_TO_ACTOR]-(st) where not exists((scopeUser)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) return distinct scopeUser.tildaid as scopeTildaid, t.scope as workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, scopeUser.roles as roles UNION // Second part for StudySite scope match (t:Trigger{scope:?})-[:TRIGGER_TO_WORKFLOW]->(w:WorkflowV2) match (w)<-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]-(scopeSite:DslPlanDefinition{type:?}) where not exists((scopeSite)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) with distinct t.scope as workflowScope, scopeSite match (scopeSite)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (scopeSite)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) return distinct scopeSite.tildaid as scopeTildaid, workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, null as roles
regsvc
1 7 ms 10 ms 7 ms flat
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDe…
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDefinition{type:?}) match (sitePd)-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]->(w:WorkflowV2)<-[:TRIGGER_TO_WORKFLOW]-(t:Trigger{scope:?}) match (sitePd)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (sitePd)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) match (scopeUser)-[:STUDYSITEACTOR_TO_ACTOR]->(actor:Actor{delpending:false})<-[:STUDY_TO_ACTOR]-(st) where not exists((scopeUser)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) return distinct scopeUser.tildaid as scopeTildaid, t.scope as workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, scopeUser.roles as roles UNION // Second part for StudySite scope match (t:Trigger{scope:?})-[:TRIGGER_TO_WORKFLOW]->(w:WorkflowV2) match (w)<-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]-(scopeSite:DslPlanDefinition{type:?}) where not exists((scopeSite)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) with distinct t.scope as workflowScope, scopeSite match (scopeSite)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (scopeSite)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) return distinct scopeSite.tildaid as scopeTildaid, workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, null as roles
write feedsvc
387 6 ms 18 ms 68 ms flat
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDe…
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDefinition{type:?}) match (sitePd)-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]->(w:WorkflowV2)<-[:TRIGGER_TO_WORKFLOW]-(t:Trigger{scope:?}) match (sitePd)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (sitePd)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) match (scopeUser)-[:STUDYSITEACTOR_TO_ACTOR]->(actor:Actor{delpending:false})<-[:STUDY_TO_ACTOR]-(st) where not exists((scopeUser)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) return distinct scopeUser.tildaid as scopeTildaid, t.scope as workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, scopeUser.roles as roles UNION // Second part for StudySite scope match (t:Trigger{scope:?})-[:TRIGGER_TO_WORKFLOW]->(w:WorkflowV2) match (w)<-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]-(scopeSite:DslPlanDefinition{type:?}) where not exists((scopeSite)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) with distinct t.scope as workflowScope, scopeSite match (scopeSite)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (scopeSite)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) return distinct scopeSite.tildaid as scopeTildaid, workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, null as roles
write virtual-assistant
5 17 ms 46 ms 34 ms flat
match (pv:ParticipantVisit)-[:BELONGS_TO_PARTICIPANT_VISIT]-(v:VisitAppointment)-[:VISIT_APPOINTMENT_TO_CARE_PLAN]-(c:CarePlan)-[:RESEARCH_SUBJECT] -(p:Patient)-[:HAS_PROTECTED_DATA_IN]-(phi:Phi) where c.status IN [?,?] and v.startTime >= …
match (pv:ParticipantVisit)-[:BELONGS_TO_PARTICIPANT_VISIT]-(v:VisitAppointment)-[:VISIT_APPOINTMENT_TO_CARE_PLAN]-(c:CarePlan)-[:RESEARCH_SUBJECT] -(p:Patient)-[:HAS_PROTECTED_DATA_IN]-(phi:Phi) where c.status IN [?,?] and v.startTime >= datetime({epochMillis:$day1Start}) and v.startTime <= datetime({epochMillis:$day1End}) and coalesce(v.reminderStatus, ?) = ? match (c)-[:EXECUTE_SOA]-(s:ScheduleOfActivities)-[:SOA_TO_PLAN_DEFINITION] -(pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(si:Site)-[:SITE_TO_SMO]->(smo:Smo)-[:IS_AN_ORG]->(o:Organization) return v,phi,si,p,o
schedsvc
1 23 ms 48 ms 23 ms flat
call { match (task:Task{assignment:?}) where (task.state = ? or task.state = ?) and not exists ((task)-[:BELONGS_TO]-(:Inbox{type:?})) and coalesce(task.dist_next_retry_at <= datetime(), coalesce(task.dist_deferred, false) = false) return …
call { match (task:Task{assignment:?}) where (task.state = ? or task.state = ?) and not exists ((task)-[:BELONGS_TO]-(:Inbox{type:?})) and coalesce(task.dist_next_retry_at <= datetime(), coalesce(task.dist_deferred, false) = false) return task } with task where not exists ( (task)-[:CREATED_FROM_SPEC]-(:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(:ParticipantControl) ) and not exists ( (task)<-[:CREATED_FROM_SPEC]-(:ParticipantDslSpecNode)<-[:PARTICIPANT_DSLTASK_TO_ALL_PARTICIPANT_DSLSPECNODE]-(:ParticipantDslTask)<-[:PARTICIPANT_DSLTASK]-(:ParticipantControl) ) match (task)-[:WITH_CONTEXT]->() optional match (task)-[:BELONGS_TO]->(userinbox:Inbox{type:?})-[:OWNED_BY]->(user:User) optional match (user)-[:USER_TO_PATIENT]-(patient:Patient) optional match (task)-[:BELONGS_TO]->(:Inbox{type:?})-[:MANAGED_BY]->(org:Organization) optional match (task)-[:BELONGS_TO]->(:Inbox{type:?})-[:MANAGED_BY]->(study:Study) optional match (task)-[:BELONGS_TO]->(:Inbox{type:?})-[:MANAGED_BY]->(site:Site) return distinct task, userinbox, org, study.name, site.name, patient.tildaid skip $skip limit $limit
tusker
5 26 ms 48 ms 29 ms flat
MATCH (c:WorkOrderConfig) WHERE c.child_creation_pending = true AND c.delpending = false AND c.updatedat < $updated_before WITH c ORDER BY c.tildaid SET c.recovery_claim_token = CASE WHEN c.updatedat < $updated_before THEN $token ELSE c.re…
MATCH (c:WorkOrderConfig) WHERE c.child_creation_pending = true AND c.delpending = false AND c.updatedat < $updated_before WITH c ORDER BY c.tildaid SET c.recovery_claim_token = CASE WHEN c.updatedat < $updated_before THEN $token ELSE c.recovery_claim_token END WITH c WHERE c.recovery_claim_token = $token SET c.updatedat = $now RETURN c
write virtual-assistant
1 23 ms 48 ms 23 ms flat
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDe…
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDefinition{type:?}) match (sitePd)-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]->(w:WorkflowV2)<-[:TRIGGER_TO_WORKFLOW]-(t:Trigger{scope:?}) match (sitePd)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (sitePd)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) match (scopeUser)-[:STUDYSITEACTOR_TO_ACTOR]->(actor:Actor{delpending:false})<-[:STUDY_TO_ACTOR]-(st) where not exists((scopeUser)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) return distinct scopeUser.tildaid as scopeTildaid, t.scope as workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, scopeUser.roles as roles UNION // Second part for StudySite scope match (t:Trigger{scope:?})-[:TRIGGER_TO_WORKFLOW]->(w:WorkflowV2) match (w)<-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]-(scopeSite:DslPlanDefinition{type:?}) where not exists((scopeSite)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) with distinct t.scope as workflowScope, scopeSite match (scopeSite)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (scopeSite)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) return distinct scopeSite.tildaid as scopeTildaid, workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, null as roles
write docproc
14 18 ms 88 ms 74 ms flat
CALL { MATCH (d:Document) WHERE d.delpending = false AND d.aiEnabled = true AND d.studyId <> ? AND d.primaryVersionId IS NOT NULL AND d.primaryVersionId <> ? // Certification is what triggers processing, so anything not yet certified // ha…
CALL { MATCH (d:Document) WHERE d.delpending = false AND d.aiEnabled = true AND d.studyId <> ? AND d.primaryVersionId IS NOT NULL AND d.primaryVersionId <> ? // Certification is what triggers processing, so anything not yet certified // has not reached its trigger: a ZIP member still being extracted, or an // upload whose file has not landed. Starting one here races the writer // that will certify it. AND d.status = $certified_status AND NOT EXISTS { (d)<-[:AI_RUN_TO_DOCUMENT_LATEST]-(:AIRun) } RETURN d, null AS latest_ai UNION MATCH (ai:AIRun)-[:AI_RUN_TO_DOCUMENT_LATEST]->(d:Document) WHERE ai.status IN [?, ?] AND d.delpending = false AND d.aiEnabled = true AND d.studyId <> ? AND d.primaryVersionId IS NOT NULL AND d.primaryVersionId <> ? AND d.status IN $retry_statuses WITH DISTINCT d MATCH (d)<-[:AI_RUN_TO_DOCUMENT_LATEST]-(run:AIRun) WITH d, run ORDER BY COALESCE(run.updatedat, run.createdat) DESC WITH d, collect(run)[?] AS latest_ai // The cap applies to both statuses: each backlog retry bumps auto_retry_count on // the run (and refreshes updatedat, which keeps an aborted run inside the adopt // path?Staging?Pre-Staging'] } MATCH (d)-[:DOC_TO_ORG]-(o:Organization{orgType:?}) WITH DISTINCT d, o, latest_ai WITH d RETURN count(d) AS total
docproc
19 49 ms 90 ms 60 ms flat
CALL { MATCH (d:Document) WHERE d.delpending = false AND d.aiEnabled = true AND d.studyId <> ? AND d.primaryVersionId IS NOT NULL AND d.primaryVersionId <> ? // Certification is what triggers processing, so anything not yet certified // ha…
CALL { MATCH (d:Document) WHERE d.delpending = false AND d.aiEnabled = true AND d.studyId <> ? AND d.primaryVersionId IS NOT NULL AND d.primaryVersionId <> ? // Certification is what triggers processing, so anything not yet certified // has not reached its trigger: a ZIP member still being extracted, or an // upload whose file has not landed. Starting one here races the writer // that will certify it. AND d.status = $certified_status AND NOT EXISTS { (d)<-[:AI_RUN_TO_DOCUMENT_LATEST]-(:AIRun) } RETURN d, null AS latest_ai UNION MATCH (ai:AIRun)-[:AI_RUN_TO_DOCUMENT_LATEST]->(d:Document) WHERE ai.status IN [?, ?] AND d.delpending = false AND d.aiEnabled = true AND d.studyId <> ? AND d.primaryVersionId IS NOT NULL AND d.primaryVersionId <> ? AND d.status IN $retry_statuses WITH DISTINCT d MATCH (d)<-[:AI_RUN_TO_DOCUMENT_LATEST]-(run:AIRun) WITH d, run ORDER BY COALESCE(run.updatedat, run.createdat) DESC WITH d, collect(run)[?] AS latest_ai // The cap applies to both statuses: each backlog retry bumps auto_retry_count on // the run (and refreshes updatedat, which keeps an aborted run inside the adopt // path?Staging?Pre-Staging'] } MATCH (d)-[:DOC_TO_ORG]-(o:Organization{orgType:?}) WITH DISTINCT d, o, latest_ai WITH d.tildaid AS doc_id, o.tildaid AS org_id, o.alias AS org_alias, d.primaryVersionId AS version_id, d.studyId AS study_id, COALESCE(latest_ai.auto_retry_count, ?) AS current_retry_count, // null when latest_ai IS NULL — a document enabled but never run has no // originating request to recover, and a sentinel user is the honest answer there. latest_ai.request_info AS request_info, latest_ai.tildaid AS ai_run_id, d OPTIONAL MATCH (d)-[:UPLOADED_BY]->(uploader:User) WITH doc_id, org_id, org_alias, version_id, study_id, current_retry_count, request_info, ai_run_id, head(collect(uploader.email)) AS uploaded_by RETURN doc_id, org_id, org_alias, version_id, study_id, current_retry_count, request_info, ai_run_id, uploaded_by ORDER BY doc_id LIMIT $limit
docproc
3 51 ms 92 ms 62 ms flat

p95 drift compares the query's p95 in the recent half of the window to the earlier half — ≥1.2× means it's slowing down. Click a row for its p50/p95 latency trend over time. Latency percentiles come from per-bucket histograms (no individual queries stored).