Alter Table Problem - over 125 million rows in table and query takes to long.
Posted on 2010-09-06
I have a table with 125million rows in it on the live db
i replicate ths db to a mysql db daily
For reporting reaons, i want to pull in the data from this table into my SQL SERVER db.
i only pull in the previous days entries to the SQL SERVER.
however to do this i want to add a colunm called DW_TIMESTAMP
So i would use this syntax
ALTER TABLE MYTABLENAME
ADD COLUMN dw_timestamp TIMESTAMP
DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
however because there are soo many rows this is taking forever, in fact it stopped the Mysql server because i believe it timmed out.
Can anyone suggest how i can speed up this process.
I was thinking if i could add a where clause but i don't believe that would work.