如何在不影响生产性能的情况下向18 GB innodb mysql表添加索引? [英] How to add index to 18 GB innodb mysql table without affecting production performance?

查看:203
本文介绍了如何在不影响生产性能的情况下向18 GB innodb mysql表添加索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不影响生产性能的情况下向18 GB的innodb mysql表添加索引?该表经常被访问,我刚刚尝试更改该表,结果发现它锁定了200多个查询,这对性能不利.还有其他方法吗?

How can I add index to an 18 GB innodb mysql table without affecting the production performance? The table is frequently accessed, I tried altering the table just now and it turns up to have locked more than 200 queries out, and that's bad for performance. Are there any other ways to do it?

推荐答案

TheOnly92-还有另一种选择,甚至是亚马逊和ebay都可以使用.在站点无法访问的情况下,没有足够的维护期并不被认为是不良"形式.在这种情况下,您会看到显示404维护页面,并带有用户友好的消息,表明该网站在....等小时之间正在进行必要的升级.

TheOnly92 - there is another option, one that even amazon and ebay use. it's not considered 'bad' form to have infrequesnt maintenence periods where the site is unaccesible. on those occassions, you'll see a 404 maintenence page being displayed with a user friendly messge saying that the site is undergoing essential upgrades between the hours of .... etc

这可能是最实用的解决方案,因为创建此页面将花费您5分钟的时间,而另一个选项可能要花很多时间才能弄清楚,而实现起来还要花很多时间.而且,由于这种情况很少见,因此不太可能因为这样的消息或一段停机时间而推迟您的用户.

this might be the most pragmatic solution as creating this page will take you 5 mins, whereas the other option may take many hours to figure out and many more to implement. also, as it would be infrequent, then it's unlikely that your users would be put off by such a message or period of downtime.

吉姆

这篇关于如何在不影响生产性能的情况下向18 GB innodb mysql表添加索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