TiDB 5.1.1 分区表 TiFlash MPP 不生效

【 TiDB 使用环境】
tidb 5.1.1

【问题】 分区表 tiflash mpp不生效

image

执行计划
执行计划.txt (508.4 KB)
SQL
SQL.txt (4.3 KB)

如果想要 TiDB 忽略优化器的代价估算,强制使用 MPP,可以通过如下语句来设置:
set @@session.tidb_allow_mpp=1;
set @@session.tidb_enforce_mpp=1;

https://docs.pingcap.com/zh/tidb/stable/use-tiflash#控制是否选择-mpp-模式

想先确认一个信息,根据执行计划看,没有出现 PartitionUnion 算子,是否意味着该 query 是对某一个分区的查询?

所以这边的疑惑是,这个查询没有走到 TiFlash 对吧?

如果以上答案都是“是”,可以先检查一下动态裁剪模式是否开启(默认关闭),方法参考:https://docs.pingcap.com/zh/tidb/stable/partitioned-table#动态裁剪模式

TiFlash MPP 目前只支持了动态裁剪模式使用分区表,对于静态裁剪模式就不会走到 TiFlash MPP。可以尝试打开上面的开关,再看是否能够走 TiFlash。

谢谢。

2赞

cmag cag 用了MPP , sgc 用了tiflash 但是没有MPP

1赞

设置了这两个 ,执行计划还是没有用到MPP
set @@session.tidb_allow_mpp=1;
set @@session.tidb_enforce_mpp=1;

1赞

补充执行计划截图

1赞

开启动态裁剪报错

SQL mode 没有group by

1赞

@foxchan
dynamic-mode 目前还是实验性功能,目前内部正在测试中;
能提供下具体的错误栈信息吗(TiDB 日志里面有),我们继续调查一下;

1赞

信息如下:

[2021/08/16 14:03:41.416 +08:00] [ERROR] [adapter.go:142] [“execute sql panic”] [conn=255023] [sql=“EXPLAIN SELECT\n agent_creative_id,\n agent_material_id,\n adcreative_name,\n ad_id,\n account_id,\n account_name,\n ad_name,\n project_name,\n project_id,\n product_id,\n product_name,\n customer_id,\n customer_name,\n agent_material_type,\n agent_material_status,\n agent_material_count,\n start_time,\n end_time,\n DATE,\n HOUR,\n SUM(cost) AS cost,\n SUM(impression) AS impression,\n SUM(click) AS click,\n SUM(conversions_count) AS conversions_count,\n SUM(video_play_count) AS video_play_count,\n SUM(video_outer_play_count) AS video_outer_play_count,\n SUM(video_outer_play100_count) AS video_outer_play100_count,\n SUM(video_outer_play_time_count) AS video_outer_play_time_count\nFROM\n (\n SELECT\n a.agent_creative_id AS agent_creative_id,\n a.agent_material_id AS agent_material_id,\n a.creative_title AS adcreative_name,\n a.ad_id,\n a.advertiser_id AS account_id,\n a.NAME AS account_name,\n a.ad_name,\n a.project_name,\n a.project_id,\n a.product_id,\n a.product_name,\n a.customer_id,\n a.customer_name,\n a.agent_material_type AS agent_material_type,\n a.agent_material_status AS agent_material_status,\n a.agent_material_count AS agent_material_count,\n a.start_time AS start_time,\n a.end_time AS end_time,\n b.date,\n b.HOUR,\n b.cost / a.agent_material_count AS cost,\n b.view_count / a.agent_material_count AS impression,\n b.valid_click_count / a.agent_material_count AS click,\n b.ctr,\n b.conversions_count / a.agent_material_count AS conversions_count,\n b.conversions_rate,\n b.conversions_cost,\n b.video_play_count,\n b.video_outer_play_count,\n b.video_outer_play100_count,\n b.video_outer_play_time_count,\n b.video_outer_play100_count / video_outer_play_count AS video_play_over_rate\n FROM\n (\n SELECT\n cmag.agent_creative_id AS agent_creative_id,\n cmag.agent_material_id AS agent_material_id,\n sga.ad_id,\n ga.advertiser_id,\n ga.name,\n sga.ad_name,\n ep.project_name,\n ep.project_id,\n pd.id AS product_id,\n pd.product_name,\n cmag.agent_material_type AS agent_material_type,\n cmag.agent_material_status AS agent_material_status,\n cag.agent_material_count AS agent_material_count,\n cag.start_time AS start_time,\n cag.end_time AS end_time,\n yfc.id AS customer_id,\n yfc.customer_short_name AS customer_name,\n sgc.creative_title\n FROM\n creative_material_agent_tt cmag\n LEFT JOIN creative_agent_tt cag ON cmag.agent_creative_id = cag.agent_creative_id\n LEFT JOIN synads_tt_creative sgc ON cag.agent_creative_id = sgc.creative_id\n LEFT JOIN synads_tt_ad sga ON sgc.ad_id = sga.ad_id\n LEFT JOIN tt_advertiser ga ON sga.advertiser_id = ga.advertiser_id\n LEFT JOIN emarbox_project ep ON ga.project_id = ep.project_id\n LEFT JOIN yxt_finance_customer_entity yfce ON ep.pig_advertiser_id = yfce.id\n LEFT JOIN yxt_finance_customer yfc ON yfce.customer_id = yfc.id\n LEFT JOIN product pd ON pd.id = ep.product_id\n GROUP BY\n cmag.agent_creative_id\n ) a\n LEFT JOIN (\n SELECT\n creative_id,\n DATE,\n HOUR,\n SUM(cost) AS cost,\n SUM(ttshow) AS view_count,\n SUM(click) AS valid_click_count,\n SUM(click) / SUM(ttshow) AS ctr,\n SUM(ttconvert) AS conversions_count,\n SUM(ttconvert) / SUM(click) AS conversions_rate,\n SUM(cost) / SUM(ttconvert) AS conversions_cost,\n SUM(total_play) AS video_play_count,\n SUM(valid_play) AS video_outer_play_count,\n SUM(play_100_feed_break) AS video_outer_play100_count,\n AVG(average_play_time_per_play) AS video_outer_play_time_count\n FROM\n synrpt_tt_creative\n WHERE\n DATE = ‘2021-08-12’\n AND HOUR = 11\n GROUP BY\n creative_id,\n HOUR\n ) b ON a.agent_creative_id = b.creative_id\n WHERE\n 1 = 1\n AND b.cost IS NOT NULL\n ) t\nGROUP BY\n agent_material_id,\n account_id,\n HOUR”] [stack=“github.com/pingcap/tidb/executor.(*recordSet).Next.func1\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/adapter.go:142\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:965\nruntime.goPanicIndex\n\t/usr/local/go/src/runtime/panic.go:88\ngithub.com/pingcap/tidb/planner/core.makeRangeColumnPruner\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/rule_partition_processor.go:1459\ngithub.com/pingcap/tidb/planner/core.(*partitionProcessor).pruneRangeColumnsPartition\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/rule_partition_processor.go:1440\ngithub.com/pingcap/tidb/planner/core.(*partitionProcessor).pruneRangePartition\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/rule_partition_processor.go:808\ngithub.com/pingcap/tidb/planner/core.PartitionPruning\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/partition_prune.go:40\ngithub.com/pingcap/tidb/planner/core.partitionAccessObject\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/explain.go:321\ngithub.com/pingcap/tidb/planner/core.(*PhysicalTableReader).accessObject\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/explain.go:316\ngithub.com/pingcap/tidb/planner/core.(*Explain).getOperatorInfo\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1336\ngithub.com/pingcap/tidb/planner/core.(*Explain).prepareOperatorInfo\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1293\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1138\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).RenderResult\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1093\ngithub.com/pingcap/tidb/executor.(*ExplainExec).generateExplainInfo\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/explain.go:103\ngithub.com/pingcap/tidb/executor.(*ExplainExec).Next\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/explain.go:54\ngithub.com/pingcap/tidb/executor.Next\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/executor.go:286\ngithub.com/pingcap/tidb/executor.(*recordSet).Next\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/adapter.go:145\ngithub.com/pingcap/tidb/server.(*tidbResultSet).Next\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/driver_tidb.go:304\ngithub.com/pingcap/tidb/server.(*clientConn).writeChunks\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1875\ngithub.com/pingcap/tidb/server.(*clientConn).writeResultset\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1823\ngithub.com/pingcap/tidb/server.(*clientConn).handleStmt\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1717\ngithub.com/pingcap/tidb/server.(*clientConn).handleQuery\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1563\ngithub.com/pingcap/tidb/server.(*clientConn).dispatch\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1097\ngithub.com/pingcap/tidb/server.(*clientConn).Run\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:860\ngithub.com/pingcap/tidb/server.(*Server).onConn\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/server.go:485”]
[2021/08/16 14:03:41.419 +08:00] [INFO] [conn.go:877] [“command dispatched failed”] [conn=255023] [connInfo=“id:255023, addr:xxx.xxx.xxx.xxx:64354 status:10, collation:utf8_general_ci, user:root”] [command=Query] [status=“inTxn:0, autocommit:1”] [sql=“EXPLAIN SELECT\n agent_creative_id,\n agent_material_id,\n adcreative_name,\n ad_id,\n account_id,\n account_name,\n ad_name,\n project_name,\n project_id,\n product_id,\n product_name,\n customer_id,\n customer_name,\n agent_material_type,\n agent_material_status,\n agent_material_count,\n start_time,\n end_time,\n DATE,\n HOUR,\n SUM(cost) AS cost,\n SUM(impression) AS impression,\n SUM(click) AS click,\n SUM(conversions_count) AS conversions_count,\n SUM(video_play_count) AS video_play_count,\n SUM(video_outer_play_count) AS video_outer_play_count,\n SUM(video_outer_play100_count) AS video_outer_play100_count,\n SUM(video_outer_play_time_count) AS video_outer_play_time_count\nFROM\n (\n SELECT\n a.agent_creative_id AS agent_creative_id,\n a.agent_material_id AS agent_material_id,\n a.creative_title AS adcreative_name,\n a.ad_id,\n a.advertiser_id AS account_id,\n a.NAME AS account_name,\n a.ad_name,\n a.project_name,\n a.project_id,\n a.product_id,\n a.product_name,\n a.customer_id,\n a.customer_name,\n a.agent_material_type AS agent_material_type,\n a.agent_material_status AS agent_material_status,\n a.agent_material_count AS agent_material_count,\n a.start_time AS start_time,\n a.end_time AS end_time,\n b.date,\n b.HOUR,\n b.cost / a.agent_material_count AS cost,\n b.view_count / a.agent_material_count AS impression,\n b.valid_click_count / a.agent_material_count AS click,\n b.ctr,\n b.conversions_count / a.agent_material_count AS conversions_count,\n b.conversions_rate,\n b.conversions_cost,\n b.video_play_count,\n b.video_outer_play_count,\n b.video_outer_play100_count,\n b.video_outer_play_time_count,\n b.video_outer_play100_count / video_outer_play_count AS video_play_over_rate\n FROM\n (\n SELECT\n cmag.agent_creative_id AS agent_creative_id,\n cmag.agent_material_id AS agent_material_id,\n sga.ad_id,\n ga.advertiser_id,\n ga.name,\n sga.ad_name,\n ep.project_name,\n ep.project_id,\n pd.id AS product_id,\n pd.product_name,\n cmag.agent_material_type AS agent_material_type,\n cmag.agent_material_status AS agent_material_status,\n cag.agent_material_count AS agent_material_count,\n cag.start_time AS start_time,\n cag.end_time AS end_time,\n yfc.id AS customer_id,\n yfc.customer_short_name AS customer_name,\n sgc.creative_title\n FROM\n creative_material_agent_tt cmag\n LEFT JOIN creative_agent_tt cag ON cmag.agent_creative_id = cag.agent_creative_id\n LEFT JOIN synads_tt_creative sgc ON cag.agent_creative_id = sgc.creative_id\n LEFT JOIN synads_tt_ad sga ON sgc.ad_id = sga.ad_id\n LEFT JOIN tt_advertiser ga ON sga.advertiser_id = ga.advertiser_id\n LEFT JOIN emarbox_project ep ON ga.project_id = ep.project_id\n LEFT JOIN yxt_finance_customer_entity yfce ON ep.pig_advertiser_id = yfce.id\n LEFT JOIN yxt_finance_customer yfc ON yfce.customer_id = yfc.id\n LEFT JOIN product pd ON pd.id = ep.product_id\n GROUP BY\n cmag.agent_creative_id\n ) a\n LEFT JOIN (\n SELECT\n creative_id,\n DATE,\n HOUR,\n SUM(cost) AS cost,\n SUM(ttshow) AS view_count,\n SUM(click) AS valid_click_count,\n SUM(click) / SUM(ttshow) AS ctr,\n SUM(ttconvert) AS conversions_count,\n SUM(ttconvert) / SUM(click) AS conversions_rate,\n SUM(cost) / SUM(ttconvert) AS conversions_cost,\n SUM(total_play) AS video_play_count,\n SUM(valid_play) AS video_outer_play_count,\n SUM(play_100_feed_break) AS video_outer_play100_count,\n AVG(average_play_time_per_play) AS video_outer_play_time_count\n FROM\n synrpt_tt_creative\n WHERE\n DATE = ‘2021-08-12’\n AND HOUR = 11\n GROUP BY\n creative_id,\n HOUR\n (len: 4246)”] [txn_mode=PESSIMISTIC] [err=“runtime error: index out of range [-1]\ngithub.com/pingcap/tidb/executor.(*recordSet).Next.func1\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/adapter.go:141\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:965\nruntime.goPanicIndex\n\t/usr/local/go/src/runtime/panic.go:88\ngithub.com/pingcap/tidb/planner/core.makeRangeColumnPruner\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/rule_partition_processor.go:1459\ngithub.com/pingcap/tidb/planner/core.(*partitionProcessor).pruneRangeColumnsPartition\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/rule_partition_processor.go:1440\ngithub.com/pingcap/tidb/planner/core.(*partitionProcessor).pruneRangePartition\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/rule_partition_processor.go:808\ngithub.com/pingcap/tidb/planner/core.PartitionPruning\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/partition_prune.go:40\ngithub.com/pingcap/tidb/planner/core.partitionAccessObject\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/explain.go:321\ngithub.com/pingcap/tidb/planner/core.(*PhysicalTableReader).accessObject\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/explain.go:316\ngithub.com/pingcap/tidb/planner/core.(*Explain).getOperatorInfo\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1336\ngithub.com/pingcap/tidb/planner/core.(*Explain).prepareOperatorInfo\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1293\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1138\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).explainPlanInRowFormat\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1185\ngithub.com/pingcap/tidb/planner/core.(*Explain).RenderResult\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:1093\ngithub.com/pingcap/tidb/executor.(*ExplainExec).generateExplainInfo\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/explain.go:103\ngithub.com/pingcap/tidb/executor.(*ExplainExec).Next\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/explain.go:54\ngithub.com/pingcap/tidb/executor.Next\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/executor.go:286\ngithub.com/pingcap/tidb/executor.(*recordSet).Next\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/adapter.go:145\ngithub.com/pingcap/tidb/server.(*tidbResultSet).Next\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/driver_tidb.go:304\ngithub.com/pingcap/tidb/server.(*clientConn).writeChunks\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1875\ngithub.com/pingcap/tidb/server.(*clientConn).writeResultset\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1823”]
[2021/08/16 14:03:45.187 +08:00] [WARN] [pd.go:131] [“get timestamp too slow”] [“cost time”=176.688348ms]预格式化文本

1赞

多谢,分析中,有进展会尽快同步。

1赞

不好意思回复慢了,分析了一下栈信息,基本确认是分区裁剪的问题,要彻底定位和修复需要复现一下,才能比较好进一步分析;能否提供一下这几个表的 schema 信息,我这边好本地复现一下;
@foxchan @yilong

1赞

scheme.txt (22.0 KB)

1赞

感谢,不过 mbg_core 里面的表是不是缺失了,那几个 View 创建不成功;
@foxchan

1赞

补充了,在最下面。你看看
scheme.txt (33.8 KB)

1赞

@foxchan 不好意思回复晚了,已经确认是 MPP + dynamic-mode 的兼容性问题,先建了个 issue 记录:https://github.com/pingcap/tidb/issues/27674 (数据已经脱敏);
预计在这个开发周期(9-10 月)修复;

好的,感谢回复