-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Conversation
...res/ProjectionIntegrityViolationDetection/AllNodesAreConnectedToARootNodePerSubgraph.feature
Outdated
Show resolved
Hide resolved
Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php
Show resolved
Hide resolved
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.
Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php
Outdated
Show resolved
Hide resolved
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.
minimal naming stuff, looks fine otherwise (and is a lot faster in the non-trivial test cases)
Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php
Outdated
Show resolved
Hide resolved
Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php
Outdated
Show resolved
Hide resolved
Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php
Outdated
Show resolved
Hide resolved
Looks fine to me by reading. I left two comments. |
`cn` should actually be named `ch` as it's joined as the child hierarchy relation
3a6a28f
to
2dbd3a0
Compare
The query could be optimized a bit more (at least for deeper trees), if we join the node table only after we built the hierarchy. Co-authored-by: Denny Lubitz <[email protected]>
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.
+1 by reading, thanks!
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