Re: Error: Incorrect key file for table try to repair it
Posted by:
Rick James
Date: December 09, 2011 12:40PM
To decrease the need for REPAIR, consider switching to InnoDB. OK, you can't fully switch, but if you have a MyISAM table with just id, heading, content for the FULLTEXT search, and the rest of the fields in InnoDB table(s), you will decrease the need for REPAIRs.
REPAIR _should_ be needed only in the case of rude shutdowns, such as power failure. Is it happening in other cases?
(Now some comments unrelated to your problem...)
Indexes on flags are virtually useless:
KEY `idx_deleted` (`deleted`),
KEY `idx_hidden` (`hidden`),
Consider moving bulky fields to another table (especially for MyISAM); this will generally improve the performance when scanning for rows with a complex WHERE clause. (See "Vertical partitioning")
`html_1` text NOT NULL,
`html_2` text NOT NULL,
You have 2 of these:
`td_left` enum('1','0') NOT NULL DEFAULT '1',
`td_left_css` varchar(255) NOT NULL DEFAULT 'class="td-left"',
`td_left_inc` varchar(255) NOT NULL DEFAULT '',
`td_left_content` text NOT NULL,
Perhaps they belong in another table, and JOINing to vs_content via `id`?