Obsidian/Recognition/Work Related/프로젝트/D-MHFH/유지보수/중단파 현황 튜닝.md

52 lines
1.4 KiB
Markdown

- 운영서버 반영
```SQL
CREATE INDEX idx_TB_COMMON_MATCH_COMM ON DMFHF.TB_COMMON_MATCH(COMM_GB, COMM_CD);
create index idx_TB_PASSIVLC_RSPNS_rdt on TB_PASSIVLC_RSPNS(report_dt);
create index idx_TB_DSAST_RCV_rdt on TB_DSAST_RCV(SND_DT);
create index idx_TB_CALL_REQUST_rdt on TB_CALL_REQUST(SND_DT);
---------------------------------------------------------------------------
CREATE UNIQUE INDEX PK_TB_LC_FSHOPRRPT_202206 ON TB_LC_FSHOPRRPT_202206(Slot_no, report_dt, MODEM);
ALTER TABLE TB_LC_FSHOPRRPT_202206 ADD ( CONSTRAINT PK_TB_LC_FSHOPRRPT_202206 PRIMARY KEY (Slot_no, report_dt, MODEM) USING INDEX PK_TB_LC_FSHOPRRPT_202206 ENABLE VALIDATE);
---------------------------------------------------------------------------
--테이블 생성 함수 재 컴파일
SP_CREATE_POSFISH_TABLE_NEW
```
- Rest Query파일 반영
```SQL
```
- 데이터 정리
``` SQL
-- 데이터 확인
select slot_no||to_char(report_dt, 'yyyymmddhh24miss')||modem as rowkey, count(*) as cnt
from TB_LC_FSHOPRRPT_202205
group by slot_no||to_char(report_dt, 'yyyymmddhh24miss')||modem
having count(slot_no||to_char(report_dt, 'yyyymmddhh24miss')||modem) > 1
-- 중복 제거
delete
from TB_LC_FSHOPRRPT_202202
where rowid in (
select min(rowid) as rid
from TB_LC_FSHOPRRPT_202202
group by slot_no||to_char(report_dt, 'yyyymmddhh24miss')||modem
having count(slot_no||to_char(report_dt, 'yyyymmddhh24miss')||modem) > 1
)
```