-
-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEATURE: Speedup content cache flush by using cte in findAncestorNodeAggregateIds
#5261
base: 9.0
Are you sure you want to change the base?
Conversation
...res/ProjectionIntegrityViolationDetection/AllNodesAreConnectedToARootNodePerSubgraph.feature
Outdated
Show resolved
Hide resolved
@@ -188,6 +189,19 @@ public function findParentNodeAggregates( | |||
return $this->mapQueryBuilderToNodeAggregates($queryBuilder); | |||
} | |||
|
|||
public function findAncestorNodeAggregateIds(NodeAggregateId $entryNodeAggregateId): NodeAggregateIds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far a I understood, this function needs to be more complex and return a set of pathways with ancestor nodes.
https://neos-project.slack.com/archives/C04PYL8H3/p1725605274115779?thread_ts=1725460465.658809&cid=C04PYL8H3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm but to get that right, does that mean that if implemented more complex also other node ids will be returned or just that all the node ids will be nicely ordered by dimension in a special value object. The latter i consider just an improvement and not critical. The idea is to improve the performance of the method via native sql at first. Its marked as @internal
so we can improve the structure later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the node ids will be nicely ordered by dimension in a special value object
Yes this one
Hmm but to get that right, does that mean that if implemented more complex also other node ids will be returned or just that all the node ids will be nicely ordered by dimension in a special value object. The latter i consider just an improvement and not critical. The idea is to improve the performance of the method via native sql at first. Its marked as @internal so we can improve the structure later?
But you don't improve that with this PR.
And even if it is marked as internal, i think we shouldn't put that into an interface if we already know, that we will change that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But you don't improve that with this PR.
i could try to do that ... emphasis on try :D or ask bernhard. But i get your point. Lets see how we can continue.
cc @nezaniel @bwaidelich @kitsunet
edit: and we def need behat tests for the method i forgot :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added behat tests and introduced cte query to improve performance. Its now ordered desc by the parentnodeanchor
findAncestorNodeAggregateIds
In the case of the content cache flusher we do not care about the order and ordering it by parentnodeanchor and position (for siblings) is slower and not even correct in all situations as the parentnodeanchor is just an autoincrement without meaning.
Followup to #5221
ContentGraph::findParentNodeAggregates
becomes slower on bigger datasets. Due to the mass on executions on acr:replay
, this sums up very quickly. Via #5268 the query will be improved but this pr introducesContentGraph::findAncestorNodeAggregateIds
to make this operation as performant as possible.Adds comment for
CacheFlushingStrategy
strategiesIntroduces
ContentGraphInterface::findAncestorNodeAggregateIds
using native sql cte to speedup cache flushing. (see comment)Move test which creates illegal state to content graph package and use native sql to create the state to not run any catchup hooks. Previously we needed to handle the case of infinite loops to not crash:
fixes a bug where you cannot replay because the workspace is "missing" and no content graph exists
Upgrade instructions
Review instructions
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions