You can improve the performance of collection-derived tables
by using SQL to fold derived tables in simple queries into a parent
query instead of into query results that are put into a temporary
table.
Use SQL like that in this example:
select * from ((select col1, col2 from tab1)) as vtab(c1,c2)
However, if the query is complex because it involves aggregates,
ORDER BY operations, or the UNION operation, the server creates a
temporary table.
The database server folds derived tables in a manner that is similar
to the way the server folds views through the IFX_FOLDVIEW configuration
parameter (described in Enable view folding to improve query performance).
When the IFX_FOLDVIEW configuration parameter is enabled, views are
folded into a parent query. The views are not folded into query results
that are put into a temporary table.
The following examples show derived tables folded into the main
query.
The following example shows a complex query involving the UNION
operation. Here, a temporary table has been created.