Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement](MOW) refactor delete bitmap calculator and enhance the deletion bitmap calculation for full duplicate load #22566

Closed
wants to merge 14 commits into from

Conversation

jixxiong
Copy link
Contributor

@jixxiong jixxiong commented Aug 3, 2023

Proposed changes

Issue Number: close #xxx

We propose a new approach based on multi-way merge sort to calculate the delete bitmap between new and old records. Specifically, under the Unique-Key model, in the previous implementation, we would individually search for each newly added record within the existing rowsets using a primary key index to identify records that needed to be marked for deletion. However, this method's efficiency is significantly compromised when performing full duplicate loads especially when the number of rowset gets larger.

This patch does not exhibit significant performance degradation on average, but in the context of 't+1 load' scenarios (where multiple minor updates are performed on a substantial existing dataset before a full-scale replacement update), there is a notable performance improvement.

For example, let's say we create a unique-key table with a composite key of 3 integers. We then adopt the following import approach: first, perform a full import of all the data (40M rows), followed by several, say 20, smaller-scale imports (1M rows), and then another full import (40M rows). In the final import, on our machine, we observed that the unoptimized code took 89 seconds to import, whereas after implementing optimizations, the code only required 50 seconds.

Further comments

If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2023

clang-tidy review says "All clean, LGTM! 👍"

@jixxiong jixxiong changed the title [enhancement](MOW) refactor delete bitmap calculator and enhance the deletion bitmap calculation for complete updates [enhancement](MOW) refactor delete bitmap calculator and enhance the deletion bitmap calculation for complete updates(loads) Aug 3, 2023
@jixxiong jixxiong changed the title [enhancement](MOW) refactor delete bitmap calculator and enhance the deletion bitmap calculation for complete updates(loads) [enhancement](MOW) refactor delete bitmap calculator and enhance the deletion bitmap calculation for complete loads Aug 3, 2023
@jixxiong jixxiong changed the title [enhancement](MOW) refactor delete bitmap calculator and enhance the deletion bitmap calculation for complete loads [enhancement](MOW) refactor delete bitmap calculator and enhance the deletion bitmap calculation for full duplicate load Aug 3, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2023

clang-tidy review says "All clean, LGTM! 👍"

2 similar comments
@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2023

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2023

clang-tidy review says "All clean, LGTM! 👍"

@jixxiong
Copy link
Contributor Author

jixxiong commented Aug 4, 2023

run buildall

@hello-stephen
Copy link
Contributor

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 48.37 seconds
stream load tsv: 509 seconds loaded 74807831229 Bytes, about 140 MB/s
stream load json: 20 seconds loaded 2358488459 Bytes, about 112 MB/s
stream load orc: 65 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 31 seconds loaded 861443392 Bytes, about 26 MB/s
insert into select: 29.1 seconds inserted 10000000 Rows, about 343K ops/s
storage size: 17162308626 Bytes

@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

clang-tidy review says "All clean, LGTM! 👍"

@jixxiong
Copy link
Contributor Author

jixxiong commented Aug 9, 2023

run buildall

@hello-stephen
Copy link
Contributor

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 45.22 seconds
stream load tsv: 514 seconds loaded 74807831229 Bytes, about 138 MB/s
stream load json: 21 seconds loaded 2358488459 Bytes, about 107 MB/s
stream load orc: 64 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 32 seconds loaded 861443392 Bytes, about 25 MB/s
insert into select: 29.1 seconds inserted 10000000 Rows, about 343K ops/s
storage size: 17162229976 Bytes

be/src/olap/delete_bitmap_calculator.cpp Outdated Show resolved Hide resolved
be/src/olap/delete_bitmap_calculator.cpp Outdated Show resolved Hide resolved
be/src/olap/delete_bitmap_calculator.cpp Show resolved Hide resolved
be/src/olap/delete_bitmap_calculator.cpp Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

clang-tidy review says "All clean, LGTM! 👍"

6 similar comments
@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

clang-tidy review says "All clean, LGTM! 👍"

@jixxiong
Copy link
Contributor Author

jixxiong commented Aug 9, 2023

run buildall

@hello-stephen
Copy link
Contributor

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 46.46 seconds
stream load tsv: 510 seconds loaded 74807831229 Bytes, about 139 MB/s
stream load json: 20 seconds loaded 2358488459 Bytes, about 112 MB/s
stream load orc: 65 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 30 seconds loaded 861443392 Bytes, about 27 MB/s
insert into select: 29.0 seconds inserted 10000000 Rows, about 344K ops/s
storage size: 17162165275 Bytes

@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

clang-tidy review says "All clean, LGTM! 👍"

@jixxiong
Copy link
Contributor Author

jixxiong commented Aug 9, 2023

run buildall

@hello-stephen
Copy link
Contributor

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 45.66 seconds
stream load tsv: 510 seconds loaded 74807831229 Bytes, about 139 MB/s
stream load json: 20 seconds loaded 2358488459 Bytes, about 112 MB/s
stream load orc: 66 seconds loaded 1101869774 Bytes, about 15 MB/s
stream load parquet: 31 seconds loaded 861443392 Bytes, about 26 MB/s
insert into select: 29.3 seconds inserted 10000000 Rows, about 341K ops/s
storage size: 17162109814 Bytes

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@jixxiong
Copy link
Contributor Author

run buildall

@hello-stephen
Copy link
Contributor

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 47.79 seconds
stream load tsv: 512 seconds loaded 74807831229 Bytes, about 139 MB/s
stream load json: 20 seconds loaded 2358488459 Bytes, about 112 MB/s
stream load orc: 65 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 30 seconds loaded 861443392 Bytes, about 27 MB/s
insert into select: 29.2 seconds inserted 10000000 Rows, about 342K ops/s
storage size: 17162059115 Bytes

@jixxiong
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@hello-stephen
Copy link
Contributor

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 47.32 seconds
stream load tsv: 517 seconds loaded 74807831229 Bytes, about 137 MB/s
stream load json: 20 seconds loaded 2358488459 Bytes, about 112 MB/s
stream load orc: 65 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 31 seconds loaded 861443392 Bytes, about 26 MB/s
insert into select: 29.4 seconds inserted 10000000 Rows, about 340K ops/s
storage size: 17162182728 Bytes

@jixxiong
Copy link
Contributor Author

run p0

@jixxiong
Copy link
Contributor Author

run buildall

@hello-stephen
Copy link
Contributor

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 45.83 seconds
stream load tsv: 517 seconds loaded 74807831229 Bytes, about 137 MB/s
stream load json: 20 seconds loaded 2358488459 Bytes, about 112 MB/s
stream load orc: 65 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 31 seconds loaded 861443392 Bytes, about 26 MB/s
insert into select: 29.1 seconds inserted 10000000 Rows, about 343K ops/s
storage size: 17162304040 Bytes

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@jixxiong
Copy link
Contributor Author

run buildall

Copy link
Contributor

We're closing this PR because it hasn't been updated in a while.
This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and feel free a maintainer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Feb 11, 2024
@github-actions github-actions bot closed this Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants