pingcap/tidb

show `CARTESIAN JOIN` inappropriately in some cases

Open

#20,261 opened on 2020年9月28日

GitHub で見る
 (1 comment) (0 reactions) (2 assignees)Go (6,186 forks)batch import
good first issuehelp wantedsig/plannertype/enhancement

Repository metrics

Stars
 (40,090 stars)
PR merge metrics
 (平均マージ 14d 4h) (30d で 346 merged PRs)

説明

Development Task

mysql> desc select /*+ tidb_hj(t1) */ * from t t1 inner join t t2 where t1.a=t2.a and t1.a=1;
+---------------------------+---------+------+---------------+----------------------+
| id                        | estRows | task | access object | operator info        |
+---------------------------+---------+------+---------------+----------------------+
| HashJoin_7                | 1.00    | root |               | CARTESIAN inner join |
| ├─Point_Get_10(Build)     | 1.00    | root | table:t       | handle:1             |
| └─Point_Get_9(Probe)      | 1.00    | root | table:t       | handle:1             |
+---------------------------+---------+------+---------------+----------------------+
3 rows in set (0.00 sec)

In the case above, it's not a cartesian join, but there is a CARTESIAN in the result.

コントリビューターガイド