Timeline for Adding column into MySQL table size 150GB
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 23, 2020 at 21:04 | comment | added | John | Mysql is extremely limited in the ability to deal with large tables that are being written to, in so many ways. 1) use multiple threads (xargs, parallel, etc) and INSERT the old table into a new table 2) same approach but now REPLACE changed/new rows 3) now write lock the source table 4) same appraoch, REPLACE changed/new rows 5) rename table source to old, new to source 6) unlock This can speed up the process a couple hundred times, the downtime is very low. | |
Jul 5, 2019 at 17:32 | answer | added | Rick James | timeline score: 3 | |
Jul 5, 2019 at 17:29 | comment | added | Rick James | Caution: camba1's suggestion assumes you are not writing to the table during the process. | |
Jul 5, 2019 at 16:20 | comment | added | camba1 | Since you have the space, I would try creating a new table (with the new column), inserting all the data from the old table, dropping the old table, renaming the new table to match the old table's name and the recreating the indexes (this will take time). | |
Jul 5, 2019 at 15:19 | history | edited | Adam Mulla | CC BY-SA 4.0 |
added 57 characters in body
|
Jul 5, 2019 at 14:58 | history | asked | Adam Mulla | CC BY-SA 4.0 |