Postponement of the Search to the FETCH Time
A goal of optimization is to save storage area; that is, the creation of results tables should be avoided. Except for the cases in which the syntax element FOR REUSE or the existence of a join forces the creation of results tables, the creation of a results table is avoided where possible.
A possible
search strategy is therefore the postponement of the search to the FETCH time (The postponement of the search to the FETCH time is not possible for all SQL statements. The following is an overview of a number of SQL statements for which a postponement is not permissible:
SELECT for multiple tables (Join)
SELECT ... FOR REUSE
SELECT DISTINCT ... (in most cases)
SELECT ... ORDER BY ... (in most cases)
SELECT ... ORDER BY
If the
You can use the
EXPLAIN statement to display whether a results table is created (RESULT IS COPIED) or not (RESULT IS NOT COPIED).