pingcap / pingcap/tidb

explain analyze loses some msg.

Open
#35,119 0 comments 0 reactions 0 assignees View on GitHub
severity/moderate sig/planner type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)

### 2. What did you expect to see? (Required)
```
mysql> explain analyze SELECT l_orderkey, avg(l_quantity) FROM lineitem where l_shipdate BETWEEN '1995-01-01' AND '1996-12-31' GROUP BY l_orderkey limit 100000;
+------------------------------------------+--------------+---------+-------------------+----------------+----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+------+
| id | estRows | actRows | task | access object | execution info | operator info | memory | disk |
+------------------------------------------+--------------+---------+-------------------+----------------+----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+------+
| Projection_8 | 100000.00 | 100000 | root | | time:2.11s, loops:100, Concurrency:5 | tpch_100.lineitem.l_orderkey, Column#18 | 485.4 KB | N/A |
| └─Limit_11 | 100000.00 | 100000 | root | | time:2.11s, loops:100 | offset:0, count:100000 | N/A | N/A |
| └─TableReader_47 | 100000.00 | 100410 | root | | time:2.11s, loops:99, cop_task: {num: 2, max: 0s, min: 0s, avg: 0s, p95: 0s, copr_cache_hit_ratio: 0.00} | data:ExchangeSender_46 | N/A | N/A |
| └─ExchangeSender_46 | 100000.00 | 0 | batchCop[tiflash] | | | ExchangeType: PassThrough | N/A | N/A |
| └─Projection_42 | 100000.00 | 0 | batchCop[tiflash] | | | div(Column#18, cast(case(eq(Column#23, 0), 1, Column#23), decimal(20,0) BINARY))->Column#18, tpch_100.lineitem.l_orderkey | N/A | N/A |
| └─HashAgg_43 | 100000.00 | 0 | batchCop[tiflash] | | | group by:tpch_100.lineitem.l_orderkey, funcs:sum(Column#24)->Column#23, funcs:sum(Column#25)->Column#18, funcs:firstrow(tpch_100.lineitem.l_orderkey)->tpch_100.lineitem.l_orderkey | N/A | N/A |
| └─ExchangeReceiver_45 | 100000.00 | 0 | batchCop[tiflash] | | | | N/A | N/A |
| └─ExchangeSender_44 | 100000.00 | 0 | batchCop[tiflash] | | | ExchangeType: HashPartition, Hash Cols: [name: tpch_100.lineitem.l_orderkey, collate: binary] | N/A | N/A |
| └─HashAgg_17 | 100000.00 | 0 | batchCop[tiflash] | | | group by:tpch_100.lineitem.l_orderkey, funcs:count(tpch_100.lineitem.l_quantity)->Column#24, funcs:sum(tpch_100.lineitem.l_quantity)->Column#25 | N/A | N/A |
| └─Selection_41 | 180874220.69 | 0 | batchCop[tiflash] | | | ge(tpch_100.lineitem.l_shipdate, 1995-01-01 00:00:00.000000), le(tpch_100.lineitem.l_shipdate, 1996-12-31 00:00:00.000000) | N/A | N/A |
| └─TableFullScan_40 | 600037902.00 | 0 | batchCop[tiflash] | table:lineitem | | keep order:false | N/A | N/A |
+------------------------------------------+--------------+---------+-------------------+----------------+----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+------+
11 rows in set (2.19 sec)

mysql> explain analyze SELECT l_orderkey,count(*),avg(l_discount) as avg_disc, sum(l_quantity) as sum_qty FROM lineitem where l_shipdate BETWEEN '1995-01-01' AND '1996-12-31' GROUP BY l_orderkey limit 100000;
+------------------------------------------+--------------+---------+-------------------+----------------+----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+------+
| id | estRows | actRows | task | access object | execution info | operator info | memory | disk |
+------------------------------------------+--------------+---------+-------------------+----------------+----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+------+
| Projection_8 | 100000.00 | 100000 | root | | time:2.95s, loops:100, Concurrency:5 | tpch_100.lineitem.l_orderkey, Column#18, Column#19, Column#20 | 970.8 KB | N/A |
| └─Limit_11 | 100000.00 | 100000 | root | | time:2.95s, loops:100 | offset:0, count:100000 | N/A | N/A |
| └─TableReader_47 | 100000.00 | 100410 | root | | time:2.95s, loops:99, cop_task: {num: 2, max: 0s, min: 0s, avg: 0s, p95: 0s, copr_cache_hit_ratio: 0.00} | data:ExchangeSender_46 | N/A | N/A |
| └─ExchangeSender_46 | 100000.00 | 0 | batchCop[tiflash] | | | ExchangeType: PassThrough | N/A | N/A |
| └─Projection_42 | 100000.00 | 0 | batchCop[tiflash] | | | Column#18, div(Column#19, cast(case(eq(Column#27, 0), 1, Column#27), decimal(20,0) BINARY))->Column#19, Column#20, tpch_100.lineitem.l_orderkey | N/A | N/A |
| └─HashAgg_43 | 100000.00 | 0 | batchCop[tiflash] | | | group by:tpch_100.lineitem.l_orderkey, funcs:sum(Column#28)->Column#18, funcs:sum(Column#29)->Column#27, funcs:sum(Column#30)->Column#19, funcs:sum(Column#31)->Column#20, funcs:firstrow(tpch_100.lineitem.l_orderkey)->tpch_100.lineitem.l_orderkey | N/A | N/A |
| └─ExchangeReceiver_45 | 100000.00 | 0 | batchCop[tiflash] | | | | N/A | N/A |
| └─ExchangeSender_44 | 100000.00 | 0 | batchCop[tiflash] | | | ExchangeType: HashPartition, Hash Cols: [name: tpch_100.lineitem.l_orderkey, collate: binary] | N/A | N/A |
| └─HashAgg_17 | 100000.00 | 0 | batchCop[tiflash] | | | group by:tpch_100.lineitem.l_orderkey, funcs:count(1)->Column#28, funcs:count(tpch_100.lineitem.l_discount)->Column#29, funcs:sum(tpch_100.lineitem.l_discount)->Column#30, funcs:sum(tpch_100.lineitem.l_quantity)->Column#31 | N/A | N/A |
| └─Selection_41 | 180874220.69 | 0 | batchCop[tiflash] | | | ge(tpch_100.lineitem.l_shipdate, 1995-01-01 00:00:00.000000), le(tpch_100.lineitem.l_shipdate, 1996-12-31 00:00:00.000000) | N/A | N/A |
| └─TableFullScan_40 | 600037902.00 | 0 | batchCop[tiflash] | table:lineitem | | keep order:false | N/A | N/A |
+------------------------------------------+--------------+---------+-------------------+----------------+----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+------+
11 rows in set (3.01 sec)
```
### 3. What did you see instead (Required)

### 4. What is your TiDB version? (Required)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.