Just nu i M3-nätverket
Gå till innehåll

OPTIMIZE TABLE


Henkuttt

Rekommendera Poster

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

 

Länk till kommentar
Dela på andra webbplatser

Arkiverat

Det här ämnet är nu arkiverat och är stängt för ytterligare svar.

×
×
  • Skapa nytt...