On Tue, Jan 22, 2002 at 10:19:46AM +0100, Roger Baklund wrote:
> 
> Just to make it clear: this is the primary key, and all four parts
> of the index are needed to identify the row. Most of the time I use
> the three first parts, sometimes I use all four parts, and sometimes
> I use only the first two parts.
> 
> My question was: is it better to have the part with most distinct
> values first, or is it better to have the part with very few
> distinct values first, when _all_ queries _always_ use both parts?

It is better, yes.  How much better, I cannot say without testing.

> I believe the answer to this depends on how the index is stored and
> handled internally by mysql, and as I do not have this knowledge, I
> asked the list...

I understand now.

Jeremy
-- 
Jeremy D. Zawodny, <[EMAIL PROTECTED]>
Technical Yahoo - Yahoo Finance
Desk: (408) 349-7878   Fax: (408) 349-5454   Cell: (408) 685-5936

MySQL 3.23.41-max: up 20 days, processed 479,662,744 queries (266/sec. avg)

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to