Skip to content

Commit

Permalink
Merge pull request #3230 from acrobat/revert-mysql-groupby-change
Browse files Browse the repository at this point in the history
[NodeBundle] Revert mysql groupby query change because of performance issues
  • Loading branch information
acrobat authored Dec 13, 2022
2 parents 83fe438 + 005794e commit 116f67b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Kunstmaan/NodeBundle/Repository/NodeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,13 @@ public function getAllMenuNodes(
->where('n.deleted = false')
->addGroupBy('n.id');

$qb->addGroupBy('t.url')
->addGroupby('t.id')
->addGroupby('v.weight')
->addGroupBy('v.title')
->distinct();
if ($databasePlatformName === 'postgresql') {
$qb->addGroupBy('t.url')
->addGroupby('t.id')
->addGroupby('v.weight')
->addGroupBy('v.title')
->distinct();
}

$qb->addOrderBy('weight', 'ASC')
->addOrderBy('title', 'ASC');
Expand Down

0 comments on commit 116f67b

Please sign in to comment.