Mojtaba Faridzad wrote:

BUT my experience: try to change the logic of your report not to retrieve
large number of records. user LIMIT to create the reports page by page. this
is the best and even better for the user.

Ok thanks, but how exactly do I change-the-logic of this query:

mysql> select tel, telefb, rutaentran, rutasalien, sum(minutos) from traf_oper group by 1, 2, 3, 4;


I also found this in the manual:


"Note that in some cases MySQL will not use an index, even if one would be available. Some of the cases where this happens are:

   * If the use of the index would require MySQL to access more than
     30% of the rows in the table. (In this case a table scan is
     probably much faster, as this will require us to do much fewer
     seeks.) Note that if such a query uses |LIMIT| to only retrieve
     part of the rows, MySQL will use an index anyway, as it can much
     more quickly find the few rows to return in the result."

So, it seems that I REALLY need to change the logic of this query, since it obviusly would do a table scan.
Any help would be greatly appreciated!
Hector



-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to