From 0baecc233be4cb0a0a4af240540433e7b42cd699 Mon Sep 17 00:00:00 2001 From: Denny Lubitz Date: Fri, 16 Aug 2024 13:52:25 +0200 Subject: [PATCH] BUGFIX: Optimize queries for subtree tags and reduce subset in CTE by contenStreamId and dimensionSpacepointHash --- .../src/Domain/Projection/Feature/SubtreeTagging.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/SubtreeTagging.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/SubtreeTagging.php index 251b4d160d2..8a04dd2fa37 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/SubtreeTagging.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/SubtreeTagging.php @@ -43,6 +43,8 @@ private function addSubtreeTag(ContentStreamId $contentStreamId, NodeAggregateId FROM cte JOIN {$this->tableNames->hierarchyRelation()} dh ON dh.parentnodeanchor = cte.id + AND dh.contentstreamid = :contentStreamId + AND dh.dimensionspacepointhash in (:dimensionSpacePointHashes) WHERE NOT JSON_CONTAINS_PATH(dh.subtreetags, 'one', :tagPath) ) @@ -119,7 +121,9 @@ private function removeSubtreeTag(ContentStreamId $contentStreamId, NodeAggregat dh.childnodeanchor FROM cte - JOIN {$this->tableNames->hierarchyRelation()} dh ON dh.parentnodeanchor = cte.id + JOIN {$this->tableNames->hierarchyRelation()} dh ON dh.parentnodeanchor = cte.id + AND dh.contentstreamid = :contentStreamId + AND dh.dimensionspacepointhash in (:dimensionSpacePointHashes) WHERE JSON_EXTRACT(dh.subtreetags, :tagPath) != TRUE )