繁体   English   中英

将巨大的分区 My_ISAM 表复制到单个 innoDB 表中

[英]Copying huge partitioned My_ISAM table into a single innoDB table

我有一个巨大的 My_ISAM 表“msg_c_total”,它实际上分为“msg_c_1”到“msg_c_200”。 我想用新名称制作“msg_c_total”的 innoDB 副本。 我仍然无法更改原始表(并将其更改为 innoDB),因为某些存储过程仍然适用于分区表。

我创建了一个新的 innoDB 表(只有一个索引以避免插入过程中速度变慢)。 然后我使用了以下命令。 30 分钟后,查询仍在运行,新表中没有记录。 MySQL 也逐渐变得无响应。

INSERT into msg_new SELECT * FROM msg_c_total

1- Percona 工具是否提供制作副本的功能(希望逐步进行以避免服务器严重减速)。

2- 有没有办法逐渐运行上述“插入”(并且自动不向选择命令添加范围)。

谢谢。

服务器配置:

ft_min_word_len         =3

connect_timeout         =15
join_buffer_size        =4M
key_buffer_size         =6G
max_allowed_packet      =2M
max_connections         =2600
max_connect_errors      =30
myisam_sort_buffer_size =528M
read_buffer_size        =4M
read_rnd_buffer_size    =4M
sort_buffer_size        =4M
table_cache             =512
thread_cache_size       =256
thread_concurrency      =16
wait_timeout            =120
max_tmp_tables          =512
tmp_table_size          =512M
max_heap_table_size     =512M
interactive_timeout     =1800
query_cache_type        =1
query_cache_size        =512M
skip-external-locking
skip-name-resolve
myisam-recover          =FORCE,BACKUP
concurrent_insert       =2
open-files              =30000
event_scheduler=ON
innodb_file_per_table
innodb_data_home_dir            = /app/mysql
innodb_data_file_path           = ibdata1:10M:autoextend
innodb_buffer_pool_size         = 30G
innodb_additional_mem_pool_size = 256M
innodb_log_file_size            = 1256M
innodb_log_buffer_size          = 64M
innodb_flush_log_at_trx_commit  = 2
innodb_lock_wait_timeout        = 50
innodb_table_locks              = 0
innodb_support_xa               = 0
innodb_thread_concurrency       = 16
skip-innodb_doublewrite
innodb_buffer_pool_restore_at_startup = 1

long_query_time                 = 3

MyISAM 只锁定整个表。 SELECT正在阻止所有写入。

分区是指“PARTITION BY...”和msg_c_1分区名称吗? 或者msg_c_1是一个表名并且您正在使用代码来选择合适的

请提供SHOW CREATE TABLE 有很多字幕需要检查。

什么是“表”分区?

200 是相当多的分区。

什么是PRIMARY KEY 是否有任何UNIQUE键?

可能会推荐像 http://localhost/rjweb/mysql/doc.php/deletebig#deleting_in_chunks 这样的东西来分块复制。 (忽略“删除”和“更新”;专注于分块。)但是,由于 PK 未与 MyISAM 中的数据聚类,因此某些性能将不可用。

多少内存? 什么是设置key_buffer_sizeinnodb_buffer_pool_size 请参阅 http://localhost/rjweb/mysql/doc.php/memory 了解使用两个引擎时的操作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM