On 2001 Apr 13, Maciek Dobrzanski <[EMAIL PROTECTED]> wrote:
> > This is because with the first query it can use the index. With
> > the second query, it has to check the whole table. Why? Because
> > obviously you're using numbers. And let's make some_value == 10.
>
> I thought that maybe MySQL should check the field type and do the conversion
> to string.
To which string? '10' or ' 10' or '010', ...?
One thing that might work in this case is to only scan the ranges
['0' - '1'], [' ' - '!'] and an exact match. Something like
that.
But it's messy, and best to fix the application. It would be
nice if MySQL could optimize even the worst queries, though.
Tim
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Tim Smith <[EMAIL PROTECTED]>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Development Team
/_/ /_/\_, /___/\___\_\___/ Boone, NC USA
<___/ 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