개요) 서로 다른 Table은 Cluster Key(공통된 Column)를 거지고 있어야 한다.
예를들면 emp Table과 dept Table ---> 공통컬럼 deptno
만약 emp, dept Table을 Cluster로 묶는다면 Data를 물리적으로 동일한 데이터 블럭에 저장한다.
그러므로 디스크 입출력이 줄어들고, 클러스터화된 테이블 조인에 엑세스하는 시간이 개선됨
클러스터화가 적당한 Table은 Insert나 Update가 주된 질의가아님 Select로 인해 조인을 많이하는
Table에 적합하다.
클러스터화된 Table에 행을 삽입하기전에 Cluster Index를 생성해야 하며, 클러스터 Data와 클러스터 인덱스는
서로 다른(물리적) TableSpace에 저장하는 것이 바람직하다.
생성방법)
1.클러스터를 먼저 생성
create cluster emp_dept (deptno number(3))
pctused 80
pctfree 5
size 600
tablespace users
storage
(
initial 200k
next 300k);
위에서 pctfree를 5로 준 이유는 갱신등을 위해 미리 확보하는 영역을 최소화 했슴
주로 Select를 하는 Table이기 때문...
2.Table생성
create table dept (
deptno number(3),
dept varchar2(20),
....)
cluster emp_dept (deptno);
create table emp (
empno number(5),
ename varchar2(20),
deptno number(3),
....)
cluster emp_dept (deptno);
3.Cluster Index 생성
create index emp_dept_idx on cluster emp_dept
tablespace users_index
storage
(
initial 100k
next 100k)
pctfree 5;
삭제방법)
1. Table을 포함하지 않는 Cluster의 삭제
drop cluster emp_dept;
2. Table을 포함하는 Cluster의 삭제
drop cluster emp_dept including tables;
Previous Article : DataBase의 시작과 종료
Next Article : 중복된 Record 삭제방법
예를들면 emp Table과 dept Table ---> 공통컬럼 deptno
만약 emp, dept Table을 Cluster로 묶는다면 Data를 물리적으로 동일한 데이터 블럭에 저장한다.
그러므로 디스크 입출력이 줄어들고, 클러스터화된 테이블 조인에 엑세스하는 시간이 개선됨
클러스터화가 적당한 Table은 Insert나 Update가 주된 질의가아님 Select로 인해 조인을 많이하는
Table에 적합하다.
클러스터화된 Table에 행을 삽입하기전에 Cluster Index를 생성해야 하며, 클러스터 Data와 클러스터 인덱스는
서로 다른(물리적) TableSpace에 저장하는 것이 바람직하다.
생성방법)
1.클러스터를 먼저 생성
create cluster emp_dept (deptno number(3))
pctused 80
pctfree 5
size 600
tablespace users
storage
(
initial 200k
next 300k);
위에서 pctfree를 5로 준 이유는 갱신등을 위해 미리 확보하는 영역을 최소화 했슴
주로 Select를 하는 Table이기 때문...
2.Table생성
create table dept (
deptno number(3),
dept varchar2(20),
....)
cluster emp_dept (deptno);
create table emp (
empno number(5),
ename varchar2(20),
deptno number(3),
....)
cluster emp_dept (deptno);
3.Cluster Index 생성
create index emp_dept_idx on cluster emp_dept
tablespace users_index
storage
(
initial 100k
next 100k)
pctfree 5;
삭제방법)
1. Table을 포함하지 않는 Cluster의 삭제
drop cluster emp_dept;
2. Table을 포함하는 Cluster의 삭제
drop cluster emp_dept including tables;
Previous Article : DataBase의 시작과 종료
Next Article : 중복된 Record 삭제방법
![]() | ![]() ![]() | 12-27 | 2604 | |
![]() | ![]() ![]() | 12-11 | 1883 | |
53 | ![]() ![]() | 03-15 | 1698 | |
52 | ![]() ![]() | 01-31 | 1801 | |
51 | ![]() ![]() | 01-31 | 2652 | |
50 | ![]() ![]() | 01-31 | 1420 | |
49 | ![]() ![]() | 01-19 | 1732 | |
48 | ![]() ![]() | 01-11 | 1623 | |
47 | ![]() ![]() | 01-03 | 2145 | |
46 | ![]() ![]() | 12-27 | 2604 | |
45 | ![]() ![]() | 12-19 | 1845 | |
44 | ![]() ![]() | 12-14 | 1821 | |
43 | ![]() ![]() | 12-11 | 1883 | |
42 | ![]() ![]() | 12-09 | 1478 | |
41 | ![]() ![]() | 12-01 | 1709 | |
40 | ![]() ![]() | 12-01 | 1882 | |
39 | ![]() ![]() | 12-01 | 1355 |
댓글 없음:
댓글 쓰기