select count(*) from bill
limit 100000;
mysql> select count(*) from `bill` limit 100000;
+----------+
| count(*) |
+----------+
| 47497305 |
+----------+
1 row in set
limit
limits the number of rows outputted in the result set, not the number of rows that are processed.
Therefore it doesn't have any impact on queries like count(*)
.
To achieve this you would have to wrap query into another sub select. Although such query doesn't make too much sense:
SELECT COUNT(*) FROM (
SELECT * FROM bill LIMIT 100000
) t