print total count sql in debug mode