MySQL Forums
Forum List  »  Optimizer & Parser

Re: Analyze question
Posted by: Rick James
Date: July 15, 2010 08:54PM

(InnoDB-specific discussion)

I have seen the optimizer "do the right thing" for a month, then suddenly decide to do a table scan for a day.

ANALYZE TABLE can fix the problem, or it can cause the problem.

select * from A where id=xx ---> Optimizer NOT consider cardinality
* If `id` is UNIQUE (PRIMARY), then it will always(?) use the index.
* If id=xx for most of the table, it will (probably) switch to a table scan.

Options: ReplyQuote

Written By
July 13, 2010 03:30PM
July 14, 2010 10:48PM
July 15, 2010 11:26AM
Re: Analyze question
July 15, 2010 08:54PM

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.