MySQL Forums
Forum List  »  MyISAM

Re: Table marked as crashed and last (automatic?) repair failed
Posted by: Rick James
Date: February 25, 2011 08:43PM

InnoDB: Yes, the freed up "blocks" (16KB each) are reused first, before increasing the size of the "tablespace" (either ibdata1 or the .ibd file).

MyISAM: DELETEing a row leaves a hole in the .MYD; it does not shrink the file size. This hole is used for subsequent INSERTs (etc).

MyISAM: It is quite possibly to move the three files (.MYD, .MYI, .frm) around to move a single table. (It is safer if mysqld is stopped at the time.)

InnoDB: It is _not_ safe to move the .ibd, nor the ibdata1. It is "all or none". You can move the entire tree (all databases). (This is one way to do a backup.) It is sort of possible to fiddle with one .ibd, but only using ALTER TABLE ... DISCARD/IMPORT TABLESPACE. That may not do what you want, so be careful.

InnoDB: The "data" and "index" blocks are intermingled in the .ibd file (or ibdata1). The data, just like every secondary index, is structured in a BTree of 16KB blocks. The data is ordered by the PRIMARY KEY.

InnoDB: innodb_file_per_table = 1 -- All subsequent CREATE TABLEs will create the data and index in a .ibd file. With =0, they will go into ibdata1, instead. (Note: If you change that setting, existing tables are not migrated to/from ibdata1.)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Table marked as crashed and last (automatic?) repair failed
5842
February 25, 2011 08:43PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.