Skip to content

Avoid unnecessary probe-side MPP work for empty-build hash joins #11000

Description

@ChangRui-Ryan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementThe issue or PR belongs to an enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions