문서번호 : 11-400564
Document Information
•
최초 작성일 : 2022.07.15
•
최종 수정일 : 2022.07.15
•
이 문서는 아래 버전을 기준으로 작성되었습니다.
◦
SinglestoreDB : 7.8
Goal
•
OLTP 환경(지속적인 DML 발생 환경)에서 row segment의 상태 변화와 background merger의 동작을 확인한다.
Findings
아래의 자료는 SHOW COLUMNAR MERGE STATUS 와 INFORMATION_SCHEMA.COLUMNAR_SEGMENTS의 조회 결과이다.
1.
초기 상태
•
Plan 2,2,1의 의미는 2개, 2개, 1개의 segment가 sort된 상태로 존재하는 다는 의미이다.
•
MIN_VALUE와 MAX_VALUE를 보면, Segment_id 365, 367과 799, 801은 각각 Sorted rowstore segment group이다.
+------------------+------------------+-------+----------+-----------+
| Merger | State | Plan | Progress | Partition |
+------------------+------------------+-------+----------+-----------+
| (Current groups) | NULL | 2,2,1 | NULL | 0 |
+------------------+------------------+-------+----------+-----------+
+------------+-----------+------------+------------+--------------------+
| SEGMENT_ID | MIN_VALUE | MAX_VALUE | ROWS_COUNT | DELETED_ROWS_COUNT |
+------------+-----------+------------+------------+--------------------+
| 365 | 0 | 821361230 | 1023939 | 61 |
| 367 | 821368380 | 1071612954 | 31635 | 6 |
| 799 | 0 | 811443915 | 1023983 | 17 |
| 801 | 811452132 | 1070401413 | 33491 | 0 |
| 804 | 0 | 822248928 | 14311 | 5 |
+------------+-----------+------------+------------+--------------------+
Bash
복사
2.
Slow Merger 시작
•
Segment_id 365, 367과 799, 801의 Sorted rowstore segment group이 merge 되고 있는 상태이다.
+------------------+------------------+-------+----------+-----------+
| Merger | State | Plan | Progress | Partition |
+------------------+------------------+-------+----------+-----------+
| (Current groups) | NULL | 2,2,1 | NULL | 0 |
| Slow Merger | Merging Segments | 2+2 | 7.75 | 0 |
+------------------+------------------+-------+----------+-----------+
+------------+-----------+------------+------------+--------------------+
| SEGMENT_ID | MIN_VALUE | MAX_VALUE | ROWS_COUNT | DELETED_ROWS_COUNT |
+------------+-----------+------------+------------+--------------------+
| 365 | 0 | 821361230 | 1023938 | 62 |
| 367 | 821368380 | 1071612954 | 31635 | 6 |
| 799 | 0 | 811443915 | 1023983 | 17 |
| 801 | 811452132 | 1070401413 | 33491 | 0 |
| 804 | 0 | 822248928 | 14311 | 5 |
+------------+-----------+------------+------------+--------------------+
Bash
복사
3.
Fast Merger 시작
•
Segment_id 808은 메모리 내 rowstore-backed segment가 flush된 segment이다.
•
segment_id 804,808은 Fast Merger에 의해 merger 되고 있다.
+------------------+------------------+---------+----------+-----------+
| Merger | State | Plan | Progress | Partition |
+------------------+------------------+---------+----------+-----------+
| (Current groups) | NULL | 2,2,1,1 | NULL | 0 |
| Fast Merger | Merging Segments | 1+1 | 79.99 | 0 |
| Slow Merger | Merging Segments | 2+2 | 38.76 | 0 |
+------------------+------------------+---------+----------+-----------+
+------------+-----------+------------+------------+--------------------+
| SEGMENT_ID | MIN_VALUE | MAX_VALUE | ROWS_COUNT | DELETED_ROWS_COUNT |
+------------+-----------+------------+------------+--------------------+
| 365 | 0 | 821361230 | 1023938 | 62 |
| 367 | 821368380 | 1071612954 | 31635 | 6 |
| 799 | 0 | 811443915 | 1023977 | 23 |
| 801 | 811452132 | 1070401413 | 33491 | 0 |
| 804 | 0 | 822248928 | 14310 | 6 |
| 808 | 15486 | 1014620390 | 14316 | 0 |
+------------+-----------+------------+------------+--------------------+
Bash
복사
4.
Fast Merger 종료
•
Segment_id 804, 808은 811로 merge되었다.
•
소요 시간은 약 1초이다.
+------------------+------------------+-------+----------+-----------+
| Merger | State | Plan | Progress | Partition |
+------------------+------------------+-------+----------+-----------+
| (Current groups) | NULL | 2,2,1 | NULL | 0 |
| Slow Merger | Merging Segments | 2+2 | 42.64 | 0 |
+------------------+------------------+-------+----------+-----------+
+------------+-----------+------------+------------+--------------------+
| SEGMENT_ID | MIN_VALUE | MAX_VALUE | ROWS_COUNT | DELETED_ROWS_COUNT |
+------------+-----------+------------+------------+--------------------+
| 365 | 0 | 821361230 | 1023938 | 62 |
| 367 | 821368380 | 1071612954 | 31635 | 6 |
| 799 | 0 | 811443915 | 1023976 | 24 |
| 801 | 811452132 | 1070401413 | 33491 | 0 |
| 811 | 0 | 1014620390 | 28625 | 1 |
+------------+-----------+------------+------------+--------------------+
Bash
복사
5.
Slow Merger - 새로운 segment 생성
•
Slow Merger에 의해 sort된 Segment_id 365, 799의 row들은 delete되었다.
•
그리고 delet된 row들은 새로운 segment인 Segment_id 807로 생성되었다.
+------------------+------------------+---------+----------+-----------+
| Merger | State | Plan | Progress | Partition |
+------------------+------------------+---------+----------+-----------+
| (Current groups) | NULL | 2,2,1,1 | NULL | 0 |
| Slow Merger | Merging Segments | 2+2 | 56.21 | 0 |
+------------------+------------------+---------+----------+-----------+
+------------+-----------+------------+------------+--------------------+
| SEGMENT_ID | MIN_VALUE | MAX_VALUE | ROWS_COUNT | DELETED_ROWS_COUNT |
+------------+-----------+------------+------------+--------------------+
| 365 | 0 | 821361230 | 512417 | 511583 |
| 367 | 821368380 | 1071612954 | 31635 | 6 |
| 799 | 0 | 811443915 | 511499 | 512501 |
| 801 | 811452132 | 1070401413 | 33491 | 0 |
| 807 | 0 | 190644656 | 1023998 | 2 |
| 811 | 0 | 1014620390 | 28625 | 1 |
+------------+-----------+------------+------------+--------------------+
Bash
복사
6.
종료 상태
•
기존의 segment인 Segment_id 365, 379, 799, 801은 merge되어, 새로운 segment인 Segment_id 815, 818을 생성하였다.
•
Segment_id 807,815,818 이 하나의 Sorted rowstore segment group이 되었다.
•
소요 시간은 약 1분 이다.
+------------------+-------+------+----------+-----------+
| Merger | State | Plan | Progress | Partition |
+------------------+-------+------+----------+-----------+
| (Current groups) | NULL | 3,1 | NULL | 0 |
+------------------+-------+------+----------+-----------+
+------------+-----------+------------+------------+--------------------+
| SEGMENT_ID | MIN_VALUE | MAX_VALUE | ROWS_COUNT | DELETED_ROWS_COUNT |
+------------+-----------+------------+------------+--------------------+
| 807 | 0 | 190644656 | 1023997 | 3 |
| 811 | 0 | 1014620390 | 28619 | 7 |
| 815 | 190644656 | 816551857 | 1023997 | 3 |
| 818 | 816553452 | 1071612954 | 65042 | 0 |
+------------+-----------+------------+------------+--------------------+
Bash
복사
References
History
일자 | 작성자 | 비고 |
2022.07.15 | wee | 초기 작성 |