You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the case of a large table (hundreds of thousands of records) with an index that includes the field to be sorted, it can be about 10 times more efficient to issue a query of the form select(n.'.$config['position'].')') with an added sorting like ORDER BY n.'.$config['position'].' DESC LIMIT 1)').
Given the class is final, it is very complicated to include a change downstream to allow us to use this second method.
I would like to humbly request a feature that allows me to configure (maybe through the Gedmo annotations) this query to use the ORDER BY form rather than the MAX() form.
This already seems to be the case by default in ODM.php, but I'm not very familiar with the non-relational query builder.
In the following code, obtaining the maximum value for a field uses a query in the
select('MAX(n.'.$config['position'].')')
form.https://github.com/doctrine-extensions/DoctrineExtensions/blob/5d80d9d348e0384f0b0d2096bdd7c4a07009a866/src/Sortable/Mapping/Event/Adapter/ORM.php#L40C1-L41C51
In the case of a large table (hundreds of thousands of records) with an index that includes the field to be sorted, it can be about 10 times more efficient to issue a query of the form
select(n.'.$config['position'].')')
with an added sorting likeORDER BY n.'.$config['position'].' DESC LIMIT 1)')
.Given the class is
final
, it is very complicated to include a change downstream to allow us to use this second method.I would like to humbly request a feature that allows me to configure (maybe through the Gedmo annotations) this query to use the ORDER BY form rather than the MAX() form.
This already seems to be the case by default in ODM.php, but I'm not very familiar with the non-relational query builder.
DoctrineExtensions/src/Sortable/Mapping/Event/Adapter/ODM.php
Line 44 in 5d80d9d
The text was updated successfully, but these errors were encountered: