MySQL Forums
Forum List  »  MyISAM

NULL values in cardinality counts
Posted by: Robert Bergs
Date: May 19, 2005 05:55AM

A change to how ANALYZE TABLE treats NULL values when calculating cardinality was made in Jan 2003. (Patch is here: http://lists.mysql.com/internals/6390)

Traditionally, NULL values were treated as equal but they are now treated as different. This means that a field with a large number of NULL values will have a much greater cardinality than before.

We have found that in a number of cases this causes the query optimiser to make a bad decision in terms of order of joining tables or which index to use. Sometimes the performance differences are massive.

I've been searching the lists and cannot find any discussion about why this change was introduced. Are there cases when it it is benefical? Has anyone else found performance problems with this?

Options: ReplyQuote


Subject
Views
Written By
Posted
NULL values in cardinality counts
4667
May 19, 2005 05:55AM


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.