Skip to content

Commit

Permalink
Merge pull request #5211 from neos/bugfix/subtree-tags-optimize-query
Browse files Browse the repository at this point in the history
BUGFIX: Optimize queries for subtree tags
  • Loading branch information
nezaniel authored Aug 16, 2024
2 parents 33fa7b0 + 0baecc2 commit e11f7b4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down Expand Up @@ -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
)
Expand Down

0 comments on commit e11f7b4

Please sign in to comment.