> Create composite index on (cat, date). Use EXPLAIN to see if MySQL uses
index:
> http://dev.mysql.com/doc/mysql/en/EXPLAIN.html

This partially solved my problem. Thanks a lot. However I am facing a new
problem here.

The query where I am ordering by a column is much more slowly than the same
query NOT using SQL_CALC_FOUND_ROWS

select SQL_CALC_FOUND_ROWS * from table by date desc
- this query takes about 1.2 s

select * from table by date desc
- this query takes about 0.1 s

Using explain I have noticed that the first query is using filesort and I
cannot figure out why exactly...
I could use count() to figure out the total number of results for the
navigation and this would be defintelly much faster since now as I have
tested but I was thinking if anyone else had this problem before and if you
have found any work around...


Thanks,
Arthur


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

Reply via email to