Fastest way to add new column in MySQL What is the fastest way to add a new column to an existing table in MySQL?

I have tried ALTER TABLE tbl ADD COLUMN ..., but that takes quite a while since there are many rows out there.
That is the fastest way in terms of getting the job done. There is no way around it directly as you have to rearrange the table structure for the new column.

If you need to keep read access to the data while the change is made but can live without write access during that time you could:


Create a fresh table with the extra column
Lock the table from updates (set all users to not have the needed permissions for instance)
Copy the data from old to new
Rename the old table to something else
Rename the new table to the old name
Drop the old table


There will still be no access at all between steps 4 and 5, and the whole process will take far longer, and of course you don't have insert/update ability during the process, but the complete outage (including reads) is only steps 4 and 5 not the whole process. As noted by ypercube in the comments, if the affected table has any foreign keys directed toward it these will need modifying and that will cause locks on the affected tables, also when creating the table (or before renaming it) make sure you include any indexes and constraints. Also any triggers operating on the old table will need to be added too (after the data has been copied).

A hacky workaround would be to put the new column(s) in a new table and just join that in to any query that needs them negating the need to modify exiting structures at all, but this means you have to be careful to update both tables correctly when needed and the LEFT OUTER JOIN to pick up the extra values is both more work for you (and other developers on the project now and in future) and more work that the query planner/runner have to do in order to process your queries, so there are going to be performance differences.

It should go without saying: if you intend to try any of the above, as with any structural change (in fact any change!), do so in a testing environment first before touching production databases.

tl;dr: No, there isn't really a quicker way.