MySQL left join produces less optimal query
My users table lists all users: id name 1 alice 2 bob My users_teams table defines which users are in which teams. id team_id user_id 1 100 1 2 100 2 I want to search for users with a certain name, and also know which team they are on. I select the users first, which