I noticed that one of our posts with a deeply nested discussion in the comments was reporting 154 queries to construct the response to view_post, which seemed excessive. I tracked it down to a query added by #75 to the loop in get_comment_tree. The query is called for every comment in the tree, and its only purpose is to get the sid, and since all the callers of get_comment_tree already know the sid, I was able to add it as a new argument and remove the query entirely.
I noticed that one of our posts with a deeply nested discussion in the comments was reporting 154 queries to construct the response to
view_post
, which seemed excessive. I tracked it down to a query added by #75 to the loop inget_comment_tree
. The query is called for every comment in the tree, and its only purpose is to get thesid
, and since all the callers ofget_comment_tree
already know thesid
, I was able to add it as a new argument and remove the query entirely.