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


Subject
Views
Written By
Posted
4708
July 13, 2010 03:30PM
1558
July 14, 2010 10:48PM
1694
July 15, 2010 11:26AM
Re: Analyze question
1522
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.