Xray
hourly rollups 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-19 23:30:26.
› →|
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 80

stored 36h ago top 80 of 599

Neo4j query shapes on delta 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 (qn {tildaid:?}) OPTIONAL MATCH (qn)<-[:GRAPH_NODE_REF_TO_QUESTION]-(ref:GraphNodeRef)<-[g:GRAPH_NEXT]-(parent) RETURN labels(qn) AS labels, qn.title AS title, qn.variablename AS var, qn.deltimestamp AS del, collect(DISTINCT [labels(…
MATCH (qn {tildaid:?}) OPTIONAL MATCH (qn)<-[:GRAPH_NODE_REF_TO_QUESTION]-(ref:GraphNodeRef)<-[g:GRAPH_NEXT]-(parent) RETURN labels(qn) AS labels, qn.title AS title, qn.variablename AS var, qn.deltimestamp AS del, collect(DISTINCT [labels(parent), parent.title, g.protocolid])[?..?] AS placements
(internal)
1 2.3 min ≥ 2.0 min 2.3 min flat
with $protocolId as protocolId, $careplanId as careplanId, $visitRefId as visitRefId, $activityRefId as activityRefId, $pvId as pvId, null as pwId, $paId as paId, $pqnrId as pqnrId, null as ptId, $hdmClassId as hdmClassId call(careplanId, …
with $protocolId as protocolId, $careplanId as careplanId, $visitRefId as visitRefId, $activityRefId as activityRefId, $pvId as pvId, null as pwId, $paId as paId, $pqnrId as pqnrId, null as ptId, $hdmClassId as hdmClassId call(careplanId, protocolId, pwId, pvId, paId, pqnrId, ptId, hdmClassId) { match (vref:GraphNodeRef{tildaid:?})-[rv:GRAPH_NODE_REF_TO_GRAPH_NODE]->(v:VisitV2)-[:BELONGS_TO_VISIT]-(pv:ParticipantVisit{carePlanId:careplanId}) match (aref:GraphNodeRef{tildaid:?})-[ra:GRAPH_NODE_REF_TO_GRAPH_NODE]->(a:ActivityV2)-[:BELONGS_TO_ACTIVITY]-(pa:ParticipantActivity{carePlanId:careplanId}) match (qref:GraphNodeRef{tildaid:?})-[rq:GRAPH_NODE_REF_TO_GRAPH_NODE]->(q:QuestionnaireV2)-[:BELONGS_TO_QUESTIONNAIRE]-(pqnr:ParticipantQuestionnaire{carePlanId:careplanId}) match(ref:GraphNodeRef{tildaid:?})-[rpq:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION] ->(qn:QuestionV2)-[:BELONGS_TO_QUESTION]-(pqn:ParticipantQuestion{carePlanId:careplanId, hdmClassId:hdmClassId})-[:PARTICIPANT_QUESTION]-(pqnr)-[:PARTICIPANT_QUESTIONNAIRE]-(pa)-[:PARTICIPANT_ACTIVITY]-(pv)-[:CAREPLAN_TO_ALL_PARTICIPANTVISITS]-(cp:CarePlan{tildaid:careplanId}) with case when pqn.editStatus = ? then {v: pqn.editValue, l: pqn.editValues} else {v: pqn.value, l: pqn.values} end as pqnAns with case when size(coalesce(pqnAns.l, [])) > ? and apoc.text.join(pqnAns.l, ?) = coalesce(pqnAns.v, ?) then pqnAns.l when coalesce(pqnAns.v, ?) = ? then [] else apoc.coll.toSet(split(pqnAns.v, ?) + [pqnAns.v]) end as pqnValues return distinct pqnValues as ans1 } call(careplanId, protocolId, pwId, pvId, paId, pqnrId, ptId, hdmClassId) { match(ref:GraphNodeRef{tildaid:?})-[rpq:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION] ->(qn:QuestionV2)-[:BELONGS_TO_QUESTION]-(pqn:ParticipantQuestion{carePlanId:careplanId, hdmClassId:hdmClassId})-[:PARTICIPANT_QUESTION]-(pqnr:ParticipantQuestionnaire{tildaid:pqnrId}) with case when pqn.editStatus = ? then {v: pqn.editValue, l: pqn.editValues} else {v: pqn.value, l: pqn.values} end as pqnAns with case when size(coalesce(pqnAns.l, [])) > ? and apoc.text.join(pqnAns.l, ?) = coalesce(pqnAns.v, ?) then pqnAns.l when coalesce(pqnAns.v, ?) = ? then [] else apoc.coll.toSet(split(pqnAns.v, ?) + [pqnAns.v]) end as pqnValues return distinct pqnValues as ans2 } return ((( size(apoc.coll.intersection(apoc.coll.sort(ans1), apoc.coll.sort(ans2))) > ?)))
execsvc
3,995 12.82 s 1.0 min 1.4 min 0.8× ↓
MATCH (d:DocumentVersion) SET d.url = replace(d.url, ?, ?)
MATCH (d:DocumentVersion) SET d.url = replace(d.url, ?, ?)
write (internal)
1 57.39 s 58.50 s 57.39 s flat
MATCH (u:User) WHERE u.email = ? AND u.deltimestamp = ? WITH collect(u) AS us, collect(u.tildaid) AS ids CALL (us) { UNWIND us AS u MATCH (t:Task)-[:CREATED_BY]->(u) RETURN count(t) AS tasks } CALL (ids) { MATCH (cl:ChangeLog) WHERE cl.cha…
MATCH (u:User) WHERE u.email = ? AND u.deltimestamp = ? WITH collect(u) AS us, collect(u.tildaid) AS ids CALL (us) { UNWIND us AS u MATCH (t:Task)-[:CREATED_BY]->(u) RETURN count(t) AS tasks } CALL (ids) { MATCH (cl:ChangeLog) WHERE cl.changedBy IN ids RETURN count(cl) AS changeLogs, count(DISTINCT cl.changedBy) AS distinctUsers } RETURN size(ids) AS emptyEmailUsers, tasks, changeLogs, distinctUsers
(internal)
1 31.52 s 58.50 s 31.52 s 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
2 27.86 s 57.00 s 54.82 s 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
3 18.88 s 55.50 s 54.81 s flat
with $protocolId as protocolId, $careplanId as careplanId, $visitRefId as visitRefId, $activityRefId as activityRefId, $pvId as pvId, null as pwId, $paId as paId, $pqnrId as pqnrId, null as ptId, $hdmClassId as hdmClassId call(careplanId, …
with $protocolId as protocolId, $careplanId as careplanId, $visitRefId as visitRefId, $activityRefId as activityRefId, $pvId as pvId, null as pwId, $paId as paId, $pqnrId as pqnrId, null as ptId, $hdmClassId as hdmClassId call(careplanId, protocolId, pwId, pvId, paId, pqnrId, ptId, hdmClassId) { match (vref:GraphNodeRef{tildaid:?})-[rv:GRAPH_NODE_REF_TO_GRAPH_NODE]->(v:VisitV2)-[:BELONGS_TO_VISIT]-(pv:ParticipantVisit{carePlanId:careplanId}) match (aref:GraphNodeRef{tildaid:?})-[ra:GRAPH_NODE_REF_TO_GRAPH_NODE]->(a:ActivityV2)-[:BELONGS_TO_ACTIVITY]-(pa:ParticipantActivity{carePlanId:careplanId}) match (qref:GraphNodeRef{tildaid:?})-[rq:GRAPH_NODE_REF_TO_GRAPH_NODE]->(q:QuestionnaireV2)-[:BELONGS_TO_QUESTIONNAIRE]-(pqnr:ParticipantQuestionnaire{carePlanId:careplanId}) match(ref:GraphNodeRef{tildaid:?})-[rpq:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION] ->(qn:QuestionV2)-[:BELONGS_TO_QUESTION]-(pqn:ParticipantQuestion{carePlanId:careplanId, hdmClassId:hdmClassId})-[:PARTICIPANT_QUESTION]-(pqnr)-[:PARTICIPANT_QUESTIONNAIRE]-(pa)-[:PARTICIPANT_ACTIVITY]-(pv)-[:CAREPLAN_TO_ALL_PARTICIPANTVISITS]-(cp:CarePlan{tildaid:careplanId}) with case when pqn.editStatus = ? then {v: pqn.editValue, l: pqn.editValues} else {v: pqn.value, l: pqn.values} end as pqnAns with case when size(coalesce(pqnAns.l, [])) > ? and apoc.text.join(pqnAns.l, ?) = coalesce(pqnAns.v, ?) then pqnAns.l when coalesce(pqnAns.v, ?) = ? then [] else apoc.coll.toSet(split(pqnAns.v, ?) + [pqnAns.v]) end as pqnValues return distinct pqnValues as ans1 } call(careplanId, protocolId, pwId, pvId, paId, pqnrId, ptId, hdmClassId) { match(ref:GraphNodeRef{tildaid:?})-[rpq:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION] ->(qn:QuestionV2)-[:BELONGS_TO_QUESTION]-(pqn:ParticipantQuestion{carePlanId:careplanId, hdmClassId:hdmClassId})-[:PARTICIPANT_QUESTION]-(pqnr:ParticipantQuestionnaire{tildaid:pqnrId}) with case when pqn.editStatus = ? then {v: pqn.editValue, l: pqn.editValues} else {v: pqn.value, l: pqn.values} end as pqnAns with case when size(coalesce(pqnAns.l, [])) > ? and apoc.text.join(pqnAns.l, ?) = coalesce(pqnAns.v, ?) then pqnAns.l when coalesce(pqnAns.v, ?) = ? then [] else apoc.coll.toSet(split(pqnAns.v, ?) + [pqnAns.v]) end as pqnValues return distinct pqnValues as ans2 } return ((( size(apoc.coll.intersection(apoc.coll.sort(ans1), apoc.coll.sort(ans2))) > ?)))
execsvc
40 16.04 s 55.00 s 48.89 s 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
4 8.59 s 54.00 s 34.19 s flat
with $protocolId as protocolId, $careplanId as careplanId, $visitRefId as visitRefId, $activityRefId as activityRefId, $pvId as pvId, null as pwId, $paId as paId, $pqnrId as pqnrId, null as ptId, $hdmClassId as hdmClassId call(careplanId, …
with $protocolId as protocolId, $careplanId as careplanId, $visitRefId as visitRefId, $activityRefId as activityRefId, $pvId as pvId, null as pwId, $paId as paId, $pqnrId as pqnrId, null as ptId, $hdmClassId as hdmClassId call(careplanId, protocolId, pwId, pvId, paId, pqnrId, ptId, hdmClassId) { match (vref:GraphNodeRef{tildaid:?})-[rv:GRAPH_NODE_REF_TO_GRAPH_NODE]->(v:VisitV2)-[:BELONGS_TO_VISIT]-(pv:ParticipantVisit{carePlanId:careplanId}) match (aref:GraphNodeRef{tildaid:?})-[ra:GRAPH_NODE_REF_TO_GRAPH_NODE]->(a:ActivityV2)-[:BELONGS_TO_ACTIVITY]-(pa:ParticipantActivity{carePlanId:careplanId}) match (qref:GraphNodeRef{tildaid:?})-[rq:GRAPH_NODE_REF_TO_GRAPH_NODE]->(q:QuestionnaireV2)-[:BELONGS_TO_QUESTIONNAIRE]-(pqnr:ParticipantQuestionnaire{carePlanId:careplanId}) match(ref:GraphNodeRef{tildaid:?})-[rpq:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION] ->(qn:QuestionV2)-[:BELONGS_TO_QUESTION]-(pqn:ParticipantQuestion{carePlanId:careplanId, hdmClassId:hdmClassId})-[:PARTICIPANT_QUESTION]-(pqnr)-[:PARTICIPANT_QUESTIONNAIRE]-(pa)-[:PARTICIPANT_ACTIVITY]-(pv)-[:CAREPLAN_TO_ALL_PARTICIPANTVISITS]-(cp:CarePlan{tildaid:careplanId}) with case when pqn.editStatus = ? then {v: pqn.editValue, l: pqn.editValues} else {v: pqn.value, l: pqn.values} end as pqnAns with case when size(coalesce(pqnAns.l, [])) > ? and apoc.text.join(pqnAns.l, ?) = coalesce(pqnAns.v, ?) then pqnAns.l when coalesce(pqnAns.v, ?) = ? then [] else apoc.coll.toSet(split(pqnAns.v, ?) + [pqnAns.v]) end as pqnValues return distinct pqnValues as ans1 } call(careplanId, protocolId, pwId, pvId, paId, pqnrId, ptId, hdmClassId) { match(ref:GraphNodeRef{tildaid:?})-[rpq:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION] ->(qn:QuestionV2)-[:BELONGS_TO_QUESTION]-(pqn:ParticipantQuestion{carePlanId:careplanId, hdmClassId:hdmClassId})-[:PARTICIPANT_QUESTION]-(pqnr:ParticipantQuestionnaire{tildaid:pqnrId}) with case when pqn.editStatus = ? then {v: pqn.editValue, l: pqn.editValues} else {v: pqn.value, l: pqn.values} end as pqnAns with case when size(coalesce(pqnAns.l, [])) > ? and apoc.text.join(pqnAns.l, ?) = coalesce(pqnAns.v, ?) then pqnAns.l when coalesce(pqnAns.v, ?) = ? then [] else apoc.coll.toSet(split(pqnAns.v, ?) + [pqnAns.v]) end as pqnValues return distinct pqnValues as ans2 } return ((( size(apoc.coll.intersection(apoc.coll.sort(ans1), apoc.coll.sort(ans2))) > ?)))
execsvc
8 7.15 s 48.00 s 33.70 s 10.2× ↑
MATCH (pt:ParticipantTable)-[:PARTICIPANT_QUESTION]->(pq:ParticipantQuestion) WHERE pq.hdmClassId IN [?,?] MATCH (qn:QuestionV2 {tildaid: pq.questionId}) RETURN pq.hdmClassId AS row, qn.title AS question, pq.value AS value, pq.status AS st…
MATCH (pt:ParticipantTable)-[:PARTICIPANT_QUESTION]->(pq:ParticipantQuestion) WHERE pq.hdmClassId IN [?,?] MATCH (qn:QuestionV2 {tildaid: pq.questionId}) RETURN pq.hdmClassId AS row, qn.title AS question, pq.value AS value, pq.status AS status, EXISTS { (qn)<-[:GRAPH_NODE_REF_TO_QUESTION]-(:GraphNodeRef) } AS inAnyForm, datetime({epochMillis: qn.updatedat}) AS qnUpdated ORDER BY row, question
(internal)
1 22.00 s 29.50 s 22.00 s 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 18.57 s 19.50 s 18.57 s flat
MATCH (o:Organization {tildaid: $org_id})-[:STUDY_TO_ORG]-(study:Study {tildaid: $study_id}) -[:PLAN_DEFINITION_TO_STUDY]-(pd:DslPlanDefinition) -[:SOA_TO_PLAN_DEFINITION]-(:ScheduleOfActivities) -[:EXECUTE_SOA]-(cp:CarePlan {tildaid: $car…
MATCH (o:Organization {tildaid: $org_id})-[:STUDY_TO_ORG]-(study:Study {tildaid: $study_id}) -[:PLAN_DEFINITION_TO_STUDY]-(pd:DslPlanDefinition) -[:SOA_TO_PLAN_DEFINITION]-(:ScheduleOfActivities) -[:EXECUTE_SOA]-(cp:CarePlan {tildaid: $careplan_id}) WHERE coalesce(pd.deltimestamp, ?) = ? AND coalesce(cp.isDeleted, false) = false WITH DISTINCT cp, pd, study CALL (cp) { MATCH (cp)-[:CAREPLAN_TO_ALL_PARTICIPANTVISITS]-(:ParticipantVisit) -[:PARTICIPANT_ACTIVITY]-(pa:ParticipantActivity) RETURN pa UNION MATCH (cp)-[:PARTICIPANT_ACTIVITY]-(pa:ParticipantActivity) RETURN pa } WITH cp, pa WHERE pa.carePlanId = cp.tildaid AND ($activity_ids IS NULL OR pa.tildaid IN $activity_ids) MATCH (pa)-[:PARTICIPANT_QUESTIONNAIRE]-(pqnr:ParticipantQuestionnaire) CALL (pqnr) { MATCH (pqnr)-[:PARTICIPANT_QUESTION]-(pqn:ParticipantQuestion) RETURN pqn, pqnr.questionnaireId AS graph_id, NULL AS pt_id UNION MATCH (pqnr)-[:PARTICIPANT_TABLE]-(pt:ParticipantTable) -[:PARTICIPANT_QUESTION]-(pqn:ParticipantQuestion) RETURN pqn, pt.tableId AS graph_id, pt.tildaid AS pt_id } WITH cp, pa, pqnr.tildaid AS pqnr_id, pt_id, pqn, graph_id WHERE pqn.carePlanId = pa.carePlanId MATCH (pqn)-[:BELONGS_TO_QUESTION]-(qn:QuestionV2) OPTIONAL MATCH (qn)-[:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION {protocolid: pa.protocolId}]-(gnode:GraphNode) <-[gnrel:GRAPH_NEXT {graphid: graph_id}]-() WITH pa, pqnr_id, pt_id, pqn, qn, reduce(f = ?, x IN collect(coalesce(gnrel.flags, ?)) | apoc.bitwise.op(f, ?, x)) AS qn_flags OPTIONAL MATCH (pqn)-[:ALL_CHANGELOG]-(sdvcl:ChangeLog {type: ?, newValue: ?}) WITH pa, pqnr_id, pt_id, pqn, qn, qn_flags, max(sdvcl.createdat) AS sdv_verified_at OPTIONAL MATCH (pqn)-[:ALL_CHANGELOG]-(datacl:ChangeLog {type: ?}) WITH pa, pqnr_id, pt_id, pqn, qn, qn_flags, sdv_verified_at, max(datacl.createdat) AS last_data_change RETURN DISTINCT pqn.tildaid AS pq_id, pa.tildaid AS pa_id, pqnr_id, pt_id, qn.tildaid AS question_id, coalesce(qn.title, ?) AS title, qn.variablename AS variable, coalesce(pqn.value, ?) AS value, coalesce(pqn.status, ?) AS status, coalesce(pqn.sdvVerified, false) AS sdv_verified, sdv_verified_at, last_data_change, coalesce(pqn.changeLogCount, ?) AS change_count, pqn.hdmClassId AS hdm_class_id, pqn.hdmObjId AS hdm_obj_id, apoc.bitwise.op(qn_flags, ?, ?) <> ? AS critical ORDER BY pa_id, pq_id
data_monitor
6 10.13 s 19.25 s 11.38 s 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 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, // 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
2 8.61 s 19.00 s 17.21 s flat
MATCH (act:FormV2) WHERE act.type = ? AND (act.scopeid = ? OR act.scopeid IS NULL) AND (act.supportsglobalactivitybottomup IS NULL OR act.supportsglobalactivitybottomup = false) RETURN act.tildaid ORDER BY act.tildaid LIMIT ?
MATCH (act:FormV2) WHERE act.type = ? AND (act.scopeid = ? OR act.scopeid IS NULL) AND (act.supportsglobalactivitybottomup IS NULL OR act.supportsglobalactivitybottomup = false) RETURN act.tildaid ORDER BY act.tildaid LIMIT ?
studiosvc
2 13.40 s 19.00 s 17.76 s 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
3 6.22 s 18.50 s 18.64 s flat
MATCH (wp:WorkPlanInstance) WHERE wp.instanceReadyDeterminationState IN [?, ?] AND wp.state <> ? OPTIONAL MATCH (wp)<-[:WORKPLAN_JOB_TO_OBJ]-(job:WorkplanJob) WITH wp, count(job) AS jobN WHERE jobN = ? RETURN wp.tildaid AS id LIMIT $limit
MATCH (wp:WorkPlanInstance) WHERE wp.instanceReadyDeterminationState IN [?, ?] AND wp.state <> ? OPTIONAL MATCH (wp)<-[:WORKPLAN_JOB_TO_OBJ]-(job:WorkplanJob) WITH wp, count(job) AS jobN WHERE jobN = ? RETURN wp.tildaid AS id LIMIT $limit
workplansvc
1 7.71 s 9.75 s 7.71 s flat
MATCH (o:Organization {tildaid: $org_id})-[:STUDY_TO_ORG]-(study:Study {tildaid: $study_id}) -[:PLAN_DEFINITION_TO_STUDY]-(pd:DslPlanDefinition) -[:SOA_TO_PLAN_DEFINITION]-(:ScheduleOfActivities) -[:EXECUTE_SOA]-(cp:CarePlan {tildaid: $car…
MATCH (o:Organization {tildaid: $org_id})-[:STUDY_TO_ORG]-(study:Study {tildaid: $study_id}) -[:PLAN_DEFINITION_TO_STUDY]-(pd:DslPlanDefinition) -[:SOA_TO_PLAN_DEFINITION]-(:ScheduleOfActivities) -[:EXECUTE_SOA]-(cp:CarePlan {tildaid: $careplan_id}) WHERE coalesce(pd.deltimestamp, ?) = ? AND coalesce(cp.isDeleted, false) = false WITH DISTINCT cp, pd, study MATCH (cp)-[:CAREPLAN_TO_ALL_PARTICIPANTVISITS]-(:ParticipantVisit) -[:PARTICIPANT_ACTIVITY]-(pa:ParticipantActivity) WHERE pa.carePlanId = cp.tildaid MATCH (pa)-[:PARTICIPANT_QUESTIONNAIRE]-(pqnr:ParticipantQuestionnaire) CALL (pqnr) { MATCH (pqnr)-[:PARTICIPANT_QUESTION]-(pqn:ParticipantQuestion) RETURN pqn, pqnr.questionnaireId AS graph_id, NULL AS pt_id UNION MATCH (pqnr)-[:PARTICIPANT_TABLE]-(pt:ParticipantTable) -[:PARTICIPANT_QUESTION]-(pqn:ParticipantQuestion) RETURN pqn, pt.tableId AS graph_id, pt.tildaid AS pt_id } WITH cp, pa, pqnr.tildaid AS pqnr_id, pt_id, pqn, graph_id WHERE pqn.carePlanId = pa.carePlanId MATCH (pqn)-[:BELONGS_TO_QUESTION]-(qn:QuestionV2) OPTIONAL MATCH (qn)-[:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION {protocolid: pa.protocolId}]-(gnode:GraphNode) <-[gnrel:GRAPH_NEXT {graphid: graph_id}]-() WITH pa, pqnr_id, pt_id, pqn, qn, reduce(f = ?, x IN collect(coalesce(gnrel.flags, ?)) | apoc.bitwise.op(f, ?, x)) AS qn_flags OPTIONAL MATCH (pqn)-[:ALL_CHANGELOG]-(sdvcl:ChangeLog {type: ?, newValue: ?}) WITH pa, pqnr_id, pt_id, pqn, qn, qn_flags, max(sdvcl.createdat) AS sdv_verified_at OPTIONAL MATCH (pqn)-[:ALL_CHANGELOG]-(datacl:ChangeLog {type: ?}) WITH pa, pqnr_id, pt_id, pqn, qn, qn_flags, sdv_verified_at, max(datacl.createdat) AS last_data_change WHERE qn.title =~ ? RETURN DISTINCT pqn.tildaid AS pq_id, pa.tildaid AS pa_id, pqnr_id, pt_id, qn.tildaid AS question_id, coalesce(qn.title, ?) AS title, qn.variablename AS variable, coalesce(pqn.value, ?) AS value, coalesce(pqn.status, ?) AS status, coalesce(pqn.sdvVerified, false) AS sdv_verified, sdv_verified_at, last_data_change, coalesce(pqn.changeLogCount, ?) AS change_count, pqn.hdmClassId AS hdm_class_id, pqn.hdmObjId AS hdm_obj_id, apoc.bitwise.op(qn_flags, ?, ?) <> ? AS critical , qn.title =~ ? AS is_consent ORDER BY is_consent, title, pq_id
data_monitor
6 8.33 s 9.75 s 9.77 s flat
call db.clearQueryCaches()
call db.clearQueryCaches()
(internal)
4 3.27 s 9.50 s 6.55 s flat
MATCH (b:Budget) WHERE b.status = ? AND date(b.effectiveDate) <= date() RETURN b.tildaid
MATCH (b:Budget) WHERE b.status = ? AND date(b.effectiveDate) <= date() RETURN b.tildaid
finsvc
3 2.89 s 9.25 s 8.65 s 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
3 1.96 s 9.25 s 5.88 s 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
3 2.94 s 9.25 s 8.56 s flat
match (org:Organization{tildaid:$pdOrgId})-[:STUDY_TO_ORG]- (st:Study{tildaid:$pdStudyId}) call { with org,st with org,st match (org)-[:STUDY_TO_ORG]-(st)-[:PLAN_DEFINITION_TO_STUDY]- (pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(site…
match (org:Organization{tildaid:$pdOrgId})-[:STUDY_TO_ORG]- (st:Study{tildaid:$pdStudyId}) call { with org,st with org,st match (org)-[:STUDY_TO_ORG]-(st)-[:PLAN_DEFINITION_TO_STUDY]- (pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) where (org.orgType=? or org.orgType=?) return site, pd union with org,st with org,st match (org)-[:IS_AN_ORG]-(:Smo)-[:SITE_TO_SMO]-(site:Site)-[:PLAN_DEFINITION_TO_SITE]- (pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_STUDY]-(st) return site, pd } match (pd)-[:SOA_TO_PLAN_DEFINITION]-(soa:ScheduleOfActivities)-[:EXECUTE_SOA]-(cp:CarePlan) match (cp)-[:CAREPLAN_TO_ALL_PARTICIPANTVISITS]-(pv:ParticipantVisit) where pv.status in $completedVisitStatuses optional match (pv)-[:BELONGS_TO_VISIT]-(v:VisitV2)-[:GRAPH_NODE_REF_TO_GRAPH_NODE{protocolid:pv.protocolId}]-(vref:GraphNodeRef) match (pv)-[:PARTICIPANT_ACTIVITY]-(pa:ParticipantActivity) where apoc.bitwise.op(coalesce(pa.edcBitMap,?),?, ?)=? optional match (pa)-[:BELONGS_TO_ACTIVITY]-(a:ActivityV2)<-[:GRAPH_NODE_REF_TO_GRAPH_NODE{protocolid:pa.protocolId}]-(aref:GraphNodeRef)<-[r2:GRAPH_NEXT]-(:GraphNode) where r2.path[?]=pv.visitId with site, pd, cp, pv, v, vref, collect({id: aref.tildaid, title: a.title}) as acts with site, pd, cp, collect({id: vref.tildaid, title: v.title, pvId: pv.tildaid, signedOffByTeam: pv.signedOffByTeam, edcSignedOffByTeam: pv.edcSignedOffByTeam, status: pv.status, appointmentDate: pv.appointmentDate , hasUnfreezeRequest: exists((pv)-[:WITH_CONTEXT]-(:Task{category:?, state:?})) , activities: acts}) as pvs with site, pd, collect({id: cp.tildaid, subjectId: cp.subjectid, visits: pvs}) as cps return collect({id: site.tildaid, siteNumber: pd.siteNumber, subjects: cps}) as sites
execsvc
1 3.32 s 4.85 s 3.32 s flat
MATCH (p:Policy)-[:IS_ASSIGNED_TO]->(r:Role) WHERE coalesce(p.state, ?) IN [?, ?] OPTIONAL MATCH (r)<-[:MIMICS]-(m:Role) OPTIONAL MATCH (p)-[:APPLICABLE_IN]->(s:Scope {version:$scopeVersion}) UNWIND [r.name, m.name] as roleName WITH p, s, …
MATCH (p:Policy)-[:IS_ASSIGNED_TO]->(r:Role) WHERE coalesce(p.state, ?) IN [?, ?] OPTIONAL MATCH (r)<-[:MIMICS]-(m:Role) OPTIONAL MATCH (p)-[:APPLICABLE_IN]->(s:Scope {version:$scopeVersion}) UNWIND [r.name, m.name] as roleName WITH p, s, apoc.text.join(collect(DISTINCT roleName), ?) as roleList RETURN { name: p.name, roleList: roleList, objectTypeList: p.objectTypeList, allowedOps: p.allowedOps, scope: s.name } as policy
chat-agent
1 2.61 s 4.85 s 2.61 s flat
MATCH (s:Study)-[r:STUDY_TO_ACTOR]->(a:Actor) WHERE r.applyToStudyRoleFlag = false MATCH (s)-[r2:STUDY_TO_ACTOR]->(a) WHERE id(r2) <> id(r) DELETE r
MATCH (s:Study)-[r:STUDY_TO_ACTOR]->(a:Actor) WHERE r.applyToStudyRoleFlag = false MATCH (s)-[r2:STUDY_TO_ACTOR]->(a) WHERE id(r2) <> id(r) DELETE r
write execsvc
1 3.52 s 4.85 s 3.52 s flat
MATCH (ssa:StudySiteActor {delpending:false}) WHERE ssa.location IS NULL OR ssa.location = ? SET ssa.location = ?
MATCH (ssa:StudySiteActor {delpending:false}) WHERE ssa.location IS NULL OR ssa.location = ? SET ssa.location = ?
write execsvc
1 2.23 s 4.85 s 2.23 s flat
MATCH (cfg:WorkplanCfg) WHERE cfg.progressPending = true AND coalesce(cfg.lastViewedAtMs, ?) > (timestamp() - ?) AND (timestamp() - coalesce(cfg.lastProgressComputedAtMs, ?)) > coalesce(cfg.progressComputeIntervalMs, ?) RETURN cfg.tildaid …
MATCH (cfg:WorkplanCfg) WHERE cfg.progressPending = true AND coalesce(cfg.lastViewedAtMs, ?) > (timestamp() - ?) AND (timestamp() - coalesce(cfg.lastProgressComputedAtMs, ?)) > coalesce(cfg.progressComputeIntervalMs, ?) RETURN cfg.tildaid AS id, coalesce(cfg.progressDirtyAtMs, ?) AS dirtyAtMs LIMIT $limit
workplansvc
1 3.25 s 4.85 s 3.25 s flat
DROP DATABASE neo4j IF EXISTS
DROP DATABASE neo4j IF EXISTS
write (internal)
1 2.04 s 4.85 s 2.04 s flat
MATCH (n:Folder|SubArtifact) WHERE n.isArchived IS NULL SET n.isArchived = false RETURN count(n)
MATCH (n:Folder|SubArtifact) WHERE n.isArchived IS NULL SET n.isArchived = false RETURN count(n)
write docsvc
1 3.41 s 4.85 s 3.41 s flat
MATCH (pv:ParticipantVisit) WHERE (pv.edcStatus IS NULL OR pv.edcStatus = ? OR pv.edcStatus = ? OR pv.edcStatus = ?) AND (pv.status = ? OR pv.status = ?) AND pv.deltimestamp = ? MATCH (cp:CarePlan {tildaid: pv.carePlanId})-[:EXECUTE_SOA]- …
MATCH (pv:ParticipantVisit) WHERE (pv.edcStatus IS NULL OR pv.edcStatus = ? OR pv.edcStatus = ? OR pv.edcStatus = ?) AND (pv.status = ? OR pv.status = ?) AND pv.deltimestamp = ? MATCH (cp:CarePlan {tildaid: pv.carePlanId})-[:EXECUTE_SOA]- (soa:ScheduleOfActivities)-[:SOA_TO_PLAN_DEFINITION]- (pd:DslPlanDefinition) MATCH (pd)-[:PLAN_DEFINITION_TO_STUDY]-(st:Study) MATCH (pd)-[:PLAN_DEFINITION_TO_SITE]-(site:Site)-[:SITE_TO_SMO]- (smo)-[:IS_AN_ORG]-(org:Organization) OPTIONAL MATCH (visit:VisitV2)-[:BELONGS_TO_VISIT]-(pv) WITH pv, cp, st, site, org, visit OPTIONAL MATCH (pv)-[:PARTICIPANT_ACTIVITY]->(emptyPa:ParticipantActivity) WHERE (emptyPa.edcStatus IS NULL OR emptyPa.edcStatus = ?) AND emptyPa.deltimestamp = ? WITH pv, cp, st, site, org, visit, collect(emptyPa) AS emptyPas OPTIONAL MATCH (pv)-[:PARTICIPANT_ACTIVITY]->(pa:ParticipantActivity)-[:BELONGS_TO_ACTIVITY]->(act:ActivityV2) WHERE pa.deltimestamp = ? RETURN pv, cp, st, site, org, visit, emptyPas, collect({pa: pa, activity: act}) AS paActPairs LIMIT ?
execsvc
2 1.26 s 4.70 s 2.16 s flat
MATCH (task:Task) WHERE task.ufid IS NOT NULL AND task.ufid > ? AND (task.task_number IS NULL OR task.task_number = ?) SET task.task_number = task.ufid WITH task REMOVE task.ufid RETURN count(task) as migrated
MATCH (task:Task) WHERE task.ufid IS NOT NULL AND task.ufid > ? AND (task.task_number IS NULL OR task.task_number = ?) SET task.task_number = task.ufid WITH task REMOVE task.ufid RETURN count(task) as migrated
write tusker
2 2.93 s 4.70 s 4.49 s flat
MATCH (n:GraphNode)-[r:GRAPH_NEXT]->(n) DELETE r
MATCH (n:GraphNode)-[r:GRAPH_NEXT]->(n) DELETE r
write studiosvc
2 2.19 s 4.70 s 3.32 s flat
match (user:User) where user.name contains ? return DISTINCT user.name;
match (user:User) where user.name contains ? return DISTINCT user.name;
(internal)
2 1.41 s 4.70 s 2.64 s 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
381 1.52 s 4.48 s 4.30 s 0.4× ↓
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
2,281 1.45 s 4.37 s 26.49 s 0.4× ↓
MATCH (:CarePlan {tildaid:?})-[:PARTICIPANT_ACTIVITY]->(pa:ParticipantActivity)-[:BELONGS_TO_ACTIVITY]->(:ActivityV2 {title:?}) MATCH (pa)-[:PARTICIPANT_QUESTIONNAIRE]->(:ParticipantQuestionnaire)-[:PARTICIPANT_TABLE]->(:ParticipantTable {…
MATCH (:CarePlan {tildaid:?})-[:PARTICIPANT_ACTIVITY]->(pa:ParticipantActivity)-[:BELONGS_TO_ACTIVITY]->(:ActivityV2 {title:?}) MATCH (pa)-[:PARTICIPANT_QUESTIONNAIRE]->(:ParticipantQuestionnaire)-[:PARTICIPANT_TABLE]->(:ParticipantTable {tableId:?})-[:PARTICIPANT_QUESTION]->(pq:ParticipantQuestion) WHERE pq.hdmClassId IN [?,?] MATCH (qn:QuestionV2 {tildaid: pq.questionId}) RETURN pq.hdmClassId AS row, qn.title AS question, pq.value AS value, pq.status AS status, EXISTS { (qn)<-[:GRAPH_NODE_REF_TO_QUESTION]-(:GraphNodeRef) } AS inAnyForm ORDER BY row, question
(internal)
1 1.02 s 1.95 s 1.02 s flat
MATCH (u:User) WHERE NOT EXISTS ((:Inbox)-[:OWNED_BY]->(u)) MERGE (i:Inbox {type:?, name: u.email, deltimestamp:?})-[r:OWNED_BY]->(u) ON CREATE SET i.createdat = timestamp(), i.tildaid = apoc.create.uuid(), r.createdat = timestamp(), r.til…
MATCH (u:User) WHERE NOT EXISTS ((:Inbox)-[:OWNED_BY]->(u)) MERGE (i:Inbox {type:?, name: u.email, deltimestamp:?})-[r:OWNED_BY]->(u) ON CREATE SET i.createdat = timestamp(), i.tildaid = apoc.create.uuid(), r.createdat = timestamp(), r.tildaid = apoc.create.uuid() RETURN COUNT(i)
write tusker
1 1.10 s 1.95 s 1.10 s flat
UNWIND $userIds AS uid CALL (uid) { MATCH (:User{tildaid:uid})<-[:TRAINING_ASSIGNMENT_TO_USER]-(ta:TrainingAssignment{ownerOrgId:$orgId, deltimestamp:?}) WHERE coalesce(ta.studyId, ?) = ? AND (ta.state = $assignedState OR EXISTS { (ta)-[:P…
UNWIND $userIds AS uid CALL (uid) { MATCH (:User{tildaid:uid})<-[:TRAINING_ASSIGNMENT_TO_USER]-(ta:TrainingAssignment{ownerOrgId:$orgId, deltimestamp:?}) WHERE coalesce(ta.studyId, ?) = ? AND (ta.state = $assignedState OR EXISTS { (ta)-[:PARTICIPANT_ACTIVITY]->(done:ParticipantActivity{deltimestamp:?}) WHERE done.status IN $completedStatuses }) MATCH (training:Training{delpending:false})-[:TRAINING_TO_ASSIGNMENT]->(ta) WHERE (coalesce(training.scopeType, ?) = $orgScopeType) AND (training.orgId <> ? AND training.orgId = $orgId) RETURN ta, training, null AS study UNION MATCH (:User{tildaid:uid})<-[:TRAINING_ASSIGNMENT_TO_USER]-(ta:TrainingAssignment{deltimestamp:?}) WHERE ta.studyId IN $studyIds AND (ta.state = $assignedState OR EXISTS { (ta)-[:PARTICIPANT_ACTIVITY]->(done:ParticipantActivity{deltimestamp:?}) WHERE done.status IN $completedStatuses }) AND (ta.ownerOrgId = $viewerOrgId OR $viewerOrgId IN ta.deliveredOrgIds) MATCH (training:Training{delpending:false})-[:TRAINING_TO_ASSIGNMENT]->(ta), (training)-[:PLAN_DEFINITION_TO_STUDY]->(study:Study{delpending:false}) WHERE study.tildaid = ta.studyId AND (NOT ((coalesce(training.siteScope, ?) = $studyTeamScope) OR (coalesce(training.scopeType, ?) = $orgScopeType)) OR (training.orgId <> ? AND training.orgId = $callerOrgId)) RETURN ta, training, study } CALL (ta) { OPTIONAL MATCH (ta)-[:PARTICIPANT_ACTIVITY]->(trainingPA:ParticipantActivity{deltimestamp:?}) WHERE CASE WHEN ta.state = $assignedState THEN NOT EXISTS { (trainingPA)-[:NEXT_PARTICIPANT_ACTIVITY]->() } ELSE trainingPA.status IN $completedStatuses AND NOT EXISTS { (trainingPA)-[:NEXT_PARTICIPANT_ACTIVITY*]->(newer:ParticipantActivity{deltimestamp:?}) WHERE newer.status IN $completedStatuses } END RETURN trainingPA ORDER BY trainingPA.createdat DESC LIMIT ? } WITH uid, training, ta, study, trainingPA WHERE trainingPA IS NOT NULL MATCH (trainingPA)-[:BELONGS_TO_ACTIVITY]->(trainingActivity:ActivityV2) CALL (trainingPA, trainingActivity) { OPTIONAL MATCH (trainingPA)-[:PARTICIPANT_QUESTIONNAIRE]-(tpPqnr:ParticipantQuestionnaire)-[:BELONGS_TO_QUESTIONNAIRE]-(tpQnr:QuestionnaireV2) WHERE exists((tpQnr)-[:GRAPH_TO_VARIABLE {graphid: tpQnr.tildaid, path: [tpQnr.tildaid]}]->(:VariableV2 {name: ?, type: ?})) WITH trainingPA, trainingActivity, tpPqnr IS NOT NULL AS tpIsQuiz, tpQnr.title AS tpTitle, tpPqnr.attempts AS tpAttempts, tpPqnr.gradedQuestionCount AS tpGraded, tpPqnr.correctQuestionCount AS tpCorrect, [(tpPqnr)-[:PARTICIPANT_VARIABLE]-(tpPv:ParticipantVariable)-[:BELONGS_TO_VARIABLE]-(tpVar:VariableV2) WHERE tpVar.name IN [?, ?, ?] | [tpVar.name, tpPv.value]] AS tpVals WITH trainingPA, trainingActivity, count(CASE WHEN any(x IN tpVals WHERE x[?] = ? AND coalesce(x[?], ?) <> ?) THEN ? END) AS tpFailed, sum(toInteger(coalesce([x IN tpVals WHERE x[?] = ? | x[?]][?], ?))) AS tpTotal, sum(toInteger(coalesce([x IN tpVals WHERE x[?] = ? | x[?]][?], ?))) AS tpTotalMax, collect(CASE WHEN tpIsQuiz THEN {title: tpTitle, attempts: coalesce(tpAttempts, ?), graded: tpGraded, correct: tpCorrect, score: head([x IN tpVals WHERE x[?] = ? | x[?]]), max: head([x IN tpVals WHERE x[?] = ? | x[?]]), result: head([x IN tpVals WHERE x[?] = ? | x[?]])} END) AS tpQuizzes WITH trainingPA, trainingActivity, tpFailed, tpTotal, tpTotalMax, tpQuizzes, [q IN tpQuizzes | q.score] AS tpScores, [q IN tpQuizzes | q.max] AS tpMaxScores RETURN tpFailed = ? AND (trainingPA.status = ? OR coalesce(trainingActivity.passingScore, ?) = ? OR tpTotalMax = ? OR tpTotal * ? >= coalesce(trainingActivity.passingScore, ?) * tpTotalMax) AS trainingPassed, tpScores AS trainingScoreValues, tpMaxScores AS trainingMaxScoreValues } WITH uid, training, ta, study, trainingActivity, trainingPA, trainingPassed, trainingScoreValues, trainingMaxScoreValues, [(trainingPA)-[:ALL_CHANGELOG]->(cl:ChangeLog) WHERE cl.type = ? AND cl.newValue IN [?,?,?,?] | [cl.newValue, cl.createdat, cl.who, CASE WHEN cl.newValue = ? AND cl.blob STARTS WITH ? THEN coalesce(apoc.convert.fromJsonMap(cl.blob).completedAt, cl.createdat) ELSE cl.createdat END, cl.reason]] AS trainingLog ORDER BY training.name, training.tildaid RETURN uid, collect({activityId:trainingActivity.tildaid, activityTitle:trainingActivity.title, version:trainingActivity.version, paId:trainingPA.tildaid, paStatus:trainingPA.status, paUpdatedAt:trainingPA.updatedat, paCreatedAt:trainingPA.createdat, paDueDate:trainingPA.dueDate, trainingId:training.tildaid, trainingName:training.name, trainingStatus:training.status, validUntil:training.validUntil, validUntilUnits:training.validUntilUnits, assignmentState:ta.state, studyId:study.tildaid, studyName:study.name, passed:trainingPassed, scoreValues:trainingScoreValues, maxScoreValues:trainingMaxScoreValues, assignments:[x IN trainingLog WHERE x[?] IN [?,?] | [x[?], x[?]]], completions:[x IN trainingLog WHERE x[?] IN [?,?] | [x[?], x[?]]] }) AS trainingActivities
execsvc
1 1.25 s 1.95 s 1.25 s flat
MATCH (d:Document)-[:DOCUMENT_VERSION]->(ver:DocumentVersion {status: $pending}) WHERE ver.createdat <= $cutoff RETURN d.tildaid, ver.tildaid ORDER BY ver.createdat LIMIT $limit
MATCH (d:Document)-[:DOCUMENT_VERSION]->(ver:DocumentVersion {status: $pending}) WHERE ver.createdat <= $cutoff RETURN d.tildaid, ver.tildaid ORDER BY ver.createdat LIMIT $limit
docsvc
22 693 ms 1.95 s 4.18 s 3.4× ↑
MATCH (proto:FormV2 {tildaid: $protoId})-[pr:PROTOCOL_TO_GRAPH_NODE_REF]->(ref:GraphNodeRef) MATCH (ref)-[:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION {protocolid: $protoId}]->(target) WHERE (target:QuestionV2 OR target:Respons…
MATCH (proto:FormV2 {tildaid: $protoId})-[pr:PROTOCOL_TO_GRAPH_NODE_REF]->(ref:GraphNodeRef) MATCH (ref)-[:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION {protocolid: $protoId}]->(target) WHERE (target:QuestionV2 OR target:ResponseSet OR target:FormV2) AND target.tildaid IN $targetIds RETURN target.tildaid AS tid, ref.tildaid AS refId, pr.path AS path
studiosvc
3 1.42 s 1.92 s 1.85 s flat
MATCH (proto:FormV2 {tildaid: $protoId})-[pr:PROTOCOL_TO_GRAPH_NODE_REF]->(ref:GraphNodeRef) MATCH (ref)-[:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION {protocolid: $protoId}]->(target) WHERE (target:QuestionV2 OR target:Respons…
MATCH (proto:FormV2 {tildaid: $protoId})-[pr:PROTOCOL_TO_GRAPH_NODE_REF]->(ref:GraphNodeRef) MATCH (ref)-[:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION {protocolid: $protoId}]->(target) WHERE (target:QuestionV2 OR target:ResponseSet OR target:FormV2) AND target.tildaid IN $targetIds RETURN target.tildaid AS tid, ref.tildaid AS refId, pr.path AS path
studiosvc
2 1.02 s 1.90 s 1.07 s 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
6 313 ms 1.70 s 1.85 s 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
6 192 ms 1.70 s 1.10 s 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
6 209 ms 1.70 s 1.23 s 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
6 223 ms 1.70 s 1.31 s flat
CALL { MATCH (ctx:WorkPlanContext) WHERE ctx.delpending = true RETURN ctx UNION MATCH (ctx:WorkPlanContext) WHERE ctx.createdat < $cutoff RETURN ctx } WITH DISTINCT ctx LIMIT $limit DETACH DELETE ctx RETURN count(ctx) AS deleted
CALL { MATCH (ctx:WorkPlanContext) WHERE ctx.delpending = true RETURN ctx UNION MATCH (ctx:WorkPlanContext) WHERE ctx.createdat < $cutoff RETURN ctx } WITH DISTINCT ctx LIMIT $limit DETACH DELETE ctx RETURN count(ctx) AS deleted
write workplansvc
6 186 ms 1.70 s 1.09 s flat
MATCH (study:Study )-[:MANAGED_BY]-(:Inbox)-[:BELONGS_TO]-(t:Task) WHERE NOT EXISTS ((t)-[:BELONGS_TO]-(:Inbox{type:?})) AND EXISTS((study)-[:STUDY_TO_ORG{inherited:false}]-(:Organization{orgType:?})) CALL { WITH t MATCH (t)<-[:CREATED_FRO…
MATCH (study:Study )-[:MANAGED_BY]-(:Inbox)-[:BELONGS_TO]-(t:Task) WHERE NOT EXISTS ((t)-[:BELONGS_TO]-(:Inbox{type:?})) AND EXISTS((study)-[:STUDY_TO_ORG{inherited:false}]-(:Organization{orgType:?})) CALL { WITH t MATCH (t)<-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(:ParticipantControl)-[:PARTICIPANT_CONTROL]-(:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]-(pw:ParticipantWorkflow) RETURN ptc, pw UNION ALL WITH t MATCH (t)<-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]-(pw:ParticipantWorkflow) RETURN ptc, pw } WITH DISTINCT study, t, ptc, pw MATCH (t)-[:BELONGS_TO]-(:Inbox)-[:MANAGED_BY]-(o:Organization) MATCH (ptc)-[:BELONGS_TO_TASKCONFIG]-(tc:TaskConfig) OPTIONAL MATCH (t)-[:BELONGS_TO]-(taskInbox:Inbox{type:?})--(taskUser:User) OPTIONAL MATCH (pw)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:StudySiteActor)-[:STUDYSITEACTOR_TO_ACTOR]-(:Actor{delpending:false})-[:FOR_USER]-(user:User) OPTIONAL MATCH (pw)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(scopeSite:Site)-[:SITE_TO_SMO]-(:Smo)-[:IS_AN_ORG]-(o) WITH DISTINCT study, t, o, tc, taskInbox, taskUser, user, scopeSite SKIP $skip LIMIT $limit WITH collect({study:study, t:t, o:o, tc:tc, taskInbox:taskInbox, taskUser:taskUser, user:user, scopeSite:scopeSite}) AS rows, collect(DISTINCT study) AS studies, collect(DISTINCT o) AS orgs, collect(DISTINCT scopeSite) AS sites CALL { WITH studies UNWIND studies AS study OPTIONAL MATCH (study)-[:STUDY_TO_ACTOR]-(a:Actor{delpending:false})-[:FOR_USER]-(u:User), (a)-[:APPOINTED_AS]-(r:Role) WHERE r.name IN [?, ?, ?] RETURN study.tildaid AS studyId, collect(DISTINCT CASE WHEN r.name = ? THEN u.tildaid END) AS piTildaid, collect(DISTINCT CASE WHEN r.name = ? THEN u.tildaid END) AS smoTildaid, collect(DISTINCT CASE WHEN r.name = ? THEN u.tildaid END) AS raTildaid } WITH rows, orgs, sites, collect({studyId: studyId, pi: piTildaid, smo: smoTildaid, ra: raTildaid}) AS studyRoles CALL { WITH orgs UNWIND orgs AS o OPTIONAL MATCH (o)-[:ORGANIZATION_TO_ACTOR]-(a:Actor{delpending:false})-[:FOR_USER]-(u:User), (a)-[:APPOINTED_AS]-(:Role{name:?}) RETURN o.tildaid AS orgId, collect(DISTINCT u.tildaid) AS adminTildaid } WITH rows, sites, studyRoles, collect({orgId: orgId, admin: adminTildaid}) AS orgRoles CALL { WITH sites UNWIND (CASE WHEN size(sites) = ? THEN [null] ELSE sites END) AS scopeSite OPTIONAL MATCH (scopeSite)-[:STAFF_TO_ACTOR]-(a:Actor{delpending:false})-[:FOR_USER]-(u:User), (a)-[:APPOINTED_AS]-(:Role{name:?}) RETURN scopeSite.tildaid AS siteId, collect(DISTINCT u.tildaid) AS siteAdminTildaid } WITH rows, studyRoles, orgRoles, collect({siteId: siteId, admin: siteAdminTildaid}) AS siteRoles UNWIND rows AS row WITH row, [x IN studyRoles WHERE x.studyId = row.study.tildaid][?] AS sr, [x IN orgRoles WHERE x.orgId = row.o.tildaid][?] AS orr, [x IN siteRoles WHERE row.scopeSite IS NOT NULL AND x.siteId = row.scopeSite.tildaid][?] AS str RETURN DISTINCT row.t AS task, apoc.convert.toJson({userTildaid: row.user.tildaid, userName: row.user.name, PITildaid: sr.pi, studyOwnerTildaid: sr.smo, regAnalystTildaid: sr.ra, orgAdminTildaid: orr.admin, studyName: row.study.name, siteName: row.scopeSite.name, siteAdminTildaid: CASE WHEN row.scopeSite IS NULL THEN [] ELSE str.admin END}) AS details, row.tc.who AS dsnWho, row.o.alias AS orgAlias, row.taskInbox, row.taskUser.tildaid AS taskUserId
tusker
18 514 ms 1.55 s 1.47 s 0.8× ↓
MATCH (o:Organization)-[:ORGANIZATION_TO_ACTOR]->(a:Actor)-[:FOR_USER]->(user:User),(a)-[:APPOINTED_AS]->(r:Role) MATCH (user)<-[:FOR_USER]-(studyActor:Actor{orgId: o.tildaid})<-[:STUDY_TO_ACTOR]-(st:Study) WHERE true AND st.tildaid IN $st…
MATCH (o:Organization)-[:ORGANIZATION_TO_ACTOR]->(a:Actor)-[:FOR_USER]->(user:User),(a)-[:APPOINTED_AS]->(r:Role) MATCH (user)<-[:FOR_USER]-(studyActor:Actor{orgId: o.tildaid})<-[:STUDY_TO_ACTOR]-(st:Study) WHERE true AND st.tildaid IN $studyFilterIds AND NOT o.tildaid=$curOrgId AND (:Organization{tildaid:$curOrgId})<-[:STUDY_TO_ORG]-(st)-[:STUDY_TO_ORG]->(o) AND r.name in [$memberRole] WITH o, a, user, COLLECT(DISTINCT r.name) AS roles RETURN user{.*, orgName: o.name, orgId: o.tildaid, roles: roles}
onboardingsvc
9 436 ms 1.55 s 1.24 s 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
1 618 ms 975 ms 618 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 939 ms 975 ms 939 ms flat
MATCH (wp:WorkPlanInstance {hasActivationFailedItem: true})<-[:WORKPLAN_CFG_TO_INSTANCE]-(cfg:WorkplanCfg) WHERE wp.state <> ? MATCH (wp)-[:WORKPLAN_INSTANCE_TO_MILESTONE]->(:WorkPlanMilestone)-[:REL_WORKPLAN_INSTANCE_MILESTONE_TO_ITEM]->(…
MATCH (wp:WorkPlanInstance {hasActivationFailedItem: true})<-[:WORKPLAN_CFG_TO_INSTANCE]-(cfg:WorkplanCfg) WHERE wp.state <> ? MATCH (wp)-[:WORKPLAN_INSTANCE_TO_MILESTONE]->(:WorkPlanMilestone)-[:REL_WORKPLAN_INSTANCE_MILESTONE_TO_ITEM]->(item:WorkplanInstanceMilestoneItem) WHERE item.itemType = ? AND coalesce(item.workOrderActivationFailedAt, ?) > ? AND coalesce(item.workOrderActivationErrorCode, ?) = ? AND coalesce(item.workOrderCompletedAt, ?) = ? AND coalesce(item.workOrderResolvedAt, ?) = ? AND coalesce(item.skippedAt, ?) = ? AND coalesce(item.notApplicableAt, ?) = ? AND coalesce(item.workOrderId, ?) <> ? AND coalesce(item.workOrderActivationLastRetriedAt, ?) < item.workOrderActivationFailedAt WITH cfg, wp, item ORDER BY item.tildaid SKIP $skip LIMIT $limit OPTIONAL MATCH (org:Organization {tildaid: cfg.orgid}) RETURN cfg.tildaid AS cfgId, cfg.studyId AS studyId, coalesce(cfg.workOrderEmailAutoSendOnActivate, true) AS autoSend, wp.tildaid AS instanceId, wp.scopeId AS siteId, 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
1 757 ms 975 ms 757 ms flat
CREATE DATABASE neo4j IF NOT EXISTS OPTIONS {txLogEnrichment: ?}
CREATE DATABASE neo4j IF NOT EXISTS OPTIONS {txLogEnrichment: ?}
write (internal)
1 560 ms 975 ms 560 ms flat
MATCH (d:DocumentVersion) WHERE (NOT d.linearizedPdfUrl IS NULL AND d.linearizedPdfUrl <> ?) SET d.linearizedPdfUrl = replace(d.linearizedPdfUrl, ?, ?)
MATCH (d:DocumentVersion) WHERE (NOT d.linearizedPdfUrl IS NULL AND d.linearizedPdfUrl <> ?) SET d.linearizedPdfUrl = replace(d.linearizedPdfUrl, ?, ?)
write (internal)
1 828 ms 975 ms 828 ms flat
SHOW DATABASE neo4j YIELD currentStatus RETURN currentStatus
SHOW DATABASE neo4j YIELD currentStatus RETURN currentStatus
(internal)
1 679 ms 975 ms 679 ms flat
MATCH (study:Study {tildaid:$studyId})-[:BUDGET_TO_STUDY]-(budget:Budget)-[:BUDGET_TO_SITE]-(site:Site) WHERE site.tildaid IN $siteIds MATCH (budget)-[:BUDGET_TO_SITE]-(s:Site) OPTIONAL MATCH (pv)-[:PLAN_DEFINITION_TO_ADOPTED_PROTOCOL_VERS…
MATCH (study:Study {tildaid:$studyId})-[:BUDGET_TO_STUDY]-(budget:Budget)-[:BUDGET_TO_SITE]-(site:Site) WHERE site.tildaid IN $siteIds MATCH (budget)-[:BUDGET_TO_SITE]-(s:Site) OPTIONAL MATCH (pv)-[:PLAN_DEFINITION_TO_ADOPTED_PROTOCOL_VERSIONS]-(sitePD:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(s) WHERE any(label IN labels(pv) WHERE label IN [?, ?]) MATCH (sitePD)-[:PLAN_DEFINITION_TO_STUDY]-(study) RETURN DISTINCT budget, s, pv
finsvc
1 529 ms 975 ms 529 ms flat
call { match (task:Task{assignment:?}) where (task.state = ? or task.state = ?) return task } with task where not exists ( (task)-[:CREATED_FROM_SPEC]-(:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(:ParticipantTaskList)-[:PARTICIPANT_…
call { match (task:Task{assignment:?}) where (task.state = ? or task.state = ?) 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
40 414 ms 950 ms 1.00 s 0.6× ↓
CREATE DATABASE `neo4j-knowledge` IF NOT EXISTS
CREATE DATABASE `neo4j-knowledge` IF NOT EXISTS
write chat-agent
3 334 ms 925 ms 994 ms flat
MATCH (org:Organization{tildaid:$scopeOrgId0}) CALL { WITH org UNWIND $lists.allowedStudies0 AS studyId OPTIONAL MATCH (study:Study) WHERE study.tildaid = studyId // An inactive actor carries no membership, so it is excluded here rather th…
MATCH (org:Organization{tildaid:$scopeOrgId0}) CALL { WITH org UNWIND $lists.allowedStudies0 AS studyId OPTIONAL MATCH (study:Study) WHERE study.tildaid = studyId // An inactive actor carries no membership, so it is excluded here rather than at each use: // the sites, countries and roles below all hang off it. OPTIONAL MATCH (study)-[:STUDY_TO_ACTOR]-(studyActor:Actor{orgId:$ctxOrgId0})-[:FOR_USER]->(:User{tildaid:$ctxUserId0}) WHERE studyActor.state <> ? // Collect sites where user has membership in this study OPTIONAL MATCH (studyActor)-[:STUDYSITEACTOR_TO_ACTOR]-(:StudySiteActor)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]-(pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) WITH org, study, studyActor, collect(DISTINCT site.tildaid) as userSiteIds // Collect countries where user has membership in this study OPTIONAL MATCH (studyActor)<-[:STUDYCOUNTRYACTOR_TO_ACTOR]-(sca:StudyCountryActor) WITH org, study, studyActor, userSiteIds, collect(DISTINCT sca.country) as userCountryIds // Pre-collect policies for this user/role in this study OPTIONAL MATCH (org)<-[:DOC_ACCESS_POLICY_TO_ORG]-(policy:DocumentAccessPolicy{status:?})-[:POLICY_TO_STUDY]->(study) WHERE EXISTS { MATCH (policy)-[:POLICY_FOR_USER]->(:User{tildaid:$ctxUserId0}) } OR (studyActor IS NOT NULL AND EXISTS { MATCH (policy)-[:POLICY_FOR_ROLE]->(role:Role)<-[:APPOINTED_AS]-(studyActor) }) WITH study, studyActor, userSiteIds, userCountryIds, collect(policy) as policies WITH {study:study, studyActor:studyActor, userSiteIds:userSiteIds, userCountryIds:userCountryIds, policies:policies} AS st WITH collect(distinct st) as studies // studyById lets each document row look its context up by study id instead of scanning // the whole list. Entries whose study did not resolve share the ? key; they all carry // the same empty context, so which one wins does not matter. The node-bearing maps go no // further than this subquery; studyIdsInScope needs no lookup, since an id with no Study // node can never equal a matched study?Basic??ReadWrite?ReadOnly?s folder and ancestors (up to ? levels for TMF hierarchy) OPTIONAL MATCH (doc1)<-[:INCLUDES]-(docFolder:Folder) OPTIONAL MATCH (docFolder)<-[:INCLUDES*?..?]-(ancestorFolder:Folder) WITH doc1, policies, userSiteIds, userCountryIds, defaultAccessLevel, collect(DISTINCT docFolder) + collect(DISTINCT ancestorFolder) AS folderHierarchy // Check document ownership OPTIONAL MATCH (doc1)-[:UPLOADED_BY]->(uploader:User{tildaid:$policyUploaderId0}) WITH doc1, policies, userSiteIds, userCountryIds, defaultAccessLevel, folderHierarchy, uploader IS NOT NULL AS isOwnedByUser // Filter policies by: // ?. Folder: policy applies if folder is in hierarchy OR policy has no folder (study-wide). A folder-less // ownership policy is the role?Owned Documents?Non Owned Documents?Staging?Pre-Staging?Owned Documents?Non Owned Documents?My Sites Documents?Other Sites Documents?My Countries Documents?Other Countries Documents?Study Scope Documents?NoAccess?NoAccess?ReadOnly?ReadOnly?ReadWrite?ReadOnly?NoAccess??Inactive' AND sst.tildaid IN studyIdsInScope AND (doc1.siteId = ? OR (a)-[:STUDYSITEACTOR_TO_ACTOR]-(:StudySiteActor)- [:STUDYSITEACTOR_TO_PLAN_DEFINITION]-(:DslPlanDefinition{delpending:false,type:?})- [:PLAN_DEFINITION_TO_SITE]-(:Site{tildaid:doc1.siteId})) RETURN doc1 as doc UNION WITH doc1, studyIdsInScope, directAdmit WITH doc1, studyIdsInScope WHERE NOT directAdmit AND (NOT $nonSiteOnlyPatients0 OR doc1.patientId = ?) AND doc1.siteId <> ? MATCH (s:Site{tildaid:doc1.siteId, delpending:false})-[:PLAN_DEFINITION_TO_SITE]- (pd:DslPlanDefinition{delpending:false,type:?})-[:PLAN_DEFINITION_TO_STUDY]->(sst:Study) WHERE sst.tildaid IN studyIdsInScope RETURN doc1 as doc UNION WITH doc1, directAdmit WITH doc1 WHERE directAdmit RETURN doc1 as doc} WITH DISTINCT doc WITH doc, coalesce(doc.archived, false) as isArchived RETURN count(CASE WHEN NOT isArchived AND doc.stateTag = ? THEN ? END) as readyForTmf, count(CASE WHEN NOT isArchived AND doc.stateTag = ? THEN ? END) as needsCorrection, count(CASE WHEN NOT isArchived AND doc.stateTag = ? THEN ? END) as needsAttention, count(CASE WHEN NOT isArchived AND doc.stateTag = ? THEN ? END) as draft, count(CASE WHEN NOT isArchived AND doc.stateTag = ? THEN ? END) as aiReview, count(CASE WHEN NOT isArchived AND doc.stateTag = ? THEN ? END) as manual, count(CASE WHEN isArchived THEN ? END) as archived
docsvc
3 279 ms 925 ms 812 ms flat
MATCH (c:TMFSyncConfig) RETURN c {.*} AS c ORDER BY c.created_at DESC SKIP $offset LIMIT $limit
MATCH (c:TMFSyncConfig) RETURN c {.*} AS c ORDER BY c.created_at DESC SKIP $offset LIMIT $limit
tmfsync
4 185 ms 900 ms 606 ms flat
MATCH (j:TMFSyncJob {status: ?}) WHERE j.claim_expires_at < $now_ms RETURN j.id AS id, j.org_alias AS org_alias, j.study_id AS study_id, j.sync_config_id AS sync_config_id, j.connector_type AS connector_type, j.claimed_by AS dead_pod, j.cl…
MATCH (j:TMFSyncJob {status: ?}) WHERE j.claim_expires_at < $now_ms RETURN j.id AS id, j.org_alias AS org_alias, j.study_id AS study_id, j.sync_config_id AS sync_config_id, j.connector_type AS connector_type, j.claimed_by AS dead_pod, j.claim_expires_at AS claim_expires_at, j.lane AS lane LIMIT ?
tmfsync
4 202 ms 900 ms 797 ms flat
MATCH (j:CtmsSyncJob {status: ?}) WHERE j.claim_expires_at < $now_ms RETURN j.id AS id, j.org_alias AS org_alias, j.study_id AS study_id, j.sync_config_id AS sync_config_id, j.type AS type, coalesce(j.reap_count, ?) AS reap_count, j.claime…
MATCH (j:CtmsSyncJob {status: ?}) WHERE j.claim_expires_at < $now_ms RETURN j.id AS id, j.org_alias AS org_alias, j.study_id AS study_id, j.sync_config_id AS sync_config_id, j.type AS type, coalesce(j.reap_count, ?) AS reap_count, j.claimed_by AS dead_pod, j.claim_expires_at AS claim_expires_at LIMIT ?
tmfsync
4 172 ms 900 ms 674 ms flat
WITH $`t` as `t` optional match (t)-[:WITH_CONTEXT]->(q:Query) optional match (cp:CarePlan{tildaid: q.careplanId})-[:EXECUTE_SOA]->(s:ScheduleOfActivities)-[:SOA_TO_PLAN_DEFINITION]->(pd:DslPlanDefinition{delpending:false})-[:PLAN_DEFINITI…
WITH $`t` as `t` optional match (t)-[:WITH_CONTEXT]->(q:Query) optional match (cp:CarePlan{tildaid: q.careplanId})-[:EXECUTE_SOA]->(s:ScheduleOfActivities)-[:SOA_TO_PLAN_DEFINITION]->(pd:DslPlanDefinition{delpending:false})-[:PLAN_DEFINITION_TO_STUDY]->(st:Study) optional match (pd)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) optional match (p:Patient{tildaid: cp.participantId}) optional match (phi:Phi{tildaid: p.phiid}) optional match (pq:ParticipantQuestion{tildaid:q.scopeId})<-[:PARTICIPANT_QUESTION]-(pqn:ParticipantQuestionnaire)<-[:PARTICIPANT_QUESTIONNAIRE]-(pa:ParticipantActivity) optional match (pa)<-[:PARTICIPANT_ACTIVITY]-(pv:ParticipantVisit) optional match (pv)-[:BELONGS_TO_VISIT]->(v) where v:Visit or v:VisitV2 optional match (t)-[:CREATED_BY]->(u:User) optional match (t)-[:BELONGS_TO]->(i:Inbox)-[:OWNED_BY]->(au:User) optional match (t)-[:CREATED_BY]-(cu:User) with t, st, u, collect(au) as auCollected, q, site, v, p, phi, cu as createdBy, pd.siteNumber as siteNumber, cp return {Task: t, Study: st, Phi: phi, Site: {tildaid: site.tildaid, name: site.name, city: site.city, country: site.country, siteNumber: siteNumber}, Visit: v, User: u, AssignedUser: auCollected, Patient: p, CreatedBy: createdBy, CarePlan: cp}
tusker
4 216 ms 900 ms 862 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
5 159 ms 875 ms 767 ms flat
with $protocolId as protocolId, $careplanId as careplanId, null as visitRefId, $activityRefId as activityRefId, null as pvId, null as pwId, $paId as paId, $pqnrId as pqnrId, $ptId as ptId, $hdmClassId as hdmClassId call(careplanId, protoco…
with $protocolId as protocolId, $careplanId as careplanId, null as visitRefId, $activityRefId as activityRefId, null as pvId, null as pwId, $paId as paId, $pqnrId as pqnrId, $ptId as ptId, $hdmClassId as hdmClassId call(careplanId, protocolId, pwId, pvId, paId, pqnrId, ptId, hdmClassId) { match (vref:GraphNodeRef{tildaid:?})-[rv:GRAPH_NODE_REF_TO_GRAPH_NODE]->(v:VisitV2)-[:BELONGS_TO_VISIT]-(pv:ParticipantVisit{carePlanId:careplanId}) match (aref:GraphNodeRef{tildaid:?})-[ra:GRAPH_NODE_REF_TO_GRAPH_NODE]->(a:ActivityV2)-[:BELONGS_TO_ACTIVITY]-(pa:ParticipantActivity{carePlanId:careplanId}) match (qref:GraphNodeRef{tildaid:?})-[rq:GRAPH_NODE_REF_TO_GRAPH_NODE]->(q:QuestionnaireV2)-[:BELONGS_TO_QUESTIONNAIRE]-(pqnr:ParticipantQuestionnaire{carePlanId:careplanId}) match(ref:GraphNodeRef{tildaid:?})-[rpq:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION] ->(qn:QuestionV2)-[:BELONGS_TO_QUESTION]-(pqn:ParticipantQuestion{carePlanId:careplanId})-[:PARTICIPANT_QUESTION]-(pqnr)-[:PARTICIPANT_QUESTIONNAIRE]-(pa)-[:PARTICIPANT_ACTIVITY]-(pv)-[:CAREPLAN_TO_ALL_PARTICIPANTVISITS]-(cp:CarePlan{tildaid:careplanId}) with case when pqn.editStatus = ? then {v: pqn.editValue, l: pqn.editValues} else {v: pqn.value, l: pqn.values} end as pqnAns with case when size(coalesce(pqnAns.l, [])) > ? and apoc.text.join(pqnAns.l, ?) = coalesce(pqnAns.v, ?) then pqnAns.l when coalesce(pqnAns.v, ?) = ? then [] else apoc.coll.toSet(split(pqnAns.v, ?) + [pqnAns.v]) end as pqnValues return distinct pqnValues as ans1 } call(careplanId, protocolId, pwId, pvId, paId, pqnrId, ptId, hdmClassId) { match(ref:GraphNodeRef{tildaid:?})-[rpq:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION] ->(qn:QuestionV2)-[:BELONGS_TO_QUESTION]-(pqn:ParticipantQuestion{carePlanId:careplanId, hdmClassId:hdmClassId})-[:PARTICIPANT_QUESTION]-(pt:ParticipantTable{tildaid:ptId}) with case when pqn.editStatus = ? then {v: pqn.editValue, l: pqn.editValues} else {v: pqn.value, l: pqn.values} end as pqnAns with case when size(coalesce(pqnAns.l, [])) > ? and apoc.text.join(pqnAns.l, ?) = coalesce(pqnAns.v, ?) then pqnAns.l when coalesce(pqnAns.v, ?) = ? then [] else apoc.coll.toSet(split(pqnAns.v, ?) + [pqnAns.v]) end as pqnValues return distinct pqnValues as ans2 } return ((( ans1[?] > ans2[?]) ))
execsvc
117 282 ms 775 ms 773 ms flat
MATCH (u:User) WHERE u.tildaid IN $userIds AND u.status<>?OPTIONAL MATCH (u)-[:INTERNAL_DATA]-(ui:UserInternal) WITH u, COALESCE(ui.pinHash IS NOT NULL AND ui.pinHash <> ?, false) AS pinSet, COALESCE(ui.needs2Factor, false) AS needs2Factor…
MATCH (u:User) WHERE u.tildaid IN $userIds AND u.status<>?OPTIONAL MATCH (u)-[:INTERNAL_DATA]-(ui:UserInternal) WITH u, COALESCE(ui.pinHash IS NOT NULL AND ui.pinHash <> ?, false) AS pinSet, COALESCE(ui.needs2Factor, false) AS needs2Factor WITH u, u{.*, pinSet: pinSet, needs2Factor: needs2Factor} as profile CALL { WITH u MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:ORGANIZATION_TO_ACTOR]-(o:Organization{tildaid:$orgId, delpending:false}) OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) WITH u, o, a, r order by r.displayName WITH u, o, a, apoc.text.join(collect(distinct r.name), ?) as roles, [r IN collect(DISTINCT r) WHERE r.listed = true | r.displayName] AS displayRoles RETURN collect({ orgName: o.name, orgAlias: o.alias, orgId: o.tildaid, orgType: o.orgType, status: o.status, startDate: a.startDate, endDate: a.endDate, capabilities: u.capabilities, role: roles, displayRoles: displayRoles, logoDocumentId: o.logoDocumentId, theme: o.theme, logoURL: o.logoURL, pinCheckEnabled: o.pinCheckEnabled }) AS organizations } CALL { WITH u MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false,orgId:$orgId})<-[:STUDY_TO_ACTOR]-(s:Study{delpending:false}) WITH DISTINCT s, a, u.capabilities AS caps CALL { WITH a OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) WITH r order by r.displayName RETURN apoc.text.join(collect(distinct r.name), ?) as roles, [r IN collect(DISTINCT r) WHERE r.listed = true | r.displayName] AS displayRoles } MATCH (s)-[:STUDY_TO_ORG]->(o:Organization{tildaid:$orgId, delpending:false}) // DISTINCT restores the dedup the old (u,o,s,a) grouping gave for free: two parallel // STUDY_TO_ORG edges would otherwise emit the study twice. The ORDER BY makes the // studies array a stable sequence for clients rather than a plan-dependent one. WITH DISTINCT s, a, caps, roles, displayRoles, o ORDER BY s.name, s.tildaid, o.tildaid RETURN collect({ orgName: o.name, orgAlias: o.alias, orgId: o.tildaid, studyName: s.name, studySponsor: s.sponsor, studyId: s.tildaid, startDate: a.startDate, endDate: a.endDate, capabilities: caps, iSBlinded: a.isBlinded, role: roles, displayRoles: displayRoles }) AS studies } CALL { WITH u MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:STAFF_TO_ACTOR]-(si:Site{delpending:false})-[:SITE_TO_SMO]->(:Smo)-[:IS_AN_ORG]->(o:Organization{tildaid:$orgId, delpending:false}) OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) WITH u, o, si, a, r order by r.displayName WITH u, o, si, a, apoc.text.join(collect(distinct r.name), ?) as roles, [r IN collect(DISTINCT r) WHERE r.listed = true | r.displayName] AS displayRoles RETURN collect({ orgName: o.name, orgAlias: o.alias, orgId: o.tildaid, siteId: si.tildaid, siteName: si.name, siteCity: si.city, contactPhone: si.contactPhone, contactEmail: si.contactEmail, defaultLanguage: si.defaultLanguage, role: roles, displayRoles: displayRoles }) as sites } return profile{.*, organizations: organizations, studies: studies, sites: sites}
tusker
30 198 ms 625 ms 943 ms 0.6× ↓
with $protocolId as protocolId, $careplanId as careplanId, $visitRefId as visitRefId, $activityRefId as activityRefId, $pvId as pvId, null as pwId, $paId as paId, $pqnrId as pqnrId, null as ptId, $hdmClassId as hdmClassId call(careplanId, …
with $protocolId as protocolId, $careplanId as careplanId, $visitRefId as visitRefId, $activityRefId as activityRefId, $pvId as pvId, null as pwId, $paId as paId, $pqnrId as pqnrId, null as ptId, $hdmClassId as hdmClassId call(careplanId, protocolId, pwId, pvId, paId, pqnrId, ptId, hdmClassId) { match(ref:GraphNodeRef{tildaid:?})-[rpq:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION] ->(qn:QuestionV2)-[:BELONGS_TO_QUESTION]-(pqn:ParticipantQuestion{carePlanId:careplanId, hdmClassId:hdmClassId})-[:PARTICIPANT_QUESTION]-(pqnr:ParticipantQuestionnaire{tildaid:pqnrId}) with case when pqn.editStatus = ? then {v: pqn.editValue, l: pqn.editValues} else {v: pqn.value, l: pqn.values} end as pqnAns with case when size(coalesce(pqnAns.l, [])) > ? and apoc.text.join(pqnAns.l, ?) = coalesce(pqnAns.v, ?) then pqnAns.l when coalesce(pqnAns.v, ?) = ? then [] else apoc.coll.toSet(split(pqnAns.v, ?) + [pqnAns.v]) end as pqnValues return distinct pqnValues as ans1 } call(careplanId, protocolId, pwId, pvId, paId, pqnrId, ptId, hdmClassId) { match(ref:GraphNodeRef{tildaid:?})-[rpq:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION] ->(qn:QuestionV2)-[:BELONGS_TO_QUESTION]-(pqn:ParticipantQuestion{carePlanId:careplanId, hdmClassId:hdmClassId})-[:PARTICIPANT_QUESTION]-(pqnr:ParticipantQuestionnaire{tildaid:pqnrId}) with case when pqn.editStatus = ? then {v: pqn.editValue, l: pqn.editValues} else {v: pqn.value, l: pqn.values} end as pqnAns with case when size(coalesce(pqnAns.l, [])) > ? and apoc.text.join(pqnAns.l, ?) = coalesce(pqnAns.v, ?) then pqnAns.l when coalesce(pqnAns.v, ?) = ? then [] else apoc.coll.toSet(split(pqnAns.v, ?) + [pqnAns.v]) end as pqnValues return distinct pqnValues as ans2 } call(careplanId, protocolId, pwId, pvId, paId, pqnrId, ptId, hdmClassId) { match(ref:GraphNodeRef{tildaid:?})-[rpq:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION] ->(qn:QuestionV2)-[:BELONGS_TO_QUESTION]-(pqn:ParticipantQuestion{carePlanId:careplanId, hdmClassId:hdmClassId})-[:PARTICIPANT_QUESTION]-(pqnr:ParticipantQuestionnaire{tildaid:pqnrId}) with case when pqn.editStatus = ? then {v: pqn.editValue, l: pqn.editValues} else {v: pqn.value, l: pqn.values} end as pqnAns with case when size(coalesce(pqnAns.l, [])) > ? and apoc.text.join(pqnAns.l, ?) = coalesce(pqnAns.v, ?) then pqnAns.l when coalesce(pqnAns.v, ?) = ? then [] else apoc.coll.toSet(split(pqnAns.v, ?) + [pqnAns.v]) end as pqnValues return distinct pqnValues as ans3 } call(careplanId, protocolId, pwId, pvId, paId, pqnrId, ptId, hdmClassId) { match(ref:GraphNodeRef{tildaid:?})-[rpq:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION] ->(qn:QuestionV2)-[:BELONGS_TO_QUESTION]-(pqn:ParticipantQuestion{carePlanId:careplanId, hdmClassId:hdmClassId})-[:PARTICIPANT_QUESTION]-(pqnr:ParticipantQuestionnaire{tildaid:pqnrId}) with case when pqn.editStatus = ? then {v: pqn.editValue, l: pqn.editValues} else {v: pqn.value, l: pqn.values} end as pqnAns with case when size(coalesce(pqnAns.l, [])) > ? and apoc.text.join(pqnAns.l, ?) = coalesce(pqnAns.v, ?) then pqnAns.l when coalesce(pqnAns.v, ?) = ? then [] else apoc.coll.toSet(split(pqnAns.v, ?) + [pqnAns.v]) end as pqnValues return distinct pqnValues as ans4 } call(careplanId, protocolId, pwId, pvId, paId, pqnrId, ptId, hdmClassId) { match(ref:GraphNodeRef{tildaid:?})-[rpq:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION] ->(qn:QuestionV2)-[:BELONGS_TO_QUESTION]-(pqn:ParticipantQuestion{carePlanId:careplanId, hdmClassId:hdmClassId})-[:PARTICIPANT_QUESTION]-(pqnr:ParticipantQuestionnaire{tildaid:pqnrId}) with case when pqn.editStatus = ? then {v: pqn.editValue, l: pqn.editValues} else {v: pqn.value, l: pqn.values} end as pqnAns with case when size(coalesce(pqnAns.l, [])) > ? and apoc.text.join(pqnAns.l, ?) = coalesce(pqnAns.v, ?) then pqnAns.l when coalesce(pqnAns.v, ?) = ? then [] else apoc.coll.toSet(split(pqnAns.v, ?) + [pqnAns.v]) end as pqnValues return distinct pqnValues as ans5 } call(careplanId, protocolId, pwId, pvId, paId, pqnrId, ptId, hdmClassId) { match(ref:GraphNodeRef{tildaid:?})-[rpq:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION] ->(qn:QuestionV2)-[:BELONGS_TO_QUESTION]-(pqn:ParticipantQuestion{carePlanId:careplanId, hdmClassId:hdmClassId})-[:PARTICIPANT_QUESTION]-(pqnr:ParticipantQuestionnaire{tildaid:pqnrId}) with case when pqn.editStatus = ? then {v: pqn.editValue, l: pqn.editValues} else {v: pqn.value, l: pqn.values} end as pqnAns with case when size(coalesce(pqnAns.l, [])) > ? and apoc.text.join(pqnAns.l, ?) = coalesce(pqnAns.v, ?) then pqnAns.l when coalesce(pqnAns.v, ?) = ? then [] else apoc.coll.toSet(split(pqnAns.v, ?) + [pqnAns.v]) end as pqnValues return distinct pqnValues as ans6 } call(careplanId, protocolId, pwId, pvId, paId, pqnrId, ptId, hdmClassId) { match(ref:GraphNodeRef{tildaid:?})-[rpq:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION] ->(qn:QuestionV2)-[:BELONGS_TO_QUESTION]-(pqn:ParticipantQuestion{carePlanId:careplanId, hdmClassId:hdmClassId})-[:PARTICIPANT_QUESTION]-(pqnr:ParticipantQuestionnaire{tildaid:pqnrId}) with case when pqn.editStatus = ? then {v: pqn.editValue, l: pqn.editValues} else {v: pqn.value, l: pqn.values} end as pqnAns with case when size(coalesce(pqnAns.l, [])) > ? and apoc.text.join(pqnAns.l, ?) = coalesce(pqnAns.v, ?) then pqnAns.l when coalesce(pqnAns.v, ?) = ? then [] else apoc.coll.toSet(split(pqnAns.v, ?) + [pqnAns.v]) end as pqnValues return distinct pqnValues as ans7 } call(careplanId, protocolId, pwId, pvId, paId, pqnrId, ptId, hdmClassId) { match(ref:GraphNodeRef{tildaid:?})-[rpq:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION] ->(qn:QuestionV2)-[:BELONGS_TO_QUESTION]-(pqn:ParticipantQuestion{carePlanId:careplanId, hdmClassId:hdmClassId})-[:PARTICIPANT_QUESTION]-(pqnr:ParticipantQuestionnaire{tildaid:pqnrId}) with case when pqn.editStatus = ? then {v: pqn.editValue, l: pqn.editValues} else {v: pqn.value, l: pqn.values} end as pqnAns with case when size(coalesce(pqnAns.l, [])) > ? and apoc.text.join(pqnAns.l, ?) = coalesce(pqnAns.v, ?) then pqnAns.l when coalesce(pqnAns.v, ?) = ? then [] else apoc.coll.toSet(split(pqnAns.v, ?) + [pqnAns.v]) end as pqnValues return distinct pqnValues as ans8 } call(careplanId, protocolId, pwId, pvId, paId, pqnrId, ptId, hdmClassId) { match(ref:GraphNodeRef{tildaid:?})-[rpq:GRAPH_NODE_REF_TO_GRAPH_NODE|GRAPH_NODE_REF_TO_QUESTION] ->(qn:QuestionV2)-[:BELONGS_TO_QUESTION]-(pqn:ParticipantQuestion{carePlanId:careplanId, hdmClassId:hdmClassId})-[:PARTICIPANT_QUESTION]-(pqnr:ParticipantQuestionnaire{tildaid:pqnrId}) with case when pqn.editStatus = ? then {v: pqn.editValue, l: pqn.editValues} else {v: pqn.value, l: pqn.values} end as pqnAns with case when size(coalesce(pqnAns.l, [])) > ? and apoc.text.join(pqnAns.l, ?) = coalesce(pqnAns.v, ?) then pqnAns.l when coalesce(pqnAns.v, ?) = ? then [] else apoc.coll.toSet(split(pqnAns.v, ?) + [pqnAns.v]) end as pqnValues return distinct pqnValues as ans9 } return ((( size(apoc.coll.intersection(apoc.coll.sort([?]), apoc.coll.sort(ans1))) = ?) or ( size(apoc.coll.intersection(apoc.coll.sort([?]), apoc.coll.sort(ans2))) = ?) or ( size(apoc.coll.intersection(apoc.coll.sort([?]), apoc.coll.sort(ans3))) = ?) or ( size(apoc.coll.intersection(apoc.coll.sort([?]), apoc.coll.sort(ans4))) = ?) or ( size(apoc.coll.intersection(apoc.coll.sort([?]), apoc.coll.sort(ans5))) = ?) or ( size(apoc.coll.intersection(apoc.coll.sort([?]), apoc.coll.sort(ans6))) = ?) or ( size(apoc.coll.intersection(apoc.coll.sort([?]), apoc.coll.sort(ans7))) = ?) or ( size(apoc.coll.intersection(apoc.coll.sort([?]), apoc.coll.sort(ans8))) = ?) or ( size(apoc.coll.intersection(apoc.coll.sort([?]), apoc.coll.sort(ans9))) = ?)))
execsvc
1 206 ms 485 ms 206 ms flat
MATCH (org:Organization {tildaid:$orgId})-[:STUDY_TO_ORG]-(st:Study {tildaid:$studyId}) call (org,st) { match (org)-[:STUDY_TO_ORG]-(st)-[:PLAN_DEFINITION_TO_STUDY]- (pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) where (org.…
MATCH (org:Organization {tildaid:$orgId})-[:STUDY_TO_ORG]-(st:Study {tildaid:$studyId}) call (org,st) { match (org)-[:STUDY_TO_ORG]-(st)-[:PLAN_DEFINITION_TO_STUDY]- (pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) where (org.orgType=? or org.orgType=?) and pd.delpending=false return pd, site union match (org)-[:IS_AN_ORG]-(:Smo)-[:SITE_TO_SMO]-(site:Site)-[:PLAN_DEFINITION_TO_SITE]- (pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_STUDY]-(st) where pd.delpending=false return pd,site } WITH pd, site AS s MATCH (pd)-[:SOA_TO_PLAN_DEFINITION]-(soa:ScheduleOfActivities)-[:EXECUTE_SOA]- (cp:CarePlan)-[:RESEARCH_SUBJECT]-(p:Patient) // Path ?: via Questionnaire MATCH (cp)-[:CAREPLAN_TO_ALL_PARTICIPANTVISITS]->(pv:ParticipantVisit) MATCH (pa1:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]-(pv) OPTIONAL MATCH (q1:Query)-[:HAS_QUERY]-(pqn1:ParticipantQuestion) -[:PARTICIPANT_QUESTION]-(pqnr1:ParticipantQuestionnaire) -[:PARTICIPANT_QUESTIONNAIRE]-(pa1) WHERE (q1.delpending IS NULL OR q1.delpending = false) AND q1.state <> ? AND coalesce(q1.supersededAt, ?) = ? // Path ?: via ParticipantTable → Questionnaire OPTIONAL MATCH (q2:Query)-[:HAS_QUERY]-(pqn2:ParticipantQuestion) -[:PARTICIPANT_QUESTION]-(:ParticipantTable) -[:PARTICIPANT_TABLE]-(pqnr2:ParticipantQuestionnaire) -[:PARTICIPANT_QUESTIONNAIRE]-(pa1) WHERE (q2.delpending IS NULL OR q2.delpending = false) AND q2.state <> ? AND coalesce(q2.supersededAt, ?) = ? // Path ?: via Document OPTIONAL MATCH (pv)-[:BELONGS_TO_VISIT]-(v:Visit|VisitV2) -[:BINDER_FOR]-(b:Binder)-[:INCLUDES]-(doc:Document{patientId:p.tildaid}) OPTIONAL MATCH (q3:Query)-[:HAS_QUERY]-(doc) WHERE (q3.delpending IS NULL OR q3.delpending = false) AND q3.state <> ? AND coalesce(q3.supersededAt, ?) = ? WITH pv, cp, collect(DISTINCT q1) + collect(DISTINCT q2) + collect(DISTINCT q3) AS allQueries RETURN cp.tildaid AS carePlanId, pv.tildaid AS participantVisitId, size(allQueries) AS queryCount, size([q IN allQueries WHERE q.state = ?]) AS openCount, size([q IN allQueries WHERE q.state <> ? AND q.state <> ?]) AS answeredCount
execsvc
1 347 ms 485 ms 347 ms flat
MATCH (ssa:StudySiteActor {delpending:false}) WHERE ssa.deltimestamp IS NULL SET ssa.deltimestamp = ?
MATCH (ssa:StudySiteActor {delpending:false}) WHERE ssa.deltimestamp IS NULL SET ssa.deltimestamp = ?
write execsvc
1 297 ms 485 ms 297 ms flat
MATCH (wp:WorkPlanInstance {hasActivationFailedItem: true})<-[:WORKPLAN_CFG_TO_INSTANCE]-(cfg:WorkplanCfg) WHERE true OPTIONAL MATCH (wp)-[:WORKPLAN_INSTANCE_TO_MILESTONE]->(:WorkPlanMilestone)-[:REL_WORKPLAN_INSTANCE_MILESTONE_TO_ITEM]->(…
MATCH (wp:WorkPlanInstance {hasActivationFailedItem: true})<-[:WORKPLAN_CFG_TO_INSTANCE]-(cfg:WorkplanCfg) WHERE true OPTIONAL MATCH (wp)-[:WORKPLAN_INSTANCE_TO_MILESTONE]->(:WorkPlanMilestone)-[:REL_WORKPLAN_INSTANCE_MILESTONE_TO_ITEM]->(failed:WorkplanInstanceMilestoneItem) WHERE coalesce(failed.workOrderActivationFailedAt, ?) > ? WITH wp, count(failed) AS failedCount WHERE failedCount = ? SET wp.hasActivationFailedItem = false RETURN count(wp) AS cleared
write workplansvc
1 281 ms 485 ms 281 ms flat
MATCH (d:DocumentVersion) WHERE (NOT d.translatedPdfUrl IS NULL AND d.translatedPdfUrl <> ?) SET d.translatedPdfUrl = replace(d.translatedPdfUrl, ?, ?)
MATCH (d:DocumentVersion) WHERE (NOT d.translatedPdfUrl IS NULL AND d.translatedPdfUrl <> ?) SET d.translatedPdfUrl = replace(d.translatedPdfUrl, ?, ?)
write (internal)
1 386 ms 485 ms 386 ms flat
match (p:Phi)-[:HAS_PROTECTED_DATA_IN]-(pa:Patient)-[:RESEARCH_SUBJECT]-(cp:CarePlan) -[:VISIT_APPOINTMENT_TO_CARE_PLAN]-(v:VisitAppointment)-[:W2026_46 | W2026_47]-(s:Site{delpending:false})-[:SITE_TO_SMO]->(:Smo)-[:IS_AN_ORG]-(o:Organiza…
match (p:Phi)-[:HAS_PROTECTED_DATA_IN]-(pa:Patient)-[:RESEARCH_SUBJECT]-(cp:CarePlan) -[:VISIT_APPOINTMENT_TO_CARE_PLAN]-(v:VisitAppointment)-[:W2026_46 | W2026_47]-(s:Site{delpending:false})-[:SITE_TO_SMO]->(:Smo)-[:IS_AN_ORG]-(o:Organization{alias:$orgAlias}) match (v)-[:BELONGS_TO_PARTICIPANT_VISIT|OLD_APPT_BELONGS_TO_PARTICIPANT_VISIT]-(pv:ParticipantVisit) optional match(v)-[:VISIT_APPOINTMENT_TO_CONFERENCE_DATA]-(c:ConferenceData) return v,p,c,pv,s.tildaid,cp.subjectid,cp.status
schedsvc
1 332 ms 485 ms 332 ms flat
CALL () { MATCH (:AutoQueryConfig)<-[:BELONGS_TO]-(:Query)<-[:WITH_CONTEXT]-(t:Task) RETURN collect(DISTINCT t.category) AS aqTaskCategories, count(DISTINCT CASE WHEN t.category <> ? AND EXISTS { (t)-[:CREATED_BY]->(:User) } THEN t END) AS…
CALL () { MATCH (:AutoQueryConfig)<-[:BELONGS_TO]-(:Query)<-[:WITH_CONTEXT]-(t:Task) RETURN collect(DISTINCT t.category) AS aqTaskCategories, count(DISTINCT CASE WHEN t.category <> ? AND EXISTS { (t)-[:CREATED_BY]->(:User) } THEN t END) AS otherCatWithCreator } CALL () { MATCH (q:Query)-[:BELONGS_TO]->(:AutoQueryConfig) WHERE EXISTS { (q)-[:RAISED_BY]-(:User) } RETURN count(q) AS aqWithRaisedBy } CALL () { MATCH (q:Query) WHERE NOT EXISTS { (q)-[:BELONGS_TO]->(:AutoQueryConfig) } AND NOT EXISTS { (q)-[:RAISED_BY]-(:User) } RETURN coalesce(q.origin,?) AS origin, count(q) AS noCreator, count(CASE WHEN coalesce(q.who,?) = ? THEN ? END) AS whoEmpty ORDER BY origin } RETURN aqTaskCategories, otherCatWithCreator, aqWithRaisedBy, collect([origin, noCreator, whoEmpty]) AS nonAutoNoCreator
(internal)
1 236 ms 485 ms 236 ms flat
CALL () { MATCH (:CarePlan {tildaid:?})-[:CAREPLAN_TO_ALL_PARTICIPANTVISITS]->(:ParticipantVisit)-[:PARTICIPANT_ACTIVITY]->(pa:ParticipantActivity)-[:PARTICIPANT_QUESTIONNAIRE]->(:ParticipantQuestionnaire)-[:PARTICIPANT_QUESTION]->(pq:Part…
CALL () { MATCH (:CarePlan {tildaid:?})-[:CAREPLAN_TO_ALL_PARTICIPANTVISITS]->(:ParticipantVisit)-[:PARTICIPANT_ACTIVITY]->(pa:ParticipantActivity)-[:PARTICIPANT_QUESTIONNAIRE]->(:ParticipantQuestionnaire)-[:PARTICIPANT_QUESTION]->(pq:ParticipantQuestion) WHERE pq.updatedat >= ? OR pa.updatedat >= ? RETURN count(*) AS changedSinceDeploy } CALL () { MATCH (q:Query) WHERE q.createdat >= ? RETURN count(q) AS queriesSinceDeploy } RETURN changedSinceDeploy, queriesSinceDeploy
(internal)
1 272 ms 485 ms 272 ms flat
MATCH (aqc:AutoQueryConfig)<-[:BELONGS_TO]-(:Query {careplanId:?})<-[:HAS_QUERY]-(pq0:ParticipantQuestion) WITH DISTINCT aqc.name AS check, pq0.questionId AS qid MATCH (:CarePlan {tildaid:?})-[:CAREPLAN_TO_ALL_PARTICIPANTVISITS]->(pv:Parti…
MATCH (aqc:AutoQueryConfig)<-[:BELONGS_TO]-(:Query {careplanId:?})<-[:HAS_QUERY]-(pq0:ParticipantQuestion) WITH DISTINCT aqc.name AS check, pq0.questionId AS qid MATCH (:CarePlan {tildaid:?})-[:CAREPLAN_TO_ALL_PARTICIPANTVISITS]->(pv:ParticipantVisit)-[:PARTICIPANT_ACTIVITY]->(pa:ParticipantActivity)-[:PARTICIPANT_QUESTIONNAIRE]->(:ParticipantQuestionnaire)-[:PARTICIPANT_QUESTION]->(pq:ParticipantQuestion {questionId: qid}) WHERE NOT EXISTS { (pq)-[:HAS_QUERY]-(q:Query) WHERE NOT q.state IN [?,?] AND coalesce(q.delpending,false) = false } OPTIONAL MATCH (pv)-[:BELONGS_TO_VISIT]->(v) RETURN v.title AS visit, pv.status AS pvStatus, pa.status AS paStatus, pa.editStatus AS edit, pq.value AS value, pq.status AS pqStatus, check ORDER BY visit LIMIT ?
write (internal)
1 299 ms 485 ms 299 ms flat
MATCH (d:Document) WHERE d.displayId IS NULL RETURN DISTINCT d.ownerOrgId
MATCH (d:Document) WHERE d.displayId IS NULL RETURN DISTINCT d.ownerOrgId
docsvc
1 208 ms 485 ms 208 ms flat
MATCH (st:Study{tildaid:$studyId})-[:STUDY_TO_ACTOR]-(a:Actor{tildaid:$actorId})-[:STUDYSITEACTOR_TO_ACTOR]-(studySiteActor:StudySiteActor)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]-(pd:DslPlanDefinition{type:?}) MATCH (studySiteActor)-[:STUDYS…
MATCH (st:Study{tildaid:$studyId})-[:STUDY_TO_ACTOR]-(a:Actor{tildaid:$actorId})-[:STUDYSITEACTOR_TO_ACTOR]-(studySiteActor:StudySiteActor)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]-(pd:DslPlanDefinition{type:?}) MATCH (studySiteActor)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]-(duty:StudySiteDuty) MATCH (pd)-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]->(:WorkflowV2)<-[:TRIGGER_TO_WORKFLOW]-(:Trigger{scope:?}) MATCH (pd)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) RETURN distinct site.tildaid, studySiteActor.tildaid
regsvc
1 341 ms 485 ms 341 ms flat
MATCH (q:Query)-[:BELONGS_TO]->(aqc:AutoQueryConfig) WHERE q.createdat >= ? OPTIONAL MATCH (q)-[:RAISED_BY]->(ru:User) OPTIONAL MATCH (q)<-[:HAS_QUERY]-(pq:ParticipantQuestion) OPTIONAL MATCH (q)<-[:WITH_CONTEXT]-(t:Task) OPTIONAL MATCH (t…
MATCH (q:Query)-[:BELONGS_TO]->(aqc:AutoQueryConfig) WHERE q.createdat >= ? OPTIONAL MATCH (q)-[:RAISED_BY]->(ru:User) OPTIONAL MATCH (q)<-[:HAS_QUERY]-(pq:ParticipantQuestion) OPTIONAL MATCH (q)<-[:WITH_CONTEXT]-(t:Task) OPTIONAL MATCH (t)-[:CREATED_BY]->(tu:User) CALL (t) { OPTIONAL MATCH (t)-[:ALL_CHANGELOG]-(cl:ChangeLog) WITH cl ORDER BY cl.createdat RETURN collect([cl.reason, cl.who, cl.actorType, cl.changedBy]) AS history } RETURN q.tildaid AS query, aqc.name AS check, q.who AS who, datetime({epochMillis: q.createdat}) AS created, ru.name AS raisedBy, pq.hdmClassId AS row, t.tildaid AS task, tu.name AS taskCreator, history ORDER BY created
(internal)
1 208 ms 485 ms 208 ms flat
MATCH (cp:CarePlan {tildaid:?})-[:PARTICIPANT_ACTIVITY]->(pa:ParticipantActivity)-[:BELONGS_TO_ACTIVITY]->(a:ActivityV2) MATCH (pa)-[:PARTICIPANT_QUESTIONNAIRE]->(:ParticipantQuestionnaire)-[:PARTICIPANT_TABLE]->(:ParticipantTable)-[:PARTI…
MATCH (cp:CarePlan {tildaid:?})-[:PARTICIPANT_ACTIVITY]->(pa:ParticipantActivity)-[:BELONGS_TO_ACTIVITY]->(a:ActivityV2) MATCH (pa)-[:PARTICIPANT_QUESTIONNAIRE]->(:ParticipantQuestionnaire)-[:PARTICIPANT_TABLE]->(:ParticipantTable)-[:PARTICIPANT_QUESTION]->(pq:ParticipantQuestion)-[:HAS_QUERY]-(q:Query)-[:BELONGS_TO]->(aqc:AutoQueryConfig) WHERE pq.hdmClassId <> ? RETURN a.title AS form, pa.status AS paStatus, aqc.name AS check, aqc.description AS rule, pq.questionId AS qid, pq.hdmClassId AS row, pq.value AS value, q.state AS state, datetime({epochMillis: q.createdat}) AS raised ORDER BY form, check LIMIT ?
(internal)
1 374 ms 485 ms 374 ms flat
MATCH (q:Query)-[:BELONGS_TO]->(aqc:AutoQueryConfig) WHERE coalesce(q.hdmClassId,?) <> ? MATCH (q)<-[:HAS_QUERY]-(pq:ParticipantQuestion)<-[:PARTICIPANT_QUESTION]-(:ParticipantTable)<-[:PARTICIPANT_TABLE]-(:ParticipantQuestionnaire)<-[:PAR…
MATCH (q:Query)-[:BELONGS_TO]->(aqc:AutoQueryConfig) WHERE coalesce(q.hdmClassId,?) <> ? MATCH (q)<-[:HAS_QUERY]-(pq:ParticipantQuestion)<-[:PARTICIPANT_QUESTION]-(:ParticipantTable)<-[:PARTICIPANT_TABLE]-(:ParticipantQuestionnaire)<-[:PARTICIPANT_QUESTIONNAIRE]-(pa:ParticipantActivity)-[:BELONGS_TO_ACTIVITY]->(a:ActivityV2) RETURN a.title AS form, aqc.name AS check, count(q) AS raised, count(DISTINCT q.careplanId) AS subjects, max(datetime({epochMillis: q.createdat})) AS lastRaised, collect(DISTINCT q.careplanId)[?..?] AS sampleCareplans ORDER BY raised DESC LIMIT ?
(internal)
1 275 ms 485 ms 275 ms flat
MATCH (pt:ParticipantTable {tildaid: $pt_id})-[:PARTICIPANT_QUESTION|PARTICIPANT_DOC_UPLOAD]-(pobj) WHERE pobj.hdmClassId = $hdm_class_id AND (pobj.delpending IS NULL OR pobj.delpending <> true) OPTIONAL MATCH (pobj)-[:ALL_CHANGELOG]-(clog…
MATCH (pt:ParticipantTable {tildaid: $pt_id})-[:PARTICIPANT_QUESTION|PARTICIPANT_DOC_UPLOAD]-(pobj) WHERE pobj.hdmClassId = $hdm_class_id AND (pobj.delpending IS NULL OR pobj.delpending <> true) OPTIONAL MATCH (pobj)-[:ALL_CHANGELOG]-(clog:ChangeLog) WHERE clog.type IN $changelog_types WITH pobj, count(clog) AS clogCount OPTIONAL MATCH (pobj)-[:HAS_QUERY]-(qr:Query) WHERE qr.delpending = false WITH pobj, clogCount, count(qr) AS queryCount OPTIONAL MATCH (pobj)-[:BELONGS_TO]-(doc:Document {archived: false}) OPTIONAL MATCH (doc)-[:TAIL_CHANGELOG]-(docCL:ChangeLog) OPTIONAL MATCH (doc)-[:HAS_QUERY]-(dq:Query) WHERE NOT dq.state IN [?] WITH DISTINCT pobj, clogCount, queryCount, doc, docCL, count(dq) AS docQueryCount WITH pobj, clogCount, queryCount, collect(DISTINCT CASE WHEN doc IS NOT NULL THEN { id: doc.tildaid, docKind: doc.docKind, versionNumber: doc.versionNumber, fileName: doc.fileName, uploadedBy: docCL.who, uploadedAt: docCL.createdat, size: doc.size, status: doc.status, pages: doc.pages, docType: doc.docTypeName, contentType: doc.contentType, queryCount: docQueryCount } END) AS documents OPTIONAL MATCH (q:QuestionV2 {tildaid: pobj.questionId}) OPTIONAL MATCH (q)-[:QUESTION_TO_QUESTION_SPEC]->(qs:QuestionSpec) OPTIONAL MATCH (qs)-[:QUESTION_SPEC_TO_RESPONSE_SET]->(rs:ResponseSet) RETURN pobj, clogCount, queryCount, documents, q, qs, rs
write exportsvc
1 260 ms 485 ms 260 ms flat
MATCH (study:Study {tildaid:$studyId}) MATCH (site:Site) WHERE site.tildaid IN $siteIds AND NOT (study)-[:BUDGET_TO_STUDY]-(:Budget)-[:BUDGET_TO_SITE]-(site) RETURN DISTINCT site
MATCH (study:Study {tildaid:$studyId}) MATCH (site:Site) WHERE site.tildaid IN $siteIds AND NOT (study)-[:BUDGET_TO_STUDY]-(:Budget)-[:BUDGET_TO_SITE]-(site) RETURN DISTINCT site
finsvc
1 266 ms 485 ms 266 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).