MySQL Forums
Forum List  »  Optimizer & Parser

Re: select distinct slower in 5.0 than 4.1
Posted by: Saar Barhoom
Date: December 20, 2005 10:29AM

The data sets are EXACTLY identical. This is a regular benchmark test I use for my application.

Anyway - I found out the reason:
The table has two indexes. The first index is a BTREE index on lastname. The second index is a unique constraint on PID, lastname.

While 4.1 optimizer is using wisely the first index, 5.0 prefers the second!

My guess is that this happens probably because of some problem in the logic that makes it prefer second since it contains both columns. But - since PID is the first column in the index - it turns out this choice is worst.

What do you think?

Options: ReplyQuote


Subject
Views
Written By
Posted
2994
December 18, 2005 12:24PM
2383
December 19, 2005 10:49AM
Re: select distinct slower in 5.0 than 4.1
2145
December 20, 2005 10:29AM
2069
December 20, 2005 11:36AM


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.