为了更快的定位您的问题,请提供以下信息,谢谢
【详述】问题详细描述
【背景】做过哪些操作?
【业务影响】
【StarRocks版本】例如:2.5.7
【集群规模】例如:3fe(1 leader+2floower)+4be
【机器信息】CPU虚拟核/内存/网卡,例如:48C/64G/万兆
【联系方式】为了在解决问题过程中能及时联系到您获取一些日志信息,请补充下您的联系方式,例如:社区群4-小李或者邮箱,谢谢
【问题】:
问题:异步物化视图数据量 与即系查询的数据量 比起来少,在 refesh 物化视图后,数据量没有变化
**物化视图:**
create MATERIALIZED VIEW ic_cyb_cdm.cyb_dwd_byd_otd_data_mon_v
DISTRIBUTED BY HASH(id
) BUCKETS 5
REFRESH ASYNC START
(‘2023-07-27 07:00:00’) EVERY (interval 1 day)
as
SELECT
a.id ,
a.po_code ,
a.vin_no ,
a.ga_online ,
a.leave_factory ,
a.base ,
a.car_series ,
a.province ,
a.city ,
a.dealer_name ,
a.plan_date ,
a.o_type ,
a.fuel_category ,
a.finance_check_time,
a.order_source ,
a.arrive ,
a.exam_plan_date ,
a.appear_date ,
a.shipping_time ,
a.leave_finish_library,
b.model_2020,
if (instr(replace( strleft(a.leave_factory,7),’/’,’-’ ),’-’)=7,
substring(concat(substring(replace( strleft(a.leave_factory,7),’/’,’-’ ),1,5),concat(‘0’,substring(replace( strleft(a.leave_factory,7),’/’,’-’ ),6,7))),1,7),
replace(strleft(a.leave_factory,7),’/’,’-’ )) as search_time,
strleft(a.leave_factory,4) year
from hive.ic_cyb_ods.cyb_ods_byd_otd_data_mon_ds_h a
left join ic_cyb_cdm.cyb_dim_car_series_map_s b on a.car_series = b.car_series
;
刷新:refresh MATERIALIZED VIEW ic_cyb_cdm.cyb_dwd_byd_otd_data_mon_v;
查询:select * from information_schema.task_runs tr where DEFINITION like’%cyb_dwd_byd_otd_data_mon_v%’
执行:select count(1) from ic_cyb_cdm.cyb_dwd_byd_otd_data_mon_v;
**即系查询:**
select count(1) from
(
SELECT
a.id ,
a.po_code ,
a.vin_no ,
a.ga_online ,
a.leave_factory ,
a.base ,
a.car_series ,
a.province ,
a.city ,
a.dealer_name ,
a.plan_date ,
a.o_type ,
a.fuel_category ,
a.finance_check_time,
a.order_source ,
a.arrive ,
a.exam_plan_date ,
a.appear_date ,
a.shipping_time ,
a.leave_finish_library,
b.model_2020,
if (instr(replace( strleft(a.leave_factory,7),’/’,’-’ ),’-’)=7,
substring(concat(substring(replace( strleft(a.leave_factory,7),’/’,’-’ ),1,5),concat(‘0’,substring(replace( strleft(a.leave_factory,7),’/’,’-’ ),6,7))),1,7),
replace(strleft(a.leave_factory,7),’/’,’-’ )) as search_time,
strleft(a.leave_factory,4) year
from hive.ic_cyb_ods.cyb_ods_byd_otd_data_mon_ds_h a
left join ic_cyb_cdm.cyb_dim_car_series_map_s b on a.car_series = b.car_series
)