Enhancement
For a hash join with an empty build side, the result can be known without reading the probe side, but TiFlash still scans it.
For example:
SELECT *
FROM orders
INNER JOIN lineitem
ON l_comment = o_comment
WHERE o_clerk = 'Clerk#000000000';
The filter produces no build rows, but the profile shows:
Build actRows: 0
Probe actRows: 59,986,052
lineitem data_scanned_rows: 59,987,779
Query time: about 715 ms
It would be useful to skip the probe-side scan when the build side is empty. The same optimization opportunity also applies to eligible Semi Join cases.
Enhancement
For a hash join with an empty build side, the result can be known without reading the probe side, but TiFlash still scans it.
For example:
The filter produces no build rows, but the profile shows:
It would be useful to skip the probe-side scan when the build side is empty. The same optimization opportunity also applies to eligible Semi Join cases.