Skip to content

(FEAT) Add (certname,endtime) index to reports#3362

Closed
npwalker wants to merge 1 commit intopuppetlabs:masterfrom
npwalker:make_reports_certname_timestamp_index
Closed

(FEAT) Add (certname,endtime) index to reports#3362
npwalker wants to merge 1 commit intopuppetlabs:masterfrom
npwalker:make_reports_certname_timestamp_index

Conversation

@npwalker
Copy link
Contributor

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.

@npwalker npwalker requested a review from a team as a code owner October 29, 2020 20:02
@npwalker npwalker force-pushed the make_reports_certname_timestamp_index branch from 5240bbc to 19b1661 Compare October 29, 2020 20:14
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.
@npwalker npwalker force-pushed the make_reports_certname_timestamp_index branch from 19b1661 to 3205b16 Compare October 29, 2020 20:22
@puppetcla
Copy link

CLA signed by all contributors.

@austb
Copy link
Contributor

austb commented Feb 2, 2021

Cherry-picked this commit to #3410, added a test, and fixed the issue with the test for migration 74.

@austb austb closed this Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants