Sample Header Ad - 728x90

Primary key addition for a table which contatins no data is too slow

3 votes
1 answer
188 views
We are using mysql. We are running 10 alter queries which contains 3 Primary key deletion and 4 column addition and 3 primary key addition. And this alter query is on three tables which don't contain any data. To run this query system took 15s. Usually system wont take this much for alter query. But for a table which contains no data I am not sure why it is taking this much of time. I am not sure whether it is because of primary key addition and deletion or any mysql configuration is wrong or because of the machine. While this migration alone system is slow. After and before the migration is system is behaving as normal. Can anyone help me on this one? Below are the queries. I was running three sets like this. ALTER TABLE Table1 DROP PRIMARY KEY; ALTER TABLE Table1 ADD Column3 INT(10) DEFAULT ‘1'; ALTER TABLE Table1 ADD PRIMARY KEY Table_PK(Column1, Column2 , Column3 );
Asked by user636856 (53 rep)
Jan 9, 2016, 03:10 PM
Last activity: Jun 24, 2025, 10:04 PM