From: Ed Carp Date: March 29 1999 5:51am Subject: Re: Question about query List-Archive: http://lists.mysql.com/mysql/1121 Message-Id: <004201be79a8$41842b00$74c9a8c0@traveler.airmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit >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.