# 2일차

show parameter sort\_area\_size;

show parameter hash\_area\_size;

alter session set sort\_area\_size = 1097152;

select \* from v$object\_usage;

alter index PK\_EMP MONITORING USAGE;

모든 sql이 인덱스를 사용해야만 하는가?

* 10\~15 % 이하의 데이터를 처리하는 경우에 효율적, 그이상은 인덱스를 사용하지 않는 것이 더 좋다.&#x20;

인덱스

* B tree
  * 주기적인 리빌딩 필요.

```sql
select MAX(SEQ) + 1
from product
where dept = '12300';
```

멀티 블록 읽기

* DB\_FILE\_MULTIBLOCKREAD\_COUNT = 4 -> 8개로 늘리는 것도 튜닝포인

```sql
INSERT /*+ PARALLEL(A,4) */
INTO EX_EXAM_QAPPLY_2 A
SELECT /*+ PARALLEL(B,4) */
*
FROM EX_EXAM_QAPPLY B;
```

인덱스를 타지 않는 경우&#x20;

* 부정연산자
* null 값


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ssosso.gitbook.io/study/os-and-infra-and-system/sql/2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
