[eluser]aquary[/eluser]
As long as the the condition are good, using DB's count() is always faster than PHP's count() or CI's num_rows(), which require the data to be sent back to PHP for counting.
And you are putting a wrong code/order. The where should be in front of/before the counting part. The way you did would be... "count everything, then assign a condition for the next query" ?
Code:
$this->db
->where('condition', 'value')
->count_all_results('table');