Mojtaba Faridzad wrote:

First of all, I don't wanna let the query run to the end and after that,
count the number of records. as I mentioned, some tables are huge and takes
a long time to run COUNT(*) query for all records.

About LIMIT, it doesn't effect on COUNT query. but for the second query (
retreiving a field ) I can use it and as you mentioned, I use LIMIT v1,v2.
this part of query that I tried to use COUNT is before retreiving the all
fields of the last page. it's just checking for the number of records, to
find the number of pages and show the last page.

about why I am not using auto_number or other indexes, because the table and
conditions are variable and on run-time.


If you are using MYISAM tables, count(*) does not scan the table to get the count.


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



Reply via email to