I have algorythm where I need to join two tables , first table has 40 millions of rows and second one has 300 000. Both tables were created with same ORDER BY so while joining I use SETTINGS join_algorithm = full_sorting_merge , max_bytes_before_external_sort = 0; It looks like following:
SELECT A.* , B.* FROM db1.table1 A -- 40 millions of rows
left join (select * from db1.table2) B -- 300 000 rows
on A.col1 = B.col1
SETTINGS join_algorithm = full_sorting_merge , max_bytes_before_external_sort = 0;
现在,我需要增加表db1.table3,以便与表1合并。
SELECT A.* , B.* FROM db1.table1 A -- 40 millions of rows
left join (select * from db1.table2) B -- 300 000 rows
on A.col1 = B.col1
left join (select * from db1.table3) C -- 400 000 rows
on A.col1 = C.col1
我应说明加入algrothm的情况? 每次加入之后? 或者只是在问询结束时? 如果在问答结束时我只具体说明哪一种SETlingS在两个加入时是否得到推进? 是否有能力为每一个加入询问的人指明不同的农林? 辅助器