最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

optimization - Is it a good idea to run Optimize table query on a table with billions of records in mysql 8 (innodb engine)? - S

programmeradmin3浏览0评论

As part of a maintenance activity we have started deleting unwanted data from our database tables. This is being done to free up space and improve the I/O operation efficiency of our database tables, which has taken a step back lately.

After deleting 1 billion records from table xyz, would it be a good idea to run "Optimize table xyz" query. As per mysql documentation Optimize query (which is essentially a ALTER TABLE .. FORCE) uses ONLINE DDL. Online ddl is supposed to help us continue using a table (concurrent DML operations) when its being altered but what if a table has billions of records and optimize query takes couple of hours to complete. Again as per documentation all the DML operations will be logged in the temporary files when optimize is running and changes will be applied to table once its done.

Still is this a reliable thing to do on a table with billions of records ?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论