# adding a column to a large table

**URL:** <https://forums.percona.com/t/adding-a-column-to-a-large-table/916>\
**Category:** Other MySQL® Questions\
**Created:** [September 10, 2008, 9:09am UTC](https://forums.percona.com/t/adding-a-column-to-a-large-table/916 "2008-09-10T09:09:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jspath](https://avatars.discourse-cdn.com/v4/letter/j/f08c70/32.png) [@jspath](https://forums.percona.com/u/jspath)\
**Post date:** [September 10, 2008, 9:09am UTC](https://forums.percona.com/t/adding-a-column-to-a-large-table/916/1 "2008-09-10T09:09:51Z")

</div>

I’m trying to add a column to a fairly large innodb table (14.6m rows) and the ALTER TABLE query has been running for almost 24 hours. This is under MySQL 5.0.22

Is there a better/faster way to add the column that would only take an hour or two? It’s been running for so long I’m wary of trying a new method unless I know it will finish relatively quickly.

Along these lines, is there a way to measure the progress of the ALTER TABLE? I’ve been monitoring the size of the ibdata1 file, but that’s not a very good indicator, as other things are happening the database while the alter is running.

Thanks!

---

<div class="post-metadata">

**Author:** ![debug](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/debug/32/772_2.png) [@debug](https://forums.percona.com/u/debug)\
**Post date:** [September 11, 2008, 3:26am UTC](https://forums.percona.com/t/adding-a-column-to-a-large-table/916/2 "2008-09-11T03:26:01Z")

</div>

There are some tricks with making alter work faster. (see [http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-ma](http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-ma) ke-alter-table-online-for-certain-changes/#comment-182689 for details), But unfortunately it does not help in case when you add columns.

---

<div class="post-metadata">

**Author:** ![jspath](https://avatars.discourse-cdn.com/v4/letter/j/f08c70/32.png) [@jspath](https://forums.percona.com/u/jspath)\
**Post date:** [September 11, 2008, 7:21am UTC](https://forums.percona.com/t/adding-a-column-to-a-large-table/916/3 "2008-09-11T07:21:51Z")

</div>

It finally finished last night after about 34 hours.

I was hoping there was some way I could export the table, import into a new table, and copy over the old one, but I guess that is what MySQL is doing internally anyways, huh.
