One of my sites recently got a heavy dose of comment spam from an anonymous user who found his way around spam.module. Since deleting comments one by one was way too much hassle, I ended up deleting the comments through a simple MySQL call, directly to the database, screwing up the comment counts etc in the node_comment_statistics table.
I had a look around drupal.org but could not find info on manually rebuilding the node_comment_statistics table, untill I found some neat MySQL calls in the wp2drupal script on ninjafish.org.
Here's a working excerpt I used, and I hope someday it saves someone's node_comment_statistics. To run this script, I created a new page with a user with PHP input permissions. I did not actually post this page to the site, but used 'preview' to execute the PHP statements.
Be sure to back up your database before executing the PHP below!
<?php
db_query("DELETE FROM node_comment_statistics");
$nodes = db_query("SELECT DISTINCT nid,max(cid) FROM comments GROUP BY nid");
while ($m = db_fetch_object($nodes)) {
$nid = $m->nid;
$cid = $m->{"max(cid)"};
$lastcomments = db_query("SELECT uid,name,timestamp FROM comments WHERE cid=$cid");
$n = db_fetch_object($lastcomments);
$uid = $n->uid;
$name = $n->name;
$timestamp = $n->timestamp;
$counts = db_query("SELECT count(*) FROM comments WHERE status=0 AND nid=$nid");