May every moment inspire me.

study things

Chap 12. Query Processing

my_jennyee 2019. 5. 26. 22:59

[Chap12. Query Processing _ 질의 처리]

 

질의 처리란, 데이터베이스로부터 데이터를 꺼내오는 것과 관련된 일련의 작업들을 말한다. 

 

Query 처리 단계

Basic Steps in Query Processing

1. Parsing and translation_파싱과 변환

2. Optimization_최적화

3. Evaluation_평가 

 

Query optimization 최적화

: Amongst all equivalent evaluation plans choose the one with lowest cost.

 

Query Cost의 측정

- Cost is generally measured as total elapsed time for answering query, many factors contribute the cost.

 

측정법

  • Number of seeks * average-seek-cost
  • Number of blocks read * average-block-read-cost
  • Number of blocks written * average-block-write-cost

13.3 선택 연산 Selection Operation

 

파일 스캔 (file scan)

- 선택 조건을 만족하는 레코드를 찾아서 꺼내오는 검색 알고리즘

- 데이터에 액세스하는 최하위 단계의 연산

- 관계형 시스템에서 파일 스캔을 사용하는 경우 릴레이션이 하나의 전용 파일에 저장된 경우에는 전체 릴레이션을 읽게 된다.

 

13.3.1 기본 알고리즘 : Linear Search (A1)

Scan each file block and test all records to see whether they satisfy the selection condition

  • Cost estimate (스캔이 된 디스크 블록의 개수) = br
  •  
728x90