Use a single simple query instead of multiple join queries