Temporary Table Performance
Performance improvements have been made to the implementation of temporary sort tables in this release. To process certain queries, the database engine must generate temporary tables for internal use. The performance for many of these queries has been improved.
In general, the database engine generates at least one temporary table to process a given query if any of the following conditions is true:
For example, a temporary table is generated to process the following query unless an index exists with columns c1 and c2 as leading segments:
SELECT DISTINCT c1, c2 FROM t1
For example, a temporary table is generated to process the following query unless an index exists with columns c1 and c2 as leading segments:
SELECT c1, c2, COUNT(*) FROM t1 GROUP BY c1, c2
For example, a temporary table is generated if an application calls the ODBC API SQLSetStmtOption specifying the SQL_CURSOR_TYPE option and the SQL_CURSOR_STATIC value prior to creation of the result set.
For example, if the ODBC API SQLSetStmtOption is called specifying the SQL_USE_BOOKMARKS option and the SQL_UB_ON value prior to generating the result set.
For example:
SELECT c1 FROM t1 WHERE c2 IN (SELECT c2 FROM t2)