From: Zardosht Kasheff Date: July 20 2010 12:43pm Subject: HA_ONLINE_ADD_INDEX v. HA_ONLINE_ADD_INDEX_NO_WRITES List-Archive: http://lists.mysql.com/internals/37991 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Hello all, I was looking at alter table flags, and was wondering what the difference between these two flags are. Their name seems to imply that declaring HA_ONLINE_ADD_INDEX means the storage engine can accomodate writes while an index is being added, whereas HA_ONLINE_ADD_INDEX_NO_WRITES cannot. Looking at the code in 5.1.46, I cannot find a difference. The only change I see is in the function mysql_alter_table, the value of need_lock_for_indexes is false if the engine exposes HA_ONLINE_ADD_INDEX, and true if the engine exposes HA_ONLINE_ADD_INDEX_NO_WRITES. This variable, need_lock_for_indexes, does not seem to actually be used anywhere. So, my question is, despite what their names imply (stating if a table lock is necessary for add index), is there any functional difference for storage engines that set one of these flags and not the other? Thanks -Zardosht