insert数据执行非常慢

【 使用环境 】生产环境
【 OB or 其他组件 】OBServer
【 使用版本 】4.3.1
【问题描述】批量插入很慢。每次插入200条数据,目前数据库内有4000万条数据
【复现路径】
【附件及日志】



1 个赞
集群 server 级资源分配情况

select zone,concat(SVR_IP,’:’,SVR_PORT) observer,
cpu_capacity_max cpu_total,cpu_assigned_max cpu_assigned,
cpu_capacity-cpu_assigned_max as cpu_free,
round(memory_limit/1024/1024/1024,2) as memory_total,
round((memory_limit-mem_capacity)/1024/1024/1024,2) as system_memory,
round(mem_assigned/1024/1024/1024,2) as mem_assigned,
round((mem_capacity-mem_assigned)/1024/1024/1024,2) as memory_free,
round(log_disk_capacity/1024/1024/1024,2) as log_disk_capacity,
round(log_disk_assigned/1024/1024/1024,2) as log_disk_assigned,
round((log_disk_capacity-log_disk_assigned)/1024/1024/1024,2) as log_disk_free,
round((data_disk_capacity/1024/1024/1024),2) as data_disk,
round((data_disk_in_use/1024/1024/1024),2) as data_disk_used,
round((data_disk_capacity-data_disk_in_use)/1024/1024/1024,2) as data_disk_free
from oceanbase.gv$ob_servers;

集群租户级资源分配和磁盘使用情况

select a.zone,a.svr_ip,b.tenant_name,b.tenant_type, a.max_cpu, a.min_cpu,
round(a.memory_size/1024/1024/1024,2) memory_size_gb,
round(a.log_disk_size/1024/1024/1024,2) log_disk_size,
round(a.log_disk_in_use/1024/1024/1024,2) log_disk_in_use,
round(a.data_disk_in_use/1024/1024/1024,2) data_disk_in_use
from oceanbase.gv$ob_units a join oceanbase.dba_ob_tenants b on a.tenant_id=b.tenant_id order by b.tenant_name;

查看当前正在执行的转储/合并任务

SELECT * FROM oceanbase.GV$OB_TABLET_COMPACTION_PROGRESS
WHERE TYPE=‘MINI_MERGE’;

通过 sql 查看执行计划信息

SELECT * FROM oceanbase.GV$OB_PLAN_CACHE_PLAN_stat where query_sql like ‘%关键字%’;

发一下表结构

explain extended查看一下详细的执行计划

1 个赞

另外也可以看看obserer 服务器磁盘情况是否正常

1 个赞

磁盘是正常的

1 个赞

用obdiag 工具,执行一下obdiag check 进行一次巡检,把巡检报告发上来看看。【SOP系列 22 】——故障诊断第一步(自助诊断和诊断信息收集)

1 个赞

我这里企业版也是批量insert比较慢,和sre沟通说目前OB在批量insert的确是有性能问题,我们时部署的单独的定制bp版本才解决掉