Skip to content

[BE] Optimize version retrieval efficiency. - #5831

Merged
yangzhg merged 2 commits into
apache:masterfrom
killxdcj:ISSUE_5830
Jun 2, 2021
Merged

[BE] Optimize version retrieval efficiency.#5831
yangzhg merged 2 commits into
apache:masterfrom
killxdcj:ISSUE_5830

Conversation

@killxdcj

Copy link
Copy Markdown
Contributor

Optimize version retrieval efficiency in high-frequency import/compaction scenarios.

Proposed changes

More detail: #5830

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)
  • Code refactor (Modify the code structure, format the code, etc...)

Checklist

@killxdcjkillxdcj changed the title [FE] Optimize version retrieval efficiency.[BE] Optimize version retrieval efficiency.May 17, 2021
@morningmanmorningman added area/compact Issues or PRs related to the compact kind/improvement labels May 24, 2021
@morningman

Copy link
Copy Markdown
Contributor

Thanks for your contribution. I will take time to review the PR.. maybe later...

int64_t next_idx = -1;
for (const auto& it : _version_graph[cur_idx].edges) {
// Only consider incremental versions
if (_version_graph[it].value < _version_graph[cur_idx].value) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we already sort edges in descending order, can we "break" here?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

resolved~

@morningmanmorningman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@morningmanmorningman added the approved Indicates a PR has been approved by one committer. label May 31, 2021
@yangzhg
yangzhg merged commit 4c0a98e into apache:masterJun 2, 2021
@killxdcj
killxdcj deleted the ISSUE_5830 branch June 2, 2021 02:26
stdpain pushed a commit to stdpain/incubator-doris that referenced this pull request Jul 8, 2021
* [FE] Optimize version retrieval efficiency in high-frequency import/compaction scenarios.
* Jump out of the loop when encountering the reverse edge.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.area/compactIssues or PRs related to the compactkind/improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhance] Optimize version retrieval efficiency in high-frequency import/compaction scenarios.

3 participants

@killxdcj@morningman@yangzhg