CAFE

2. SQL튜닝

Re: 🟥 오늘의 마지막 문제 (이수자 평가 3번 문제)

작성자23기_박지호|작성시간26.06.18|조회수7 목록 댓글 0

alter table emp19
modify telecom varchar(30);

create cluster c_emp19_telecom_hash
(telecom varchar2(30) )
size 1024
hashkeys 10;

create table emp19_cluster
cluster c_emp19_telecom_hash(telecom)
as
    select *
        from emp19
        where 1 = 2;

create table telecom_table_cluster
cluster c_emp19_telecom_hash(telecom)
as
    select *
        from telecom_table
        where 1 = 2;

insert into emp19_cluster
select *
    from emp19;
    
insert into telecom_table_cluster
select *
    from telecom_table;
    
    commit;

-- 튜닝전:
select  e.ename, e.age, e.address, t.t_price
  from  emp19  e, telecom_table  t
  where e.telecom = t.telecom  and  e.telecom = 'kt';
  
--- 튜닝후: 
select  e.ename, e.age, e.address, t.t_price
  from  emp19_cluster  e, telecom_table_cluster  t
  where e.telecom = t.telecom  and  e.telecom = 'kt';

 

 

다음검색
현재 게시글 추가 기능 열기

댓글

댓글 리스트
맨위로

카페 검색

카페 검색어 입력폼