1. 阿里云分布式数据库 PolarDB-X 手册学习

官方文档:《云原生分布式数据库 PolarDB-X

--   物理执行计划
  EXPLAIN EXECUTE select * from order_goods limit 100
  
  --  表结构 
  show create table lp_order_goods
 
-- 全局二级索引
CREATE GLOBAL INDEX `g_i_order_id` ON order_goods (`order_id`) dbpartition by hash(`order_id`);

2.mysql 数据导入优化

my.ini配置

; 禁用日志
disable-log-bin

bulk_insert_buffer_size = 512M
innodb_flush_log_at_trx_commit = 0
# max_allowed_packet:unsigned value 10737418240 adjusted to 1073741824
max_allowed_packet = 1G 
# 电脑是10核心20线程,写入较多
innodb_read_io_threads = 5
innodb_write_io_threads = 15

参考《充分利用CPU多核的处理能力 innodb_read_io_threads和innodb_write_io_threads


沧浪水
97 声望12 粉丝