From: Zardosht Kasheff Date: July 16 2009 6:05pm Subject: Re: help with index_merge and clustering keys List-Archive: http://lists.mysql.com/internals/37199 Message-Id: <2f9663ba0907161105l5b85dd7r48b7781f1d4b395d@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello, In TokuDB, one can cluster on multiple keys (http://blogs.tokutek.com/tokuview/introducing_multiple_clustering_indexes)= . With this feature, the index_merge intersect code seems to need some tweaking. Sergey and Rick have been kind enough to help me out in solving this problem on this thread. In the example below, I think Rick's implicit assumption was that keys were either non-covering or clustered. Thanks -Zardosht On Thu, Jul 16, 2009 at 1:34 PM, Michael Widenius wrote= : > > This is true for the given query, but not in general. > > Assume you have in an InnoDB table and an index on (b,c) and 'a' is > the primary key. In this case: > > select c from foo where a=3D1 and b =3D 1 > > I't better to scan the index (b,c) than scan the primary key as you > get all key parts from this index, but it's much less to scan as you > don't have to access all the other columns from the table. > > > Rick> * Both a and b are clustered: =A0Again, the other key is useless; s= imply use the clustered key. > > How can you have something clustered on to different key? > (Normally you can only cluster on one key at a time) > > Regards, > Monty >