Add index to sp_return_logs to speed up reporting queries#5670
Merged
zachmargolis merged 1 commit intomainfrom Dec 6, 2021
Merged
Add index to sp_return_logs to speed up reporting queries#5670zachmargolis merged 1 commit intomainfrom
zachmargolis merged 1 commit intomainfrom
Conversation
stevegsa
approved these changes
Dec 6, 2021
zachmargolis
added a commit
that referenced
this pull request
Dec 6, 2021
(cherry picked from commit bbf4f4b)
This was referenced Dec 6, 2021
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.
Note: My goal is to deploy this index as a patch release (today?) so that it if goes poorly, we can revert it and clean it up well before the scheduled Thursday deploy
Background:
We're getting consistent timeouts in the new, Combined IAA report see below is one of the queries that's timing out (inside of
TotalMonthlyAuthCountsWithinIaaWindow)The
sp_return_logstable is very big, and even using therequested_atindex still yields too many rows, so our current hypothesis is that a new index would help to speed things up, assuming the query planner doesn't pick the wrong one.