为了更快的定位您的问题,请提供以下信息,谢谢
【详述】多表join查询视图如果有比较复杂的表达式会有统计信息报错
报错信息
【背景】做过哪些操作?
【业务影响】
【是否存算分离】
【StarRocks版本】3.2.14
【集群规模】例如:3fe(1 follower+2observer)+5be(fe与be混部)
【机器信息】CPU虚拟核/内存/网卡,例如:48C/64G/万兆
【联系方式】社区群22 hpp
【附件】
复现数据构造sql
统计信息.sql (3.0 KB)
问题的sql
explain SELECT COUNT(*) AS _count
FROM ((SELECT $f12
FROM (SELECT CONCAT(CONCAT(CASE WHEN _persist_TABLE_5HqSC16dHW_WORKING
.split_sku_no
IS NOT NULL THEN _persist_TABLE_5HqSC16dHW_WORKING
.split_sku_no
ELSE ‘’ END, ‘–’), CASE WHEN _persist_TABLE_5HqSC16dHW_WORKING
.code
IS NOT NULL THEN _persist_TABLE_5HqSC16dHW_WORKING
.code
ELSE ‘’ END) AS $f12
FROM ((SELECT _persist_TABLE_5HqSC16dHW_WORKING
.code
, _persist_TABLE_5HqSC16dHW_WORKING
.split_sku_no
, _persist_TABLE_5HqSC16dHW_WORKING
.customer_id
FROM dev
._persist_TABLE_5HqSC16dHW_WORKING
) AS _persist_TABLE_5HqSC16dHW_WORKING
LEFT JOIN (SELECT _persist_TABLE_lE6FfryyMt_WORKING
.id
FROM ((SELECT _persist_TABLE_lE6FfryyMt_WORKING
.id
, _persist_TABLE_lE6FfryyMt_WORKING
.country_id
FROM dev
._persist_TABLE_lE6FfryyMt_WORKING
) AS _persist_TABLE_lE6FfryyMt_WORKING
LEFT JOIN (SELECT dim_db_erp_country_f
.bsn_id
FROM dev
.dim_db_erp_country_f
GROUP BY dim_db_erp_country_f
.bsn_id
, dim_db_erp_country_f
.name_cn
) AS dim_db_erp_country_f
ON _persist_TABLE_lE6FfryyMt_WORKING
.country_id
= dim_db_erp_country_f
.bsn_id
)) AS t
ON _persist_TABLE_5HqSC16dHW_WORKING
.customer_id
= t
.id
)) AS t1
) AS t2
INNER JOIN (SELECT $f5
FROM (SELECT CONCAT(CONCAT(CASE WHEN _persist_TABLE_u9eoIQAn9J_WORKING
.split_sku_no
IS NOT NULL THEN _persist_TABLE_u9eoIQAn9J_WORKING
.split_sku_no
ELSE ‘’ END, ‘–’), CASE WHEN _persist_TABLE_u9eoIQAn9J_WORKING
.so_code
IS NOT NULL THEN _persist_TABLE_u9eoIQAn9J_WORKING
.so_code
ELSE ‘’ END) AS $f5
FROM dev
._persist_TABLE_u9eoIQAn9J_WORKING
) AS _persist_TABLE_u9eoIQAn9J_WORKING
) AS _persist_TABLE_u9eoIQAn9J_WORKING
ON t2
.$f12
= _persist_TABLE_u9eoIQAn9J_WORKING
.$f5
);
如果切换成正常的表 不走视图是可以查询的