Skip to content

[BE] Optimize version retrieval efficiency.#5831

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

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

Conversation

@killxdcj
Copy link
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

@killxdcj killxdcj changed the title [FE] Optimize version retrieval efficiency. [BE] Optimize version retrieval efficiency. May 17, 2021
@morningman morningman added area/compact Issues or PRs related to the compact kind/improvement labels May 24, 2021
@morningman
Copy link
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
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
Contributor Author

Choose a reason for hiding this comment

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

resolved~

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

@morningman morningman added the approved Indicates a PR has been approved by one committer. label May 31, 2021
@yangzhg yangzhg merged commit 4c0a98e into apache:master Jun 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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. area/compact Issues or PRs related to the compact kind/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