I'd argue that indexes is an implementation detail here and exactly the kind that should not leak into the abstract "thinking about sets and how to combine them".
It is valuable and critical in lots of real situations. But it may interfere with the actual learning.
And indexes. Many times in my career, adding the right SQL index has solved a serious performance problem.