[CBRD-26522] Support NL join during parallel heap scan#6806
Open
xmilex-git wants to merge 24 commits intoCUBRID:developfrom
Open
[CBRD-26522] Support NL join during parallel heap scan#6806xmilex-git wants to merge 24 commits intoCUBRID:developfrom
xmilex-git wants to merge 24 commits intoCUBRID:developfrom
Conversation
Contributor
Author
|
/run all |
Contributor
Author
|
/run all |
Contributor
Author
|
/run all |
Contributor
Author
|
/run all |
Contributor
Author
|
/run all |
Contributor
Author
|
/run all |
Contributor
Author
|
/run all |
Contributor
Author
|
/run all |
Contributor
Author
|
/run all |
Contributor
Author
|
/run shell |
Contributor
Author
|
/run shell |
1 similar comment
Contributor
Author
|
/run shell |
Hamkua
reviewed
Feb 13, 2026
| } | ||
|
|
||
| /* for nl join */ | ||
| for (xptr1 = xasl_tree->scan_ptr; xptr1 != nullptr; xptr1 = xptr1->scan_ptr) |
Contributor
There was a problem hiding this comment.
trace 출력 시 partition 정보가 출력되지 않는 것 같습니다.
drop table if exists t1, t2;
create table t1 (id int primary key, col1 varchar(20), col2 varchar(20), col3 varchar(20),col4 varchar(20),col5 varchar(20),col6 varchar(20));
create table t2 (id int primary key, col1 varchar(20), col2 varchar(20), col3 varchar(20),col4 varchar(20),col5 varchar(20),col6 varchar(20))
partition by range(id) (
partition p1 values less than (10000),
partition p2 values less than(20000),
partition p3 values less than MAXVALUE
);
insert into t1 select rownum,lpad(rownum,20,'0'),lpad(rownum % 5,20,'0'),lpad(rownum,20,'0'),lpad(rownum,20,'0'),lpad(rownum,20,'0'),lpad(rownum,20,'0')
from db_class a, db_class b, db_class c, db_class d, db_class e, db_class f limit 500000;
insert into t2 select rownum,lpad(rownum,20,'0'),lpad(rownum % 5,20,'0'),lpad(rownum,20,'0'),lpad(rownum,20,'0'),lpad(rownum,20,'0'),lpad(rownum,20,'0')
from db_class a, db_class b, db_class c, db_class d, db_class e, db_class f limit 100000;
with cte as (
select /*+ parallel(16) ordered materialize */ a.col1, b.id from t1 a, t2 b
where cast(a.col1 as int)/5 = b.id and b.id < 10000
) select /*+ recompile */ 1 from cte limit 1;기존 row by row 방식:
Trace Statistics:
SELECT (time: 17480, fetch: 6041553, fetch_time: 11034, ioread: 0)
SCAN (temp time: 0, fetch: 0, ioread: 0, readrows: 1, rows: 1)
SUBQUERY (uncorrelated)
CTE (non_recursive_part)
SELECT (time: 17480, fetch: 6041553, fetch_time: 11034, ioread: 0)
SCAN (table: dba.t1), (heap time: 424, fetch: 2040052, ioread: 0, readrows: 500000, rows: 500000)
(parallel workers: 16, heap time: 470..473, readrows: 24563..33957, rows: 24563..33957, gather: row by row)
SCAN (index: dba.t2.pk_t2_id), (btree time: 16473, fetch: 4000000, ioread: 0, readkeys: 49999, filteredkeys: 49995, rows: 49995, covered: tr
ue)
PARTITION (index: dba.t2__p__p1.pk_t2_id), (btree time: 16473, fetch: 4000000, ioread: 0, readkeys: 49999, filteredkeys: 49995, rows:
49995, covered: true)
MEMOIZE (time: 127, hit: 0, miss: 1001, size: 261KB, enabled: false)
mergeable list 방식:
Trace Statistics:
SELECT (time: 1574, fetch: 6027596, fetch_time: 9336, ioread: 0)
SCAN (temp time: 0, fetch: 4, ioread: 0, readrows: 1, rows: 1)
SUBQUERY (uncorrelated)
CTE (non_recursive_part)
SELECT (time: 1574, fetch: 6027592, fetch_time: 9336, ioread: 0)
SCAN (table: dba.t1), (heap time: 1573, fetch: 6027576, ioread: 0, readrows: 500000, rows: 500000)
(parallel workers: 16, heap time: 1567..1571, readrows: 29876..32801, rows: 29876..32801, gather: mergeable
list)
SCAN (index: dba.t2.pk_t2_id), (btree time: 1077, fetch: 4000000, ioread: 0, readkeys: 49999, filteredkeys: 499
95, rows: 49995, covered: true)
MEMOIZE (time: 0, hit: 0, miss: 16016, size: 3999KB, enabled: false)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
http://jira.cubrid.org/browse/CBRD-26522
Purpose
기존에는 join driving 테이블이 heap scan인 경우, 이를 row-by-row로 처리하여 동기화 오버헤드 및 중앙 처리 방식으로 인해 NL join의 성능이 많이 저하됐었습니다.
이를 개선하기 위해, 각각의 parallel heap scan thread에서 NL join을 평가하고 결과를 각각 수집하게끔 변경하여, mergeable-list 방식으로 처리할 수 있도록 변경합니다.