본문 바로가기

use-the-index-luke

A.3-3 (Oracle) Access vs. filter predicates

https://prod-files-secure.s3.us-west-2.amazonaws.com/b8c9890e-187a-4d96-9a74-adbfa05b6d4f/71fd9ca6-2c49-44ba-ab38-db33d009ddf8/resource_1

use-the-index-luke 저자 Markus Winand


Markus Winand는 SQL에 대한 통찰력을 제공하고 다양한 시스템이 SQL을 지원하는 방법을 modern-sql.com 에서 보여줍니다. 이전에 그는 use-the-index-luke.com 을 만들었는데, 지금도 활발하게 유지되고 있습니다. Markus는 winand.at 를 통해 강사, 연사 및 컨설턴트로 고용될 수 있습니다.


You can upload a Korean translation of use-the-index-luke.com on your blog

Thank you from the bottom of my heart to author Makus Winand for allowing me.

These are translations that I use for studying by using a papago (google translate)

The translations may not be correct or there may be a typo.

I'd appreciate it if you could point it out in the comments.



use-the-index-luke.com 의 한글번역본을 블로그에 업로드 해도 된다고

허락해주신 Makus Winand 저자님께 진심으로 감사합니다.

이 번역본들은 제가 공부용도로 번역기(papago, google transrate)를 돌려서

번역한 내용들이라 맞지 않거나, 오타가 있을수 있습니다.

댓글로 지적해주시면 감사하겠습니다.


https://use-the-index-luke.com/sql/explain-plan/oracle/filter-predicates

ㄴaccess 및 filter prdicate 구분

Oracle 데이터베이스는 다음과 같은 세 가지 방법으로 where clauses (predicates)를 적용합니다:

Access predicate ("access")

access predicate는 leaf node travelsal의 시작 및 중지 조건을 나타냅니다.

Index filter predicate("filter" for index operations)

Index filter predicate는 leaf node travelsal 중에만 적용됩니다. 시작 및 중지 조건에 영향을 주지 않으며 스캔 범위를 좁히지 않습니다.

Table level filter predicate("filter" for table operations)

인덱스 일부가 아닌 열의 predicates는 테이블 수준에서 평가됩니다. 이렇게 하려면 데이터베이스가 먼저 테이블에서 행을 로드해야 합니다.


Note

Index filter predicates는 잘못된 안전성을 제공합니다.

인덱스를 사용하더라도 데이터 볼륨이나 시스템 로드가 증가하면 성능이 급격히 저하됩니다.


DBMS_XPLAN 유틸리티 (“Getting an Execution Plan”참조)

를 사용하여 작성된 실행 계획은 표 실행 계획 아래의

"Predicate Information" 섹션에 인덱스 사용량을 표시합니다:



| Id | Operation | Name | Rows | Cost |

| 0 | SELECT STATEMENT | | 1 | 1445 | | 1 | SORT AGGREGATE | | 1 | | |2 | INDEX RANGE SCAN| SCALE_SLOW | 4485 | 1445 |

Predicate Information (identified by operation id): 2 - access("SECTION"=:A AND "ID2"=:B) filter("ID2"=:B)


Predicate의 번호는 실행 계획의 "Id"열을 참조합니다.

여기서 데이터베이스는 Predicate가 있는 작업을 표시하는 별표도 표시합니다.

chapter “Performance and Scalability”에서 가져온

이 예제는 access 및 filter predicate가 있는

INDEX RANGE SCAN을 보려줍니다.

Oracle 데이터베이스에는 일부 filter predicate가 access predicate(ID2 =: B)로 표시되는 특성이 있습니다.


Important

조건이 filter predicate로 표시되는 경우 filter predicate이므로 access predicate로 표시되는지 여부는 중요하지 않습니다.


즉, INDEX RANGE SCAN이 조건 "SECTION"=:A 에 대한 전체 범위를 지정하고 각 행에 "ID"=:B 필터를 적용합니다.

테이블 수준의 filter predicate는 인덱스 행 ID별 TABLE ACCESS 또는 TABLE ACCESS FULL과 같은 각 테이블 액세스에 대해 표시합니다.

도구에 따라 predicate information가 다르게 표시됩니다.

예를 들어 Oracle SQL Developer 는 각 작업 아래에 predicate를 표시합니다.

FigureA.1 Access and Filter Predicates in Oracle SQL Developer


https://prod-files-secure.s3.us-west-2.amazonaws.com/b8c9890e-187a-4d96-9a74-adbfa05b6d4f/51606f48-67c6-4e2a-93df-a342fcd67bc5/resource_2

일부 도구는 predicate information을 전혀 표시하지 않습니다.

Getting an Execution Plan” 에서 설명한 대로 언제든지 DBMS_XPLAN으로 돌아갈 수 있습니다.


Tip

“Greater, Less andBETWEEN”섹션에서는 access 및 index filter predicate의 차이를 예로 설명합니다.

Chapter3, “Performance and Scalability에서는 filter predicate가 수행하는 성능 차이를 보여줍니다.


'use-the-index-luke' 카테고리의 다른 글

A.4-1 (Postgre) Getting  (1) 2023.12.28
A.4 PostgreSQL  (1) 2023.12.26
A.3-2 (Oracle) Operations  (0) 2023.12.18
A.3-1 (Oracle) Getting  (1) 2023.12.15
A.3 Oracle  (0) 2023.12.13