Using optimizations from a subquery
You can create a query having a subquery that the optimizer rewrites based on a materialized view. You create a materialized view, and then run a query that uses the materialized view.
In this task, you create a materialized view and use it in a subquery to return the
number of destination-origin pairs. Suppose the data resides in a table named
flights_data that has the following columns:| c_id | dest | origin |
|---|---|---|
| 1 | Chicago | Hyderabad |
| 2 | London | Moscow |
| ... |
