(FEAT) Add (certname,endtime) index to reports#3362
Closed
npwalker wants to merge 1 commit intopuppetlabs:masterfrom
Closed
(FEAT) Add (certname,endtime) index to reports#3362npwalker wants to merge 1 commit intopuppetlabs:masterfrom
npwalker wants to merge 1 commit intopuppetlabs:masterfrom
Conversation
5240bbc to
19b1661
Compare
Prior to this commit, we had a certname index on reports and an end_time index on reports. For queries that want certname sorted by end_time they were scanning the endtime index and removing rows that don't match the certname causing the query to read way more data pages into memory than is desirable. After this commit, we remove the certname index and replace it with a certname,end_time index. This allows for finding a certname in the index and also getting the reports for it in the end_time order that the query desires. This drastically reduces the number of data pages that need to be read into memory. Also, any queries that previously used the certname index can still use the certname,endtime index to satisfy their needs.
19b1661 to
3205b16
Compare
|
CLA signed by all contributors. |
Contributor
|
Cherry-picked this commit to #3410, added a test, and fixed the issue with the test for migration 74. |
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.
Prior to this commit, we had a certname index on reports
and an endtime index on reports. For queries that want
certname sorted by endtime they were scanning the
endtime index and removing rows that don't match the certname
causing the query to read way more data pages into memory than
is desirable.
After this commit, we remove the certname index and replace it
with a certname,endtime index. This allows for finding a certname
in the index and also getting the reports for it in the endtime
order that the query desires. This drastically reduces the number
of data pages that need to be read into memory.
Also, any queries that previously used the certname index can still
use the certname,endtime index to satisfy their needs.