dmbf29 / predictor-api

match prediction app / back-end API built on Rails
1 stars 4 forks source link

Optimise N+1 queries for `leaderboards#index` #99

Closed trouni closed 1 year ago

trouni commented 1 year ago

This endpoint takes a lot of time at the moment, probably due to the User#score calculations. Need to investigate and optimize.

The problem seems to come from the User#score method, as well as an N+1 involving the Match#round association.

yarn_serve
trouni commented 1 year ago

Fixed by #110