为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:
【 TiDB 使用环境】
5.1.2. 现在使用CTE问题。
【概述】 场景 + 问题概述
【背景】 做过哪些操作
【现象】 业务和数据库现象
【问题】 当前遇到的问题
【业务影响】
【TiDB 版本】
【应用软件及版本】
【附件】 相关日志及配置信息
- TiUP Cluster Display 信息
- TiUP CLuster Edit config 信息
监控(https://metricstool.pingcap.com/)
- TiDB-Overview Grafana监控
- TiDB Grafana 监控
- TiKV Grafana 监控
- PD Grafana 监控
- 对应模块日志(包含问题前后 1 小时日志)
SELECT
d.year_month_desc ‘年月’,
i.theme ‘主题’,
i.index_name ‘指标’,
e.entity_name ‘组织’,
sc.scenario_name ‘场景’,
p.product_lvel1_name ‘产品大类’,
p.product_name ‘产品中类’,
re.region_name ‘客户区域’,
cu.customer_name ‘客户类型’,
mtd ‘当月累计’,
ytd ‘当年累计’
FROM
v_dwd_total_fact f
LEFT JOIN dwd_gaap_date d ON d.yyyymmdd = f.yyyymmdd
LEFT JOIN v_dwd_total_entity e ON f.entity_code = e.entity_code
LEFT JOIN dwd_gaap_index i ON f.index_id = i.index_id
LEFT JOIN dwd_gaap_scenario sc ON f.scenario_id = sc.scenario_id
LEFT JOIN v_dwd_total_product p ON f.product_code = p.product_code
LEFT JOIN v_dwd_total_region re ON f.region_code = re.region_code
LEFT JOIN v_dwd_total_customer cu ON f.customer_code = cu.customer_code
ORDER BY
f.yyyymmdd,
i.index_id;
执行计划过大,在附件执行计划.txt (7.9 MB)
若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。