title: MySQL count total number of rows
body: <p>I have a complicated MySQL query which takes a lot of time, selecting from a table with more than 150k rows and several JOINS and subqueries. I am limiting the amount of results, but I need to know the total amount of rows.</p>
  
  <p>Is there a way not to repeat the query with <code>COUNT(*)</code> as the field to get them? (repeating the query almost doubles the amount of time the script takes to complete)</p>