
System Architecture 2-113
Create a Temporary Table: What Happens on Disk
Create a Temporary Table: What Happens on Disk
After the root dbspace exists, users with the necessary SQL privileges can
create an explicit temporary table by executing the SQL statement CREATE
TABLE
with the TEMP keyword. During processing, OnLine user processes
may create implicit temporarytables aspart of SQL statementprocessing.If a
user creates a temporary table by executing a SELECT ... INTO TEMP
statement, OnLinehandles thetable as if it werean explicit temporary table.
Placement
By default, temporary tables are created in the root dbspace.
Users can create explicit temporary tables in some other dbspace by speci-
fying the dbspace name in the CREATE TABLE statement. Users can also
specify sizes of the initial extent and the next extents for an explicit
temporary table in the statement. If initial and next extent sizes are not
specified, the default sizes are eight pages.
Temporary tables created as part of internal processing or by using the
SELECT ... INTO TEMP statement always reside in the root dbspace. For an
implicit temporary table, the initial and next extent sizes are always eight
pages.
Tracking
The tasks involved in creating temporary tables are similar to the tasks
OnLine performswhen it adds a newpermanent table. The key differenceis
that temporary tables do not receive an entry in the system catalog for the
database.(Refertopage 2-110foradescriptionofwhathappenswhenatable
is created.)
Comentarios a estos manuales