Skip to content

Improve Pages Index#11984

Merged
sopel39 merged 2 commits intotrinodb:masterfrom
pettyjamesm:improve-pages-index
Apr 20, 2022
Merged

Improve Pages Index#11984
sopel39 merged 2 commits intotrinodb:masterfrom
pettyjamesm:improve-pages-index

Conversation

@pettyjamesm
Copy link
Member

@pettyjamesm pettyjamesm commented Apr 15, 2022

Description

Minor refactoring improvements to PagesIndex.

Is this change a fix, improvement, new feature, refactoring, or other?

Refactoring

Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific)

Core engine

How would you describe this change to a non-technical end user or system administrator?

This change should not need to be explained to a non-technical end user or system administrator.

Documentation

(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

(x) No release notes entries required.
( ) Release notes entries required with the following suggested text:

@cla-bot cla-bot bot added the cla-signed label Apr 15, 2022
@pettyjamesm pettyjamesm force-pushed the improve-pages-index branch from 4c94a5a to c4e7238 Compare April 15, 2022 18:40
@pettyjamesm pettyjamesm marked this pull request as ready for review April 15, 2022 20:23
@pettyjamesm pettyjamesm requested a review from sopel39 April 15, 2022 20:23
Copy link
Member

@raunaqmorarka raunaqmorarka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks ok to me.
Is there any measurable impact of this in some JMH benchmark like BenchmarkPagesIndexPageSorter or on an actual query ?

for (int position = 0; position < page.getPositionCount(); position++) {
long sliceAddress = encodeSyntheticAddress(pageIndex, position);
// this uses a long[] internally, so cap size to a nice round number for safety
int resultingSize = valueAddresses.size() + page.getPositionCount();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just use a long here instead of resultingSize < 0 for detecting overflow.

@sopel39 sopel39 merged commit 42f2c36 into trinodb:master Apr 20, 2022
@pettyjamesm pettyjamesm deleted the improve-pages-index branch April 20, 2022 14:34
@github-actions github-actions bot added this to the 378 milestone Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants