Henkuttt Posted February 10, 2005 Share Posted February 10, 2005 OPTIMIZE TABLE Vad innebär detta? Varför ska jag göra det? Varför görs inte det automatiskt? Link to comment Share on other sites More sharing options...
TicoRoman Posted February 12, 2005 Share Posted February 12, 2005 När poster/rader raderas i en tabell så blir det kvar "tomt mellanrum" mellan de andra raderna (inte helt sant). OPTIMIZE TABLE defragmenterar tabelldata, och återställer tabellerna. Det bör användas om tabellen utsätts för många uppdateringar och postborttagningar. Enligt MySQL-dokumentationen: OPTIMIZE TABLE should be used if you have deleted a large part of a table or if you have made many changes to a table with variable-length rows (tables that have VARCHAR, BLOB, or TEXT columns). Deleted records are maintained in a linked list and subsequent INSERT operations reuse old record positions. You can use OPTIMIZE TABLE to reclaim the unused space and to defragment the data file. In most setups, you need not run OPTIMIZE TABLE at all. Even if you do a lot of updates to variable-length rows, it's not likely that you need to do this more than once a week or month and only on certain tables. http://dev.mysql.com/doc/mysql/en/optimize-table.html _________ TicoRoman - Anfall är bästa försvar Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.