def count_star(self) -> int:
        """
        Implements the ``COUNT(*)`` specialization.
        """
        count_query = (self.statement.with_only_columns([func.count()])
                       .order_by(None))
        return self.session.execute(count_query).scalar()