PFB my query plan
My Query output
I need to get all the team members details based on all the Assigned/Active rounds
I want to optimize my query. PFB my query.
SELECT Ass.strassociatename,
Ass.strphotolink,
team.strteamname,
team.strteamlogo,
edu.streducationalinstitute,
rounds.strroundname
FROM ccs_vas_tbl_associates Ass,
ccs_vas_tbl_teams team,
ccs_vas_tbl_educationalinstitutes edu,
ccs_vas_tbl_rounds rounds,
ccs_vas_tbl_roundassignment roundass
WHERE team.iteamid = 64
AND ass.iteamid = team.iteamid
AND team.ieducationalinstituteid = edu.iinstituteid
AND Ass.icompetitionid = rounds.icompetitionid
AND roundass.strroundstatus = 'Assigned'
AND roundass.iroundid = rounds.iroundid
AND roundass.iteamid = team.iteamid
May try this
SELECT Ass.strassociatename,
Ass.strphotolink,
team.strteamname,
team.strteamlogo,
edu.streducationalinstitute,
rounds.strroundname
FROM ccs_vas_tbl_associates Ass
JOIN ccs_vas_tbl_teams team ON ass.iteamid = team.iteamid
JOIN ccs_vas_tbl_educationalinstitutes edu ON team.ieducationalinstituteid = edu.iinstituteid
JOIN ccs_vas_tbl_rounds rounds ON Ass.icompetitionid = rounds.icompetitionid
JOIN ccs_vas_tbl_roundassignment roundass ON roundass.iroundid = rounds.iroundid AND roundass.iteamid = team.iteamid
WHERE team.iteamid = 64 AND roundass.strroundstatus = 'Assigned'
You may also try UPDATE STATISTICS
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.