Hi!
>>>>> "r" == rafarife <[EMAIL PROTECTED]> writes: <cut> r> And now, the explain selects: r> 1) Slow query r> explain Select Cod,Nom,Nif,Nombre_comercial from Clientes r> Where (Nom = 'GARCIA MANCILLA,S.L' And Cod>'061642') r> Or Nom>'GARCIA MANCILLA,S.L' Order by Nom ASC, Cod ASC Limit 50; r> table type possible keys key key_len ref rows Extra r> ----- ---- ------------- --- ------- --- ---- ----- r> Clientes index PRIMARY,Nombre Nombre 46 4039 where used The above explains what happens. For some strange reason MySQL uses a full index scan above instead of a 'range' query. This really looks like a bug in the optimiser. To solve this we would however need a copy of your tables to be able to repeat this. Can you please ftp them to ftp://support.mysql.com/pub/mysql/secret so that we can try to fix ASAP ? Regards, Monty -- For technical support contracts, goto https://order.mysql.com/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Mr. Michael Widenius <[EMAIL PROTECTED]> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, CTO /_/ /_/\_, /___/\___\_\___/ Helsinki, Finland <___/ 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