Query support for BETWEEN
I would like to introduce the between-operator into the query class. This would allow shorter queries, and maybe a better performance for queries currently relying on two conditions.
So instead of
$query->logicalAnd( $query->greaterThanOrEqual($propertyName, $operand), $query->lessThanOrEqual($propertyName, $operand) );
One could simply write
$query->logicalAnd( $query->between($propertyName, $minOperand, $maxOperand) );
What do you think?
[FEATURE] Extbase: Add between() operator to Query object
Support for ``between`` has been added to the Extbase Query object.
As there is no performance advantage to using BETWEEN on the DBMS
side (the query optimizers converts it to `min <= expr AND expr <= max)`
this method replicates the DBMS behaviour by building a logical AND
condition that has the advantage of working on all DBMS.
Reviewed-by: Georg Ringer <firstname.lastname@example.org>
Tested-by: Georg Ringer <email@example.com>
Reviewed-by: Markus Klein <firstname.lastname@example.org>
Tested-by: Markus Klein <email@example.com>
#1 Updated by Alexander Schnitzler over 7 years ago
- Status changed from New to Needs Feedback
I just googled a bit and it seems there's no real difference in performance using between, in or "> <". So I think the underlying sql does not have to be adjusted but for sure the between constraint is a nice shortcut.
Unfortunetly I did not find the support in Flow so I will pass this on to my team mates to decide.
#4 Updated by Alexander Opitz about 6 years ago
- Project changed from Extbase MVC Framework to TYPO3 Core
- Category changed from Extbase: Generic Persistence to Extbase
- Assignee changed from Tymoteusz Motylewski to Xavier Perseguers
- Target version changed from Extbase 6.3 to 7.0
it seams the question about "between" was for you.