-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add indexes to improve performance of some queries #226
Add indexes to improve performance of some queries #226
Conversation
9fd9a4a
to
639c29c
Compare
@@ -460,7 +459,6 @@ protected function createEntityIdsQueryBuilder(string $locale): QueryBuilder | |||
|
|||
return $this->entityManager->createQueryBuilder() | |||
->select(self::CONTENT_RICH_ENTITY_ALIAS . '.' . $this->getEntityIdentifierFieldName() . ' as id') | |||
->distinct() |
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.
This hurts the performance a lot but is not necessary. All joins of filters should be created the way that no distinct is required here else we will run into a lot of performance issues.
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.
We should in future have a look at the queries that we not longer have todo distinct
as it seems have bad effects on this kind of queries. See #227
@@ -402,6 +401,8 @@ protected function setSortByJoins(QueryBuilder $queryBuilder): array | |||
*/ | |||
protected function appendRelation(QueryBuilder $queryBuilder, string $relation, array $values, string $operator, string $alias): array | |||
{ | |||
$queryBuilder->distinct(); // TODO remove distinct and replace joins with subselect filter see: https://github.com/sulu/SuluContentBundle/pull/226 |
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.
created an issue for this. here some improvements could be made: #227
a529d42
to
d0eefbd
Compare
Pull Request Test Coverage Report for Build 3177569846
💛 - Coveralls |
While having a look at our projects recipe bundle. I got hit by very slow queries.
Before: ~2023 ms
After: ~20ms (without filters, with tag or category filters ~1300ms see #227 for more improvements)