db_select get all results count when also using a pager Is it possilbe to get the count of all rows, when using a pager in a db_select query?
 My pager is the following:

$query = $query-&gt;extend('PagerDefault')-&gt;limit(20);
Yes you can use setCountQuery if you need to define a count query to return the total number of rows in your resultset.

See the docs for PagerDefault::setCountQuery()