I have a very big MySQL table (millions of rows) that gets new data very 20 minutes. I did a mistake at first and have a timestamp data, while what I really wanted was a datetime column. How can I either eidt the current table or migrate it to a new one, as fast as possible WHILE still being able to append new data to either the old or the new table ?
Share
That rather depends on what/who is using the database, and what control you have…
One approach might be to:
CREATE TABLE...)INSERT ... SELECT ...)DROP TABLE...)You could also do something similar with by altering the existing tables (i.e. creating a new column), but if your data is updating every 20 mins, you may have a very large table, in which case the ALTER TABLE query could take a while to run – so I’d recommend migrating to a new table instead.