Skip to content

Commit

Permalink
BUGFIX: Optimize queries for subtree tags and reduce subset in CTE by…
Browse files Browse the repository at this point in the history
… contenStreamId and dimensionSpacepointHash
  • Loading branch information
dlubitz committed Aug 16, 2024
1 parent b2d5f28 commit 0baecc2
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 0baecc2

Please sign in to comment.