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
In TiFlash, the entry of a join hash table is <key, RowRefList>, where RowRefList is a list of the rows that has the same key, and each element if the RowRefList is a pair of <block_index, row_index>. During hash join probe stage, if a probe row has an existing key in the hash table, it will combine all the matched rows in the RowRefList using AddFound, inside AddFound, it just iterator over the RowRefList and insert the data row by row
If the list is very long (~10000), it will take a lot if time in AddFound. We need to find a way to optimize this implementation.
A straightforward optimization is to cache AddFound result of such key, so next time when a probe row which has the same key comes, we can just use insertRange to batch insert the data instead of iterator over RowRefList and insert the data row by row
The text was updated successfully, but these errors were encountered:
Enhancement
In TiFlash, the entry of a join hash table is <key, RowRefList>, where
RowRefList
is a list of the rows that has the same key, and each element if theRowRefList
is a pair of <block_index, row_index>. During hash join probe stage, if a probe row has an existing key in the hash table, it will combine all the matched rows in theRowRefList
usingAddFound
, insideAddFound
, it just iterator over theRowRefList
and insert the data row by rowtiflash/dbms/src/Interpreters/JoinPartition.cpp
Lines 1321 to 1329 in e597b78
If the list is very long (~10000), it will take a lot if time in
AddFound
. We need to find a way to optimize this implementation.A straightforward optimization is to cache
AddFound
result of such key, so next time when a probe row which has the same key comes, we can just useinsertRange
to batch insert the data instead of iterator overRowRefList
and insert the data row by rowThe text was updated successfully, but these errors were encountered: