MySQL Forums
Forum List  »  Optimizer & Parser

Re: select distinct slower in 5.0 than 4.1
Posted by: Saar Barhoom
Date: December 21, 2005 03:15AM

CREATE TABLE `bucket_lastname` (
`PID` int(10) unsigned NOT NULL default '0',
`lastname` char(32) default NULL,
UNIQUE KEY `BUCKET_lastname_CONST` (`PID`,`lastname`),
KEY `BUCKET_lastname_ATT` TYPE BTREE (`lastname`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


explain select distinct(pid) from bucket_lastname where lastname = 'Smith'

Result with 4.1.12
1,"SIMPLE","bucket_lastname","ref","BUCKET_lastname_ATT","BUCKET_lastname_ATT",33,"const",709,"Using where; Using temporary"

Result with 5.0.16
1,"SIMPLE","bucket_lastname","range","BUCKET_lastname_ATT","BUCKET_lastname_CONST","",8,"Using where; Using index for group-by"

Options: ReplyQuote


Subject
Views
Written By
Posted
3427
December 18, 2005 12:24PM
2663
December 19, 2005 10:49AM
2327
December 20, 2005 11:36AM
Re: select distinct slower in 5.0 than 4.1
2302
December 21, 2005 03:15AM


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.