forked from StarRocks/starrocks
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BugFix] Fix incorrect estimation of average row size when doing part…
…ial update (StarRocks#27485) When we do partial update, we first write a partial rowset and we will load the left columns data into memory during the following apply phase and we process the rowset data by segment. So if one segment file has too many rows, a large memory is needed. So we will get the average row size of historical data to avoid large memory alloc. The following code is how we get the average row size. However, when we do partial update, the `data_size` is the compressed partial rowset data size which far less than total row size, so the `average_row_size` may far less than real average row size. So we may write too many rows into one segment which cause large memory alloc. ``` int64_t TabletUpdates::get_average_row_size() { TTabletInfo info; get_tablet_info_extra(&info); int64_t total_row = info.row_count; int64_t total_size = info.data_size; if (total_row != 0) { return total_size / total_row; } else { return 0; } ``` This pr fix the issue and return the correct average row size of historical data. Signed-off-by: zhangqiang <[email protected]>
- Loading branch information
Showing
8 changed files
with
95 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters