On Saturday 04 January 2003 14:53, harm wrote:

> > Your order by will not use your weg_2 index because, as you stated,
> > weg_2 index is on (col1, col2, col3, nr) as a group so it wont be used
> > for the individual columns as you need
> >
> > try to create a separate index on just the nr column, that should be used
> > by the orderby clause.  This way your weg_5 will be used for the where
> > (the 3 col) and the new index will be for the orderby
>
> There is an index on 'nr', it is the primary key :)
>
>
> This is one of the examples from the manual which is supposed to use the
> index for the order by:
>
> SELECT * FROM t1 WHERE key_part1=constant ORDER BY key_part2
>
> Looks like the same situation to me.

I tested it on 4.0.7 and MySQL picks up right index.
What is your table structure?



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com





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