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
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
createtablet1 (a int, b int, key(a));
createtablet2 (a int, b int, key(a));
set @@tidb_enable_inl_join_inner_multi_pattern=on;
desc with cte as (select a, count(b) from t2 group by a) select/*+ INL_JOIN(cte) */*from t1, cte wheret1.a=cte.a;
2. What did you expect to see? (Required)
Use index join.
3. What did you see instead (Required)
mysql>desc with cte as (select a, count(b) from t2 group by a) select/*+ INL_JOIN(cte) */*from t1, cte wheret1.a=cte.a;
+------------------------------------+----------+-----------+---------------+------------------------------------------------------------------------------------------+
| id | estRows | task | access object | operator info |
+------------------------------------+----------+-----------+---------------+------------------------------------------------------------------------------------------+
| Projection_13 | 9990.00 | root | | sys.t1.a, sys.t1.b, sys.t2.a, Column#13 |
| └─HashJoin_46 | 9990.00 | root | | inner join, equal:[eq(sys.t1.a, sys.t2.a)] |
| ├─HashAgg_71(Build) | 7992.00 | root | | group by:sys.t2.a, funcs:count(Column#29)->Column#13, funcs:firstrow(sys.t2.a)->sys.t2.a |
| │ └─TableReader_72 | 7992.00 | root | | data:HashAgg_64 |
| │ └─HashAgg_64 | 7992.00 | cop[tikv] | | group by:sys.t2.a, funcs:count(sys.t2.b)->Column#29 |
| │ └─Selection_70 | 9990.00 | cop[tikv] | | not(isnull(sys.t2.a)) |
| │ └─TableFullScan_69 | 10000.00 | cop[tikv] | table:t2 | keep order:false, stats:pseudo |
| └─TableReader_60(Probe) | 9990.00 | root | | data:Selection_59 |
| └─Selection_59 | 9990.00 | cop[tikv] | | not(isnull(sys.t1.a)) |
| └─TableFullScan_58 | 10000.00 | cop[tikv] | table:t1 | keep order:false, stats:pseudo |
+------------------------------------+----------+-----------+---------------+------------------------------------------------------------------------------------------+10 rows inset, 1 warning (0.01 sec)
mysql> show warnings;
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1815 | There are no matching table names for (cte) in optimizer hint /*+ INL_JOIN(cte) */or/*+ TIDB_INLJ(cte) */. Maybe you can use the table alias name |
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------+1 row inset (0.01 sec)
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
Use index join.
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
b69f81b
The text was updated successfully, but these errors were encountered: