You are on page 1of 1

Global Temporary Tables:

Takes up space from Temp space. Persists across sessions. Survives system restarts. DDL will be stored in DD (Data Dictionary), so no need to recreate it in every session that needs to use it. Multiple userIDs can share the same DDL structure (not the data though). Index can be created on GTTs. Used when there is some repeated need of same DDL structure across multiple sessions/users [or] If the Volatile Table stores up a lot of records and there is risk of running out of spool space. If data is huge and joined with other large table, then go for GTT. COMPRESS, BETWEEN, CHECK are supported. Can COLLECT STATS on GTTs.

Volatile Temporary Tables


Takes space from Spool. Doesnt have any information in Data Dictionary. So, faster than GTTs as DD lookup is not required. Session specific. Cannot survive system restarts. DDL structure is not visible outside that session. Index cannot be created on VTTs. COMPRESS, BETWEEN, CHECK are not supported. Cannot COLLECT STATS on VTTs.

You might also like