MySQL total number of rows with LIMIT

In order to show paging of our resources, we use LIMIT in our MySQL query. I met some scalability issues, while using the simplest way of getting total number of rows.

The simplest way to get total number of rows in you MySQL query is to run the following construction:

It works pretty good and fast if you have less than 100 results.

I tried this structure on a table with 1000 rows.
It takes the same time to return a page as if I ran query without LIMIT.
I found solution on this page MySQL: Get total number of rows when using LIMIT.

The same number of rows as it was in the first example, was returned in less than a second.