Skip to content

*core.PhysicalIndexJoin doesn't support cloning causes apply can't be executed in parallel #59863

@wshwsh12

Description

@wshwsh12

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

set tidb_enable_parallel_apply = on;
create table t(a int, b int, index idx(a));
desc select  t3.a from t t3 where (select /*+ inl_join(t1) */  count(*) from t t1 join t t2 on t1.a=t2.a and t1.b>t3.b);

2. What did you expect to see? (Required)

No warnings, apply execute in parallel.

3. What did you see instead (Required)

tidb> drop table t;
Query OK, 0 rows affected (0.02 sec)

tidb> set tidb_enable_parallel_apply = on;
Query OK, 0 rows affected (0.00 sec)

tidb> create table t(a int, b int, index idx(a));
rom t t3 where (select /*+ inl_join(t1) */  count(*) from t t1 join t t2 on t1.a=t2.a and t1.b>t3.b)Query OK, 0 rows affected (0.01 sec)

tidb> desc select  t3.a from t t3 where (select /*+ inl_join(t1) */  count(*) from t t1 join t t2 on t1.a=t2.a and t1.b>t3.b);
+---------------------------------------+--------------+-----------+------------------------+-------------------------------------------------------------------------------------------------------------+
| id                                    | estRows      | task      | access object          | operator info                                                                                               |
+---------------------------------------+--------------+-----------+------------------------+-------------------------------------------------------------------------------------------------------------+
| Projection_14                         | 10000.00     | root      |                        | test.t.a                                                                                                    |
| └─Apply_16                            | 10000.00     | root      |                        | CARTESIAN inner join                                                                                        |
|   ├─TableReader_18(Build)             | 10000.00     | root      |                        | data:TableFullScan_17                                                                                       |
|   │ └─TableFullScan_17                | 10000.00     | cop[tikv] | table:t3               | keep order:false, stats:pseudo                                                                              |
|   └─Selection_19(Probe)               | 8000.00      | root      |                        | Column#10                                                                                                   |
|     └─HashAgg_20                      | 10000.00     | root      |                        | funcs:count(1)->Column#10                                                                                   |
|       └─IndexJoin_39                  | 99900000.00  | root      |                        | inner join, inner:IndexLookUp_38, outer key:test.t.a, inner key:test.t.a, equal cond:eq(test.t.a, test.t.a) |
|         ├─IndexReader_51(Build)       | 99900000.00  | root      |                        | index:IndexFullScan_50                                                                                      |
|         │ └─IndexFullScan_50          | 99900000.00  | cop[tikv] | table:t2, index:idx(a) | keep order:false, stats:pseudo                                                                              |
|         └─IndexLookUp_38(Probe)       | 99900000.00  | root      |                        |                                                                                                             |
|           ├─Selection_36(Build)       | 124875000.00 | cop[tikv] |                        | not(isnull(test.t.a))                                                                                       |
|           │ └─IndexRangeScan_34       | 125000000.00 | cop[tikv] | table:t1, index:idx(a) | range: decided by [eq(test.t.a, test.t.a)], keep order:false, stats:pseudo                                  |
|           └─Selection_37(Probe)       | 99900000.00  | cop[tikv] |                        | gt(test.t.b, test.t.b)                                                                                      |
|             └─TableRowIDScan_35       | 124875000.00 | cop[tikv] | table:t1               | keep order:false, stats:pseudo                                                                              |
+---------------------------------------+--------------+-----------+------------------------+-------------------------------------------------------------------------------------------------------------+
14 rows in set, 1 warning (0.01 sec)

tidb> show warnings;
+---------+------+-------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                               |
+---------+------+-------------------------------------------------------------------------------------------------------+
| Warning | 1105 | Some apply operators can not be executed in parallel: *core.PhysicalIndexJoin doesn't support cloning |
+---------+------+-------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

master

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions