I wrote this small patch to allow such thing with a simple:
$query->selectKeyword('STRAIGHT_JOIN');
So that the final query looks like:
SELECT STRAIGHT_JOIN foo.a (...)
I wrote this small patch to allow such thing with a simple:
$query->selectKeyword('STRAIGHT_JOIN');
So that the final query looks like:
SELECT STRAIGHT_JOIN foo.a (...)
Comments
Comment #1
regilero commentedHere's the patch
Comment #2
regilero commentedComment #3
regilero commentedOups, there was a mistake on that patch.
Comment #4
nagba commented1) coding style issues
1a) i see two lines with trailing whitespaces, kill them please
1b) when there are items separated with comma there needs to be a space after the comma
1c) foreach is not a function, there needs to be a space between the keyword and the opening parenthese
1d) '} else {' should be 2 lines
1e) Doxygen sentences should end with a period.
2) correct me if im wrong but the examples you've brought are mostly specific to MySQL, in which case it might make more sense to reimplement the given function for MySQL instead adding this for every DB
3) if we'd allow STRAIGHT_JOIN then it would make sense to allow that for individual JOINs as well, not just as a SELECT directive
Comment #5
nagba commentedhow about this version ?
Comment #6
regilero commented@nagba: feel free to fix formatting problems. Now effectivily theses optimisations keywords are MySQL only. A better solution is maybe a general method, dropping the keywords. Then the MySQL engine would still use them and for MySQL. An even better solution would list supported keywords for each database adapter.
Comment #7
pwolanin commentedDo we need to get this in 8.x as bug fix or feature first?