Every time we select rows from a view, we actually select from the result of the underlying query. If that query is slow and we need to use it more than once, then it makes sense to run the query once, save its output as a table, and then select the rows from the latter.
This procedure has been available for a long time, and there is a dedicated syntax, CREATE MATERIALIZED VIEW, which we will describe in this recipe.