메뉴 건너뛰기

배경이미지

프로그램개발 - [ORACLE] HINT 종류

Database
2016.05.21 23:34

[ORACLE] HINT 종류

조회 수 705 추천 수 0 댓글 0

/*+ ALL_ROWS */
 explicitly chooses the cost-based approach to optimize a statement block with a goal of best throughput (that is, minimum total resource consumption)
가장 좋은 단위 처리량의 목표로 문 블록을 최적화하기 위해 cost-based 접근 방법을 선택합니다. (즉, 전체적인 최소의 자원 소비)

/*+ CHOOSE */
 causes the optimizer to choose between the rule-based approach and the cost-based approach for a SQL statement
 based on the presence of statistics for the tables accessed by the statement
최적자(optimizer)가 그 문에 의해 접근된 테이블을 위해 통계의 존재에 근거를 두는 SQL 문을 위해 rule-based 접근 방법과 cot-based 접근 방법 사이에 선택하게 합니다.

/*+ FIRST_ROWS */
 explicitly chooses the cost-based approach to optimize a statement block with a goal of best response time (minimum
 resource usage to return first row)
가장 좋은 응답 시간의 목표로 문 블록을 최적화하기 위해 cost-based 접근 방법을 선택합니다. (첫번째 행을 되돌려 주는 최소의 자원 사용)

/*+ RULE */
 explicitly chooses rule-based optimization for a statement block
문 블록을 위하여, rule-based 최적화를 고르는

/*+ AND_EQUAL(table index) */
 explicitly chooses an execution plan that uses an access path that merges the scans on several single-column indexes
그만큼 실행 계획을 선택합니다. 그리고 여럿의 single-column 색인에 그 scan을 합병하는 접근 경로를 사용합니다.

/*+ CLUSTER(table) */
 explicitly chooses a cluster scan to access the specified table
선택합니다. 그리고, 클러스터는 그 명시된 테이블을 접근하기 위해 살핍니다.

/*+ FULL(table) */
 explicitly chooses a full table scan for the specified table
그 명시된 테이블을 위하여, 전체 테이블 scan을 고르는

/*+ HASH(table) */
 explicitly chooses a hash scan to access the specified table
선택합니다. 그리고, 해쉬는 그 명시된 테이블을 접근하기 위해 운율을 살핍니다.

/*+ HASH_AJ(table) */
 transforms a NOT IN subquery into a hash antijoin to access the specified table
변환, 그 명시된 테이블을 접근하는 해쉬 antijoin으로의 NOT IN 부속 조회

/*+ HASH_SJ (table) */
 transforms a NOT IN subquery into a hash anti-join to access the specified table
변환, 그 명시된 테이블을 접근하는 해쉬 anti-join으로의 NOT IN 부속 조회

/*+ INDEX(table index) */
 explicitly chooses an index scan for the specified table 그 명시된 테이블을 위하여, 색인 scan을 고르는

/*+ INDEX_ASC(table index) */
 explicitly chooses an ascending-range index scan for the specifiedtable
그 명시된 테이블을 위하여, ascending-range 색인 scan을 고르는

/*+ INDEX_COMBINE(table index) */
 If no indexes are given as arguments for the INDEX_COMBINE hint, the optimizer uses whatever Boolean combination
 of bitmap indexes has the best cost estimate. If particular indexes are given as arguments, the optimizer tries to use
 some Boolean combination of those particular bitmap indexes.
어떤 색인도 INDEX_COMBINE 암시를 위해 인수로서 주어지지 않는다면, bitmap 색인의 결합이 어떤 부울의를 가장 좋은 수행 난이도 평가를 가지고 있든지 최적자는 이용합니다.
특별한 색인이 인수로서 주어진다면, 최적자는 그 특별한 bitmap 색인의 몇몇의 부울의 결합을 사용하려고 노력합니다.

/*+ INDEX_DESC(table index) */
 explicitly chooses a descending-range index scan for the specified table
그 명시된 테이블을 위하여, descending-range 색인 scan을 고르는

/*+ INDEX_FFS(table index) */
 causes a fast full index scan to be performed rather than a full table scan
빠른 전체 색인 scan이 전체 테이블 scan이라기보다는 수행되게 합니다.

/*+ MERGE_AJ (table) */
 transforms a NOT IN subquery into a merge anti-join to access the specified table
변환, NOT IN 부속 조회, 그 명시된 테이블을 접근하기 위해 anti-join을 합병합니다.

/*+ MERGE_SJ (table) */
 transforms a correlated EXISTS subquery into a merge semi-join to access the specified table
변환, 관련된 EXISTS 부속 조회, 접근으로 semi-join을 합병합니다, 그 명시된 테이블

/*+ ROWID(table) */
 explicitly chooses a table scan by ROWID for the specified table
그 명시된 테이블을 위하여, ROWID에 의해 테이블 scan을 고르는

/*+ USE_CONCAT */
 forces combined OR conditions in the WHERE clause of a query to be transformed into a compound query using the
 UNION ALL set operator
힘은 질의의 WHERE 문절에 있는 UNION ALL 집합 연산자를 사용하는 합성의 질의로 변형되는 OR 조건을 합쳤습니다.

/*+ ORDERED */
 causes Oracle to join tables in the order in which they appear in the FROM clause
오라클이 어느 것에 순서로 테이블을 결합시키게 합니다.

/*+ STAR */
 forces the large table to be joined last using a nested-loops join on the index
큰 있는 테이블이 최종 사용/회전율에 nested-loops를 결합시킨 힘은 그 색인에 결합합니다.

/*+ DRIVING_SITE (table) */
 forces query execution to be done at a different site from that selected by Oracle
힘은 그것과 다른 오라클에 의해 선택된 사이트에 되는 실행을 질의합니다.

/*+ USE_HASH (table) */
 causes Oracle to join each specified table with another row source with a hash join
오라클이 테이블이 다른 행 자원으로 해쉬 접합으로 명시되면서 각자와 합치게 합니다.

/*+ USE_MERGE (table) */
 causes Oracle to join each specified table with another row source with a sort-merge join
오라클이 테이블이 다른 행 자원으로 sort-merge 접합으로 명시되면서 각자와 합치게 합니다.

/*+ USE_NL (table) */
 causes Oracle to join each specified table to another row source with a nested-loops join using the specified table as the inner table
오라클이 그 명시된 테이블을 그 안의 테이블로 사용하는 nested-loops 접합과 각자와 다른 행 자원에 대한 명시된 테이블을 합치게 합니다.

/*+ APPEND */ , /*+ NOAPPEND */
 specifies that data is simply appended (or not) to a table; existing free space is not used. Use these hints only following the INSERT keyword.
데이타가 테이블로 단순히 덧붙여진다는 (or not)것 명시합니다; 무료인 현존하는 영역은 사용되지 않습니다.
단지 그 삽입 키 핵심어를 따르는 이 암시를 사용하시오.

/*+ NOPARALLEL(table) */
 disables parallel scanning of a table, even if the table was created with a PARALLEL clause
그 테이블이 PARALLEL 문절로 새로 만들어졌다면 테이블의 평행의 순차 검색을 무능하게 만듭니다.

/*+ PARALLEL(table, instances) */
 allows you to specify the desired number of concurrent slave processes that can be used for the operation.
 DELETE, INSERT, and UPDATE operations are considered for parallelization only if the session is in a PARALLEL DML
 enabled mode. (Use ALTER SESSION PARALLEL DML to enter this mode.)
당신이 그 연산을 위해 사용될 수 있는 동시의 슬레이브(slave) 프로세스의 요구된 수를 명시하는 것을 허락합니다.
그 세션이 가능하게 된 PARALLEL DML에 모드를 있다면, DELETE, INSERT, UPDATE 연산은 단지 parallelization에 대해 고려됩니다. (사용은 이 모드에 들어가기 위해 평행의 세션 DML을 변경합니다.)

PARALLEL hint를 사용하면 query에 포함된 table의 degree를 설정할 수 있습니다.
 
