Optimization of summary SQL (PR #10175)

GitHub

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/slow-page-loads-on-user-profiles/155165/11

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/slow-page-loads-on-user-profiles/155165/13

    "user_summary:#{user.id}:#{current_user ? current_user.id : 0}"

Trivial but to_i would work the same way here. nil.to_i is 0.

Seems good to me!