3 ms·
Interestingly, you can make MySQL counts faster with something like: WHERE id > 0 For some reason counting with that is a lot faster (from my testing) to just
by charliesome 15y ago
Interestingly, you can make MySQL counts faster with something like:
WHERE id > 0
For some reason counting with that is a lot faster (from my testing) to just a straight count
- mzarate06 15y agoAre you sure you're clearing the query cache before each test run? In all my test cases, your statement proves false, by a long shot. Questions: 1) What version of MySQL are you testing on? 2) What storage engine are the relevant tables using? 3) What does the execution plan show for both cases (with where id > 0 and w/out it)?
- charliesome 15y agoI tested this a while ago (using sql_no_cache in the query) and the `WHERE id > 0` query was faster. I can't seem to reproduce it though...