On 21 Aug 2003 at 21:38, Jesse Sheidlower wrote:

> Huh, I was told the exact opposite, that if most of the
> entries are smaller than the maximum length of the field, you
> should use an index about the size you expect most entries to
> be. Why would you ever use a shorter index than the full column
> length if it led to such performance degradation?

It depends on the query (as well as your data).  In your case, the 
only column you're selecting is cw, so if all of cw is in the index 
MySQL can use the index alone and never has to look at the data file. 
That speeds things up quite a bit.  If you were selecting multiple 
columns the difference might not be so great.

Another point is that you're sorting by cw, and a prefix-based index 
won't allow you to sort completely.  If your queries were mainly 
selecting by cw rather than sorting by it, a prefix-based index 
should be fine.

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


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to