pingcap/tidb

Executor, Planner: convert in_subquery to hash joins when in_subquery just involves one column

Open

#13.972 geöffnet am 9. Dez. 2019

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (1 zugewiesene Person)Go (6.186 Forks)batch import
help wantedsig/executionsig/plannertype/enhancement

Repository-Metriken

Stars
 (40.090 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 14T 4h) (346 gemergte PRs in 30 T)

Beschreibung

Feature Request

Is your feature request related to a problem? Please describe:

select * from S where S.a in (select a from T); where s.a and t.a are nullable. in TiDB, this query is converted to a NestLoopJoin, which is time-consuming. in Mysql, this query is transformed into looking up a materialized table using an equal key, which is like a hash join.

Describe the feature you'd like:

Supporting a nullable join key in current hash join of TiDB, NOTE only one key. Otherwise, it should take the NestLoopJoin .

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

https://dev.mysql.com/doc/refman/8.0/en/subquery-materialization.html

Contributor Guide