# How to add new column in a big table

**URL:** <https://forums.percona.com/t/how-to-add-new-column-in-a-big-table/4942>\
**Category:** Percona Server for MySQL 5.6\
**Created:** [June 25, 2016, 3:14am UTC](https://forums.percona.com/t/how-to-add-new-column-in-a-big-table/4942 "2016-06-25T03:14:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xsauce](https://avatars.discourse-cdn.com/v4/letter/x/e0b2c6/32.png) [@xsauce](https://forums.percona.com/u/xsauce)\
**Post date:** [June 25, 2016, 3:14am UTC](https://forums.percona.com/t/how-to-add-new-column-in-a-big-table/4942/1 "2016-06-25T03:14:28Z")

</div>

Hello,  
I am working on finding the fastest way to add new column in a big table. The big table has about 30 millions rows and 30 columns, and another three big tables refers to its primary key. Our database is Percona 5.6.28. Engine is Innodb, I know this is a hard work in MySQL.  
The current way I thought after some tests:

1. set sql\_log\_bin = 0
2. Create new table with new column and no second indexes.
3. Insert into old table select new table. It takes about 1 hours 30 minutes.
4. Add 7 indexes same as old table’s ones to new table once, It takes about 5 hours 30 minutes.
5. set FOREIGN\_KEY\_CHECKS=0, drop old table, It takes 3 seconds.
6. Rename new table name to old table name

The process cost about 7 hours.  
step 4,5 is same as pt-online-schema-change tools -drop swap.

Until now, I don’t know how to improve the process. I want to short time to 4 hours. Is it possible?
