From: Date: January 3 2008 1:40pm Subject: Re: MySQL uses PRIMARY key when it should? use another index List-Archive: http://lists.mysql.com/internals/35253 Message-Id: <20080103124051.GA3710@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit On Thu, Jan 03, 2008 at 01:32:51PM +0200, Marko Mäkelä wrote: > On Wed, Jan 02, 2008 at 07:15:24AM -0800, Rick James wrote: > > I would be surprised if using t1ba is ever the 'right' way to do the > > query. The "(10)" virtually destroys any usefullness of the index. And > > since you asked for "a,b", it could really be satisfied in the index. I > > do find it puzzling that it says both "PRIMARY" and "Using index". > > Right, the test may have succeeded in the past because of a MySQL bug that > has been fixed. But we would like to know where this change was made. > > There still seem to be bugs in fast index creation. For example, this > test case results in a table copy, even for a MyISAM table: > > create table t1(a int, b varchar(255), primary key(a,b)) > engine=myisam default charset=utf8; > create index t1ba on t1(b,a); Filed as Bug #33650. Marko