iowasetr.blogg.se

Mysql add column huge table
Mysql add column huge table









mysql add column huge table

The gh-ost command comes with many switches. Understanding the Important Switches in the gh-ost command If you run the command without –execute, then it does not actually migrate the data but gives you any redflags. Gh-ost provides a way to do a mock dry run of the migration without actually running the migration. Show global variables like 'binlog_format' You can check both of these conditions with the following commands. These can be found in the parameter groups in RDS.

#MYSQL ADD COLUMN HUGE TABLE INSTALL#

deb file and install like this: $wget įor gh-ost to work on RDS, you have to enable binlogs and set the binlog format to rows. Installing on Ubuntu was pretty straightforward. You want control to check and double check everything. Postpone cut over feature – when you are doing an alter on a key table on your production database, you are scared.That seemed a lot more robust way of achieving this. binlog not triggers – gh-ost uses the binlog which is the basis of all Mysql replication.Least learning curve – even though the documentation was not very beginner friendly, I was able to figure this out pretty quickly.However, we used gh-ost for the following reasons: Once the replication is done, you are set.Īnother option is an online schema change by Facebook which seems to be popular. It basically makes a ghost table (with new schema), points a bunch of triggers from the original table to the ghost table.

mysql add column huge table

One option was percona-online-schema-change which is pretty popular to do this kind of stuff. That causes some more complications like no access to super user. Doing an ALTER will lock the table for a few hours – not acceptable. Few minutes is acceptable, but nothing in hours. We played around with other options, but since it was likely to become a column with many WHERE queries, we decided that we had to add the column.īrowntape is an eCommerce web app and that is a 24×7 business, so we can’t take much downtime. Business requirements have evolved and recently we needed to add a new column to a table with 50 million rows. Our production database has some key tables. I am sure if you’ve googled your way to this article, you already know the problem but here you go.











Mysql add column huge table