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