get5loader icon indicating copy to clipboard operation
get5loader copied to clipboard

[API/Vue/DB] /matches makes too much sql queries

Open FlowingSPDG opened this issue 5 years ago • 1 comments

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 .
image

FlowingSPDG avatar Feb 24 '20 03:02 FlowingSPDG

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.

FlowingSPDG avatar Feb 24 '20 03:02 FlowingSPDG

#214

FlowingSPDG avatar Aug 04 '23 13:08 FlowingSPDG