Skip to content

Conversation

@nezaniel
Copy link
Member

This significantly improves (back)reference query performance
(in a 25k node project from >200ms to <2ms for a query fetching 8 nodes by reference)

Upgrade instructions

./flow cr:setup

Review instructions

mainly the query tweaks are interesting

Checklist

  • Code follows the PSR-12 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the 9.0 branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

@bwaidelich
Copy link
Member

Amazing numbers, thanks for taking care!

It's obviously quite hard to reason about this, but I don't see anything weird at first glance and I would say: Tests should(tm) cover that the behavior didn't change


return $table
->setPrimaryKey(['name', 'position', 'nodeanchorpoint']);
->setPrimaryKey(['name', 'position', 'nodeanchorpoint'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the first change after the release of Neos 9.0 to bring a schema adjustment which as you said must be executed via ./flow cr:setup

we must explicitly denote that in the release notes as new users will not be aware of this additional set of migrations (aside from doctrine migrate)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep; Technically it does not have to be executed, but the speedup does not happen without it.

];
$subtreeTagConstraints = '';
$i = 0;
foreach ($this->visibilityConstraints->excludedSubtreeTags as $excludedTag) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isnt there the method addSubtreeTagConstraints which we still use below?

but for a proper review i would need to dig into this deeply

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep; needed to copy it though, since the query builder has no support (that I know of) for subselects.

@mhsdesign mhsdesign requested a review from dlubitz September 30, 2025 08:40
Copy link
Member

@skurfuerst skurfuerst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as @bwaidelich , makes sense :). I did not check the queries in 110% detail, but trust our tests.

@nezaniel nezaniel merged commit 3921a91 into neos:9.0 Oct 24, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants