500 error when deleting node with 300,000 comments I have a node which has been spammed and has 300,000 comments. Whenever I try to delete it I get a 500 internal server error.

Deleting all comments via database is not an option because I need to retain a large number of legitimate comments on OTHER nodes. However, this specific node has been spammed and I wish to delete the node and all associated comments, But I can't. I have disabled commenting on the node, but how can I remove these comments? Any ideas?
I think you could delete the comments via database, limiting the deletion to those attached to the involved node.

It might be a simple as this:

DELETE FROM comment
WHERE nid = &lt;the involved node id&gt;


To ensure avoiding any issue (or in case there is something subtle I missed) you can first execute the equivalent SELECT and control its results:

SELECT * FROM comment
WHERE nid = &lt;the involved node id&gt;


And obviously you shouldn't execute the DELETE query without previously getting a backup.



EDIT: as a non-expert, I only proposed what seemed obvious when examining the comment table.
But thanks to @MPD comment, I realize that there are some linked data to also consider.

Regarding fields, after looking at the tables definition I think that an additional DELETE query should be executed first (before deleting comments themselves), something like:

DELETE FROM field_data_comment_body
WHERE entity_type = "comment"
AND entity_id IN (
  SELECT cid
  FROM comment
  WHERE nid = &lt;the involved node id&gt;
)


If unfortunately supplemental comments had been added, a similar query should be executed also for each of them.

Regarding "The node won't be reindexed." and "Node statistics won't be updated.", I'm not expert enough to understand what is involved.
So I hope @MPD will be able to bring its own complementary information.