生产环境,OMS 3.3.1_ce/OMS 4.1.1_CE版本
oms迁移MySQL rocksdb引擎的表到ob时性能低.
场景:
mysql rocksdb版本(Percona-Server-rocksdb-57-5.7.32-35.1)
mysql rocksdb表结构,数据量2亿:
create table rocksdb_test_table ( id bigint(20) unsigned not null auto_increment comment ‘主键id’, mark varchar(64) not null default ‘’ comment ‘’, pname varchar(64) not null default ‘’ comment ‘’, name varchar(10240) not null default ‘’ comment ‘’, create_time datetime not null default current_timestamp comment ‘创建时间’, dt timestamp(3) not null default current_timestamp(3) on update current_timestamp(3) comment ‘’, tk_column varchar(50) not null default ‘’ comment ‘’, email_name varchar(50) not null default ‘’ comment ‘’,
primary key (id),
key idx_create_time (create_time)
) engine=rocksdb;
问题:在oms获取范围的主键id时,这种场景每次会越跑越慢,取下一批次max id 单次消耗10秒左右.
SELECT id FROM dbname.rocksdb_test_table force index(PRIMARY)
WHERE ((id>‘12029153’)) order by id asc LIMIT 199,1
调整了batchSize从200—>10000,跑这个请求还是慢的,但一次迁移量增多了。相对快了一点,等id>xxx大概超过表数据量的15%后,计划就走到primary key的range上,效率就上去了.
请问不知oms中的单一任务,能够手工改一下分片取id的逻辑吗?
比方想改为,加一个and id < xxx+100w的条件
SELECT id FROM dbname .rocksdb_test_table force index(PRIMARY)
WHERE ((id >‘12029153’) and id< xxxxxx+100万) order by id asc LIMIT 199,1