The planner has a couple of options here and I want to use the chance to show what can go wrong if trivial approaches are used.
Suppose the planner just steams ahead and calculates the output of the view. What is the best way to join 100 million with 200 million rows?
In this section, a couple of (not all) join options will be discussed to show what PostgreSQL is able to do.