예를 들어, 다음과 같이 hint를 적어 degree 4로 parallel query option을  실행하도록 할 수 있습니다.
이 때 parallel이란 글자와 괄호( ’(’ )사이에 blank를 넣지 않도록 주의해야 합니다.
  
 SQL>SELECT /*+ PARALLEL(emp, 4) */   * FROM emp;
 
 * DEGREE의 의미 및 결정
 
Parallel Query에서 degree란 하나의 operation 수행에 대한 server process의 개수 입니다.
이러한 degree 결정에 영향을 주는 요인들에는 다음과 같은 것들이 있습니다.
 (1)  system의 CPU 갯수
(2)  system의 maximum process 갯수
(3)  table이 striping되어 있는 경우, 그 table이 걸쳐있는 disk의 갯수
(4)  data의 위치 (즉, memory에 cache되어 있는지, disk에 있는지)
 (5)  query의 형태 (예를 들어 sorts 혹은 full table scan)
 
한 사용자만이 parallel query를 사용하는 경우, sorting이 많이 필요한 작업과 같은 CPU-bound 작업의 경우는 CPU 갯수의 1 ~ 2배의 degree가 적당하며, sorting보다는 table scan과 같은 I/O bound 작업의 경우는 disk drive 갯수의 1 ~ 2배가 적당합니다.
 
동시에 수행되는 parallel query가 많은 경우에는 위의 각 사용자의 degree를 줄이거나 동시에 사용하는 사용자 수를 줄여야 합니다.

PARALLEL QUERY PROCESSING이 사용되어질 수 있는 SQL 문장의 종류

(1) SELECT 문장
(2) UPDATE, INSERT, DELETE 문 내의 subquery
 (3) CREATE TABLE ... AS SELECT 문
(4) CREATE INDEX 문
 위와 같은 문장 내에 최소한 하나의 full table scan operation이 포함되어야 query가 parallelize된다.

병렬로 수행하기 위해서는 세션을 'ALTER SESSION ENABLE PARALLEL DML'로 지정해야만 사용 가능하다.
반대 'ALTER SESSION DISABLE PARALLEL DML'

/*+ PARALLEL_INDEX
 allows you to parallelize fast full index scan for partitioned and nonpartitioned indexes that have the PARALLEL attribute
 parallelize에 당신에게 빠른 가득한 색인 scan을 허락합니다. 그런데, 그것은 PARALLEL 속성을 가지고 있는 색인을 분할했고 nonpartitioned했습니다.

/*+ NOPARALLEL_INDEX */
 overrides a PARALLEL attribute setting on an index
병렬이 색인을 나아가는 것을 속하게 하는 대체

/*+ CACHE */
 specifies that the blocks retrieved for the table in the hint are placed at the most recently used end of the LRU list in the
 buffer cache when a full table scan is performed
그 블록이 찾아서 가져왔다는 것을 명시합니다. 그리고 그 테이블을 위해 그 암시에 놓여집니다. 그런데, 그것은 가장 요즈음 사용된 언제 그 버퍼 캐쉬, 가득한 테이블 scan에 있는 LRU 리스트의 끝입니다. 수행됩니다.

/*+ NOCACHE */
 specifies that the blocks retrieved for this table are placed at the least recently used end of the LRU list in the buffer cache when a full table scan is performed
그 명시합니다. 그리고, 그 블록은 이 테이블을 위해 검색되면서 요즈음 사용된 언제 그 버퍼 캐쉬, 가득한 테이블 scan에 있는 LRU 리스트의 가장 작은 끝에 놓여집니다. 수행됩니다.

/*+ MERGE (table) */
 causes Oracle to evaluate complex views or subqueries before the surrounding query
오라클이 그 둘러싸는 질의 전에 복잡한 뷰나 부속 조회를 평가하게 합니다.

/*+ NO_MERGE (table) */
 causes Oracle not to merge mergeable views
오라클이 mergeable 뷰를 합병하지 않게 하지 않습니다

/*+ PUSH_JOIN_PRED (table) */
 causes the optimizer to evaluate, on a cost basis, whether or not to push individual join predicates into the view
개개 접합을 미는 것이 그 뷰 안으로 단정 하든 간에 비용 방식으로 최적자가 평가하게 합니다.

/*+ NO_PUSH_JOIN_PRED (table) */
 Prevents pushing of a join predicate into the view
접합 술부 중에서 그 뷰로 밀면서, 막는

/*+ PUSH_SUBQ */
 causes nonmerged subqueries to be evaluated at the earliest possible place in the execution plan
원인은 그 실행 계획에서의 가장 이른 가능한 장소에 평가되는 부속 조회를 nonmerged했습니다.

/*+ STAR_TRANSFORMATION */
 makes the optimizer use the best plan in which the transformation has been used.
최적자가 그 변형이 사용된 가장 좋은 계획을 사용하는 제작

 

 

 

*오라클 힌트 사용표

 

INDEX ACCESS OPERATION 관련 HINT
HINT 내용 사용법
INDEX  INDEX를 순차적으로 스캔 INDEX(TABLE명, INDEX명)
INDEX_DESC INDEX를 역순으로 스캔 INDEX_DESC(TABLE명, INDEX명)
INDEX_FFS INDEX FAST FULL SCAN INDEX_FFS(TABLE명, INDEX명)
PARALLEL_INDEX INDEX PARALLEL SCAN PARALLEL_INDEX(TABLE명,INDEX명)
NOPARALLEL_INDEX INDEX PARALLEL SCAN 제한 NOPARALLEL_INDEX(TABLE명,INDEX명)
AND_EQUALS INDEX MERGE 수행 AND_EQUALS(INDEX_NAME, INDEX_NAME)
FULL FULL SCAN FULL(TALBE명)
     
     
JOIN ACCESS OPERATION 관련 HINT
HINT 내용 사용법
USE_NL NESTED LOOP JOIN USE_NL(TABLE1, TABLE2)
USE_MERGE SORT MERGE JOIN USE_MERGE(TABBLE1, TABLE2)
USE_HASH HASH JOIN USE_HASH(TABLE1, TABLE2)
HASH_AJ HASH ANTIJOIN HASH_AJ(TABLE1, TABLE2)
HASH_SJ HASH SEMIJOIN HASH_SJ(TABLE1, TABLE2)
NL_AJ NESTED LOOP ANTI JOIN NL_AJ(TABLE1, TABLE2)
NL_SJ NESTED LOOP SEMIJOIN NL_SJ(TABLE1, TABLE2)
MERGE_AJ SORT MERGE ANTIJOIN MERGE_AJ(TABLE1, TABLE2)
MERGE_SJ SORT MERGE SEMIJOIN MERGE_SJ(TABLE1, TABLE2)
     
     
JOIN시 DRIVING 순서 결정 HINT
HINT 내용
ORDERED FROM 절의 앞에서부터 DRIVING
DRIVING 해당 테이블을 먼저 DRIVING- driving(table)
     
     
기타 힌트
HINT 내용
append insert 시 direct loading
parallel select, insert 시 여러 개의 프로세스로 수행- parallel(table, 개수)
cache 데이터를 메모리에 caching
nocache 데이터를 메모리에 caching하지 않음
push_subq subquery를 먼저 수행
rewrite query rewrite 수행
norewrite query rewrite 를  수행 못함
use_concat in절을 concatenation access operation으로 수행
use_expand in절을 concatenation access operation으로 수행 못하게 함
merge view merging 수행
no_merge view merging 수행 못하게 함

 

 

 

 

 

출처 : http://mikyung.net/399







컴퓨터 프로그램

컴퓨터 언어 공부및 개발

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
19 Unix/Linux [Linux] source 로 설치한 패키지의 pkg-config 정보가 인식이 안될때 마리오 2018.01.12 1276
18 Unix/Linux Linux 주기적으로 자동으로 시간 동기화하기 상자 2017.11.04 233
17 C/C++ linux 에서 gcc 컴파일하기 마리오 2016.11.25 409
16 Unix/Linux CentOS 에서 minimal로 설치 후 X windows 설치 하는 방법 마리오 2016.09.12 202
15 Unix/Linux CentOS 6 Minimal - VMware 네트워크 설정하기 마리오 2016.09.12 277
14 Unix/Linux CentOS 6.x 에서 mysql 과 apache(httpd) 를 자동 실행 설정 방법 마리오 2016.09.07 256
13 JAVA CentOS 에서 rpm으로 java 최신버젼 설치하기 마리오 2016.08.26 278
» Database [ORACLE] HINT 종류 상자 2016.05.21 705
11 Database [ORACLE] 대용량 데이터 Insert 방법 상자 2016.05.21 2500
10 Android genymotion 안드로이드 google play services 상자 2016.04.03 246
9 Android 안드로이드 스튜디오 - 애뮬레이터 , Genymotion, 상자 2016.03.26 431
8 Android WebView android 4.4.2 킷캣 이미지 올리기에 대한 자료. 상자 2016.03.21 2424
7 Android 인트로 화면 만들기 상자 2016.02.29 800
6 Android 안드로이드 Intent 사용 예시 상자 2016.02.29 284
5 Unix/Linux 유닉스 계열에서 소스컴파일 설치 후 소스디렉토리 지우지 말것. 상자 2016.02.26 309
4 Unix/Linux php.ini 위치 찾기 상자 2016.02.26 409
3 Android android.os.NetworkOnMainThreadException 해결방법 상자 2016.02.25 1823
2 Android PHP WEB서버 기반 스마트폰 푸시(PUSH) 서비스 만들기 file 상자 2016.02.24 2094
1 Android Unauthorized Error 401 오류 - 안드로이드 푸시 알람 file 상자 2016.02.24 2350
Board Pagination Prev 1 Next
/ 1