Database
[HANA] HANA Temporary Table
이반&핫버드
2019. 4. 23. 21:29
Temporary Table Overview
- 실생시에 생성되고 일반 테이블이 하는 모든 operation의 모든 든 종류를 수행할 수 있음
- 범위는 다음과 같이 제한 됨
- Temp lets you store and process intermediate results
- Temp tables only last as long as the session is alive
- Data in temp tables is automatically deleted at the end of the database session, event if it ends abnormally
- 2가지 Type 존재
- Global Temporary Table
- Table definition is globally available to any connection once created. Means metadata of the table is shared across session
- The data in a global temporary table is session-specific meaning that data inserted by a session can only be accessed by that session
- The table is dropped when the last connection using it is closed
- Local Temporary Table
- Temporary table is visible only in the current session
- Data in a local temporry table is session-specific meaning only the owner session of the local temporary table is allowed to insert/read/truncate the data
- It exist for the duration of the session and data from the local temporary table is automatically dropped when the session is terminated
- Local temporary table name is started with hash sign
- Global Temporary Table