Do MyISAM holes get filled in automatically?

Posted by NNN on Stack Overflow See other posts from Stack Overflow or by NNN
Published on 2010-05-28T16:26:39Z Indexed on 2010/05/28 16:32 UTC
Read the original article Hit count: 353

Filed under:
|

When you run a delete on a MyISAM table, it leaves a hole in the table until the table is optimized.

This affects concurrent inserts. On the default setting, concurrent_inserts only work for tables without holes. However, in the documentation for MyISAM, under the concurrent_insert section it says:

Enables concurrent inserts for all MyISAM tables, even those that have holes. For a table with a hole, new rows are inserted at the end of the table if it is in use by another thread. Otherwise, MySQL acquires a normal write lock and inserts the row into the hole.

http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_concurrent_insert

Does that mean MyISAM automatically fills in holes whenever a new row is insert into the table? Previously I thought the holes would not be fixed until you OPTIMIZE a table.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about myisam