In large phpBB installs, the query beginning on line 205 of includes/functions_posting.php
Takes a very, very long time - upwards of 10 min. I'm testing this on a site with ~24 million posts. Adding a compound key of (forum_id,topic_id,post_visibility) to the posts table get the query down to about 3 seconds. But replacing MAX with ORDER BY p.post_id, LIMIT 1, reduces query time to around 0.5ms on my server.
This probably isn't an issue for small communities, but with larger databases, it causes the delete post function to always time out.
I will add PR in github.