Differentiate query time from execution time #970
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.
The only time showed by this bundle is the whole time taken by the request : latency + query + fetch. So a fast query but a long fetch is marked as slow in the debug toolbar.
With this patch I want to address this case :
Naturally I want to optimize query 1, but with more analysis, what happened is that :
So the fix is different : I need to work on the query itself on query 2 and on the data retrieved on query 1.
I also return the number of result given by the query, as it can give a useful info about the query (hello the sort on 1000000 results, better shrink the resultset).
This is a very naive approach and we sure can add more time information (latency?) to have some useful time given.
What do you think?