>I have a query like
>select id from atable where truncate(c1/1000000) = 321
>I learned that following query has the same function
>select id from atable where c1 like '321______'
>I'd like to know which is faster. Or anyone know how to do integer division
>in MySQL faster.
>And if I make a index on c1 or a index on c1/1000000, which index will
>increase the query speed, or none index is helpful.
I hate to be a curmudgeon (again) but wouldn't it be easier and faster to
test it on your own machine than posting to a mailing list and essentially
asking someone else to do your work for you?
Indexing a field is generally always faster, but this depends on your
application. Again, test it on your own machine with a big recordset and
time it to see which is faster.