【详述】问题详细描述
线上生产环境两张表,分别拥有相同建表语句的同步物化视图,通过物化视图进行查询加速之后,发现部分数据缺失,删除重建物化视图解决问题缺失问题,基表没有做任何操作
【背景】做过哪些操作?
【业务影响】
【StarRocks版本】例如:2.5.4
【集群规模】例如:1fe(1 followerr)+3be
【机器信息】CPU虚拟核/内存/网卡,例如:16C/64G/万兆
【联系方式】为了在解决问题过程中能及时联系到您获取一些日志信息,请补充下您的联系方式,例如:社区群4-小李或者邮箱,谢谢
【建表语句】
基表
CREATE TABLE eth_erc_dw (
action_type tinyint(4) NULL DEFAULT “0” COMMENT “”,
source varchar(64) NULL DEFAULT “” COMMENT “”,
address varchar(64) NULL DEFAULT “” COMMENT “”,
target varchar(64) NULL DEFAULT “” COMMENT “”,
transaction_hash varchar(100) NOT NULL COMMENT “”,
block_timestamp bigint(20) NOT NULL COMMENT “”,
value_decimal decimal128(38, 6) NULL COMMENT “”,
target_int bigint(20) NULL DEFAULT “0” COMMENT “”,
value varchar(100) NULL DEFAULT “0” COMMENT “”,
currency_first_trans_time varchar(64) NULL DEFAULT “” COMMENT “”,
currency_last_trans_time varchar(64) NULL DEFAULT “” COMMENT “”,
erc_type varchar(20) NULL DEFAULT “” COMMENT “”,
transaction_int largeint(40) NOT NULL COMMENT “”,
txn_date date NOT NULL COMMENT “”,
block_number bigint(20) NOT NULL COMMENT “”
) ENGINE=OLAP
DUPLICATE KEY(action_type, source, address, target, transaction_hash, block_timestamp, value_decimal)
COMMENT “”
DISTRIBUTED BY HASH(action_type, source) BUCKETS 5000
PROPERTIES (
“replication_num” = “1”,
“in_memory” = “false”,
“storage_format” = “DEFAULT”,
“enable_persistent_index” = “false”,
“compression” = “LZ4”
);
物化视图
CREATE MATERIALIZED VIEW eth_erc_address_info_view1 as
select
source,address,action_type,erc_type,
sum(value_decimal),
count(transaction_hash),
bitmap_union(to_bitmap(target_int)) currency_rival,
min(currency_first_trans_time),
max(currency_last_trans_time)
from sdp.eth_erc_dw
group by source,address,action_type,erc_type;