This is particularly useful when you need to optimize a query for returning the
count, for example removing unnecessary joins, removing group by or just return
an estimated number of rows.
The callback will receive as first argument a clone of this query and not this
query itself.
If the first param is a null value, the built-in counter function will be called
instead