Derived tables can be a powerful technique to produce efficient
queries, but they can also cause major performance problems when used in
inappropriate situations.
Here are some guidelines for the use of derived tables:
Never use a derived table to simply restrict the records of a large table prior to joining it to some other table. Doing this prevents the optimizer from using statistics on the table when it is subsequently joined to another table, since the derived table is pulled into a spool file, and this spool file will not have statistics available to the optimizer to prepare downstream joins.