Oracle Create Table as Select
1882 단어 Oracle
PGA consumption
Consider two scenarios:
a) Create table target as select * from source;
The result of select statement is not saved in memory, Oracle writes it directly to disk. Even if source table is large, PGA and Temp is not used.
b) Create table target as select col1, sum(col2) from source group by col1;
Oracle has to do Hash Group By for this kind of query; PGA and temp possibly are used.
To create a new partitioned table, user needs to issue:
Create table xxx
Partition by range (colx)
(
Partition pxxx values less than ()
)
As Select * from xxx
Parallelized CTAS
To create the table in parallel, you can either:
1). Create table xxx parallel y as select * from zzz; 2). Create table yyy as select /*+ parallel */ * from zzz;
There's a major difference between statement 1 and 2. For statement 1, Oracle parallelizes both create and select parts, while for 2, only the select part is parallelized. When creating table in parallel, each parallel execution server allocates a new extent, and fills it with data.
Oracle documents state: The CREATE operation of CREATE TABLE ... AS SELECT can be parallelized only by a PARALLEL clause or an ALTER SESSION FORCE PARALLEL DDL statement. When the CREATE operation of CREATE TABLE ... AS SELECT is parallelized, Oracle Database also parallelizes the scan operation if possible.
The scan operation cannot be parallelized if, for example:
The SELECT clause has a NO_PARALLEL hint.
The operation scans an index of a nonpartitioned table.
When the CREATE operation is not parallelized, the SELECT can be parallelized if it has a PARALLEL hint or if the selected table (or partitioned index) has a parallel declaration.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Oracle 생성 향후 3일간의 전체 시점 (단계 상세)수요: X 좌표축 시간은 모두 정시 시간으로 앞으로 3일 동안의 예측을 보여준다(x 축은 앞으로 3일 동안의 정시 시간을 보여준다), 3시간마다 한 눈금, 가로 좌표는 모두 24개의 눈금을 보여준다 1단계: 현재 시...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.