You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create table T (a int, b int, c int) properties("replication_num"="1");
insert into T values(1,1,1),(2,2,2),(3,3,3);
create table T0 properties("replication_num"="1") as select * from T;
create table T1 properties("replication_num"="1") as select * from T;
create table T2 properties("replication_num"="1") as select * from T;
query
select * from T where T.a = (select a from T0) or T.b = (select b from T1) or T.c = (select c from T2);
The plan would contains 3 nested-loop join, and TableScan T would be in the left side and join T0, T1 and T3 for three times, if T is a large table, the cost of memory copy during concat bi-lateral columns is very heavy.
In optimizer, we can generate a plan that compute T X (T0 X T1 X T2) instead of ((T X T0) X T1) X T2, in this way, memory copy would be reduced to 1/3;
optimize one-line nested-loop join to eliminate memory copy of left side columns via just extending and appending right side columns to the result chunk of the nested-loop join.
The text was updated successfully, but these errors were encountered:
Enhancement
For query as follows:
prepare data
query
The plan would contains 3 nested-loop join, and TableScan T would be in the left side and join T0, T1 and T3 for three times, if T is a large table, the cost of memory copy during concat bi-lateral columns is very heavy.
We can optimized this query in two ways:
The text was updated successfully, but these errors were encountered: