튜닝 연습
select /*+index(상담_x3)*/count(distinct 고객번호)
from 상담 --1000만건
where 상담일자<to_char(sysdate, 'yyyymmdd') --거의 대부분 상담일자 조건절 만족
and 클레임상품명 is not null --1000만건 중 200000건만 클레임상품명 not null
;
select /*+index(상담_x3)*/count(distinct 고객번호)
from 상담 --1000만건
where 상담일자<to_char(sysdate, 'yyyymmdd') --거의 대부분 상담일자 조건절 만족
and 클레임상품명>=chr(0) --1000만건 중 200000건만 클레임상품명 not null
;
select /*+index(클레임상품번호, 상담일자) */ count(distinct 고객번호)
from 상담 --1000만건
where 상담일자<to_char(sysdate, 'yyyymmdd') --거의 대부분 상담일자 조건절 만족
and 클레임상품번호 >= (select min(클레임상품번호) from 상담); --1000만건 중 200000건만 클레임상품명 not null
;
select /*+use_concat */ count(distinct 고객번호)
from 상담 --1000만건
where 상담일자<to_char(sysdate, 'yyyymmdd') --거의 대부분 상담일자 조건절 만족
and 클레임상품번호 >=0 or 클레임상품번호 < 0; --1000만건 중 200000건만 클레임상품명 not null
;
select chr(0) from dual;
'개발관련 > DB관련(Oracle)' 카테고리의 다른 글
오라클 테이블, 컬럼, pk, comment, data type 조회 (0) | 2023.01.14 |
---|---|
date 타입과 timestamp 타입 조회 (0) | 2022.09.23 |
Oracle/PLSQL: Dealing with apostrophes/single quotes in strings (0) | 2011.06.15 |
테이블 스페이스 용량조회 (0) | 2011.05.04 |
파티셔닝 이용 시기 (0) | 2011.04.28 |