get5loader
get5loader copied to clipboard
[API/Vue/DB] /matches makes too much sql queries
currently match table only holds team1id, team2id, serverid and owner id(userid).
which means it doent contains team's name, roasters, server name or user names.
I know this is pretty normal DB structure,but we may need to create a lot of sql queries to get match list with team name and etc.
this is current get5-web-go log when user opens http://localhost:8081/#/matches .

potential solution1 : currently front-end requests matchinfo for each match in list(20). so, embed teamname and other informations into list request(GetMatches) . it decreases HTTP requests,Howerver, MySQL queries won't decrease. so this is not best solution imo.
I think I can solve this issue by using Gorm's Preloading method.
#214