Sandeep  B J
Sandeep B J

Reputation: 53

altering with auto_increment filed in MYISAM table

I am altering the table by adding the column as auto increment. Table has over 10 million data.

I have run this query in master but same query is stuck in the slave.

My question is:

What happens if I kill the query in the slave. Since i am using MYISAM storage engine?

Upvotes: 0

Views: 44

Answers (1)

Bud Damyanov
Bud Damyanov

Reputation: 31919

Here is something you should know. When you use KILL statement, a thread-specific kill flag is set for the thread. In most cases, it might take some time for the thread to die because the kill flag is checked only at specific intervals, in your case you are performing ALTER TABLE:

The ALTER TABLE operations that make a table copy check the kill flag periodically for each few copied rows read from the original table. If the kill flag was set, the statement is aborted and the temporary table is deleted.

The KILL statement returns without waiting for confirmation, but the kill flag check aborts the operation within a reasonably small amount of time. Aborting the operation to perform any necessary cleanup also takes some time.

Upvotes: 1

Related Questions