The recommended way now is first to query with limit and then again without it selecting count(*).
My query is a bit complex and joins a couple of tables with a large number of records, which makes each select take up to 4 seconds, so my process now takes double the time compared to as I just keep using found rows.
How can I go back to just running the select a single time and still getting the total number of rows found without the limit?
Would it work to write the query as a common table expression, then select your columns from that table and join it with a count(*) aggregation of the table?
The SQL_CALC_FOUND_ROWS query modifier and accompanying FOUND_ROWS() function are deprecated; expect them to be removed in a future version of MySQL. Execute the query with LIMIT, and then a second query with COUNT(*) and without LIMIT to determine whether there are additional rows.