MySQL Forums
Forum List  »  MyISAM

Re: Table marked as crashed and last (automatic?) repair failed
Posted by: Rick James
Date: March 04, 2011 08:29PM

I like the whole directory method. (I don't know if it is any "safer.)

CREATE TABLE ... ( ...
PRIMARY KEY (id) -- not a "secondary" key
UNIQUE (a) -- a secondary key
INDEX (b,c) -- another secondary key
) ENGINE=InnoDB

You effectively have 3 BTrees:
1. the entire dataset, ordered by id. Plus no dups on id.
2. an ordered list of (a,id). Plus no dups on a.
3. an ordered list of (b,c,id). There can be dups of b+c.

More subtly:
PRIMARY KEY(x,y)
INDEX(y,z) -- effectively a tree of (y,z,x) (no need to put x in twice)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Table marked as crashed and last (automatic?) repair failed
2657
March 04, 2011 08:29PM


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.