Run EXPLAIN on the join + filter + sort query (Professor-rank instructors and their rooms, sorted by name) to see the optimizer’s plan before adding any index.
Run EXPLAIN on the join + filter + sort query (Professor-rank instructors and their rooms, sorted by name) to see the optimizer’s plan before adding any index.
Answer
EXPLAIN SELECT i.name, s.room FROM instructors i JOIN sections s ON s.instr_id = i.instr_id WHERE i.rank = 'Professor' ORDER BY i.name;