Fix Export when full group by mode is used #13124
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Fixes an export performance issue in mysql Full Group By mode
Before
Running ExportIMTest horrendously slow with Full Group By enabled due to returning 7776 rows for php processing rather than 1
After
Test works quickly. Query is marked as not meeting the full group by standard using disable & re-enabled full group by.
Technical Details
After upgrading locally to mysql 5.7 I found that the exportIM test
was taking so long locally that I was killing it rather than finding
out how long it would take.
Digging into it I found that we were changing the query so that
attempts to group by contact ID were being nullified when full group by
is enabled. This meant that we were winding up with
7776 rows being retrieved to reflect a grid of permutations, which was
being iterated down to 1 in php.
In general the practice of altering the group by to meet this new
standard is one that we determined to be
causing problems and we discontinued / rolled back
Comments
Note test coverage is strong across the changed code
@seamuslee001