On 10 Mar 2003, at 16:31, Tab Alleman wrote:

> I was thinking if you do a select on a char[50] and the whole field
> is indexed, wouldn't the search algorithm know exactly where to go
> to look for a match, as opposed to - if only the first 20 characters
> are indexed - finding all of the possible values that match the
> first 20 and then having to go through all of them looking for a
> match?

Certainly the distribution of data values would make a difference, 
but it would seem to be an unusual set of data that would have a huge 
number of names that matched in the first 20 characters but differed 
after that point.

> It would seem like, from what I know of indexes, if the whole
> field is indexed, only one disk read should be necessary since
> it would go right to that row the first time.

I believe Benjamin was talking about the disk reads necessary to get 
the index, not to get the record itself.

[Filter fodder: SQL]

-- 
Keith C. Ivey <[EMAIL PROTECTED]>
Tobacco Documents Online
http://tobaccodocuments.org
Phone 202-667-6653

---------------------------------------------------------------------
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