【 TiDB 使用环境】线上、测试、调研
【 TiDB 版本】tidb 6.1
【遇到的问题】tidb explain format = "dot"
不支持 cte?这是bug?
【复现路径】做过哪些操作出现的问题
测试sql:https://docs.pingcap.com/zh/tidb/stable/dev-guide-use-common-table-expression#非递归的-cte
explain format = "dot"
WITH top_50_eldest_authors_cte AS (
SELECT a.id, a.name, (IFNULL(a.death_year, YEAR(NOW())) - a.birth_year) AS age
FROM authors a
ORDER BY age DESC
LIMIT 50
)
SELECT
ANY_VALUE(ta.id) AS author_id,
ANY_VALUE(ta.age) AS author_age,
ANY_VALUE(ta.name) AS author_name,
COUNT(*) AS books
FROM top_50_eldest_authors_cte ta
LEFT JOIN book_authors ba ON ta.id = ba.author_id
GROUP BY ta.id
\G
*************************** 1. row ***************************
dot contents:
digraph Projection_23 {
subgraph cluster23{
node [style=filled, color=lightgrey]
color=black
label = "root"
"Projection_23" -> "HashAgg_24"
"HashAgg_24" -> "HashJoin_26"
"HashJoin_26" -> "CTEFullScan_30"
"HashJoin_26" -> "TableReader_29"
}
subgraph cluster28{
node [style=filled, color=lightgrey]
color=black
label = "cop"
"TableFullScan_28"
}
"TableReader_29" -> "TableFullScan_28"
}
1 row in set (0.01 sec)
【问题现象及影响】
结果只得到了└─TableFullScan_28
,而未包含└─TopN_18
/ └─TableFullScan_17
【附件】
请提供各个组件的 version 信息,如 cdc/tikv,可通过执行 cdc version/tikv-server --version 获取。