Performance fix: removing unnecessary sql queries checking if selecte…#47
Open
krzysztofruszczynski wants to merge 1 commit intoDataTables:masterfrom
Open
Performance fix: removing unnecessary sql queries checking if selecte…#47krzysztofruszczynski wants to merge 1 commit intoDataTables:masterfrom
krzysztofruszczynski wants to merge 1 commit intoDataTables:masterfrom
Conversation
…d options exist (final db query uses OR condition so there would be no effect on sql result)
Contributor
|
Thank you for the PR. I'm not sure about this - I'll need to look in to it more and remind myself why those queries were there in the first place before I merge this in. |
Contributor
|
This is the original commit that introduced that code. And this was the description of the bug that triggered that addition:
I agree that there must be a more performant way of doing all of this though. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

It looks like those count queries are not needed. Even if we provide value, which is not in database, or_where will add 0 records to actual query result and it would be transparent for user. Removing those queries significantly increase performance and reduce number of sql queries. Variable $http is not used as reference anywhere, so its value inside doesn't have further impacts.