Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
From the comment module line #1929:
"Updates the comment statistics for a given node. This should be called any time a comment is added, deleted, or updated."
function _comment_update_node_statistics($nid)
Also, it would probably be best practice to use drupal's already existing method of deleting comments via the function comment_invoke_comment($cid, 'delete');
This would allow any existing deletion hooks in other modules to be called.