Execute the count query, which will be done just prior to the query itself being executed.
public function executeCountQuery(&$count_query) {
$this->total_items = $count_query
->execute()
->fetchField();
if (!empty($this->options['offset'])) {
$this->total_items -= $this->options['offset'];
}
$this
->updatePageInfo();
return $this->total_items;
}