Commit c893dd9
authored
[opt](memory) implement freeing memory column by column for partial update (apache#58275)
### What problem does this PR solve?
#### Background
Now, pages of column writer will be released after write all memtable
block in the scenario of partial updates, the process is as follows:
1. create all column_writer
2. append all column_writer (significant amount of memory expansion)
3. finish and free memory.
#### Problem
This implement will cause a significant amount of memory expansion when
flushing memtable(The larger the number of columns, the more obvious it
is), and make load could easily cancelled by memory manager when table
column too wide(such as 5000 column).
#### Solution
This pr implement freeing memory column by column for partial update to
solve the problem, the process is as follows:
1. create all column_writer
2. append column_writer and free memory column by column.
#### Test results
Test using machines with specifications of 16c and 64G with 5000 column
table:
- Before this pr, `VerticalSegmentWriter::_create_column_writer`
occupies nearly 20% of the memory.
- After fix, ` VerticalSegmentWriter::_create_column_writer` hardly
occupies memory.1 parent 29428ff commit c893dd9
File tree
2 files changed
+20
-20
lines changed- be/src/olap/rowset/segment_v2
2 files changed
+20
-20
lines changedLines changed: 18 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
450 | 463 | | |
451 | 464 | | |
452 | 465 | | |
| |||
536 | 549 | | |
537 | 550 | | |
538 | 551 | | |
| 552 | + | |
539 | 553 | | |
540 | 554 | | |
541 | 555 | | |
| |||
625 | 639 | | |
626 | 640 | | |
627 | 641 | | |
| 642 | + | |
628 | 643 | | |
629 | 644 | | |
630 | 645 | | |
| |||
722 | 737 | | |
723 | 738 | | |
724 | 739 | | |
| 740 | + | |
725 | 741 | | |
726 | 742 | | |
727 | 743 | | |
| |||
767 | 783 | | |
768 | 784 | | |
769 | 785 | | |
| 786 | + | |
770 | 787 | | |
771 | 788 | | |
772 | 789 | | |
| |||
928 | 945 | | |
929 | 946 | | |
930 | 947 | | |
931 | | - | |
932 | | - | |
933 | | - | |
934 | | - | |
935 | | - | |
936 | | - | |
937 | | - | |
938 | | - | |
939 | | - | |
940 | | - | |
941 | | - | |
942 | 948 | | |
943 | 949 | | |
944 | 950 | | |
| |||
988 | 994 | | |
989 | 995 | | |
990 | 996 | | |
991 | | - | |
992 | | - | |
993 | | - | |
994 | | - | |
995 | | - | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | | - | |
| 997 | + | |
1000 | 998 | | |
1001 | 999 | | |
1002 | 1000 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| 201 | + | |
| 202 | + | |
201 | 203 | | |
202 | 204 | | |
203 | 205 | | |
| |||
0 commit comments