SlideShare a Scribd company logo
Query Processing 2
2019-04-29 유동호
Access Method - Sequential Scan
• 각 테이블의 페이지마다…

• Buffer Pool 로 가져와 데이터를 탐색

• 각 튜플을 반복(Iterate)해가면서 해당 튜플이 필요(?)한지를 판단

• DBMS 가 쿼리를 실행시키는 상황에서 거의 항상 최악의 경우

• 몇가지 Optimization
Optimization - Zone Maps
• 각 페이지마다 속성 값을 미리 계산해놓는다.

• DBMS 는 쿼리 실행에 해당 페이지의 엑세스가 필요한지를 우선 zone map 을 확인하여 결정한다.

• 원래 데이터를 가진 페이지와 분리된 다른 페이지에 저장하며, 저장되는 데이터의 크기가 작기 때문에 하나의
Zone map 페이지에 여러 페이지의 결과 데이터를 저장한다.
Optimization - Late Materialization
Multi-Index Scan
만약 DBMS 가 쿼리를 위해 사용할 수 있는 다중 Index 가 있다면

• 각각의 매칭되는 인덱스를 이용해 Record ID 의 셋을 계산한다.

• 쿼리의 기술에 기초해 위의 셋을 결합시킨다(union vs. intersect).

• 결합된 레코드를 탐색한 다음 남은 과정을 진행한다.
Index Scan Page Sorting
인덱스는 ID 에 대해 순서가 정해져 있지 않다.

따라서 인덱스 스캔으로 가져온

Record ID 셋으로 튜플 스캔을 진행할 때,

페이지 fetch 에 있어 효율적이지 못할 수 있다
Expressing Evaluation
Expressing Evaluation

More Related Content

More from Dongho Yu

2019 lightning talk_3
2019 lightning talk_32019 lightning talk_3
2019 lightning talk_3
Dongho Yu
 
2019 lightning talk_2
2019 lightning talk_22019 lightning talk_2
2019 lightning talk_2
Dongho Yu
 
2019 lightning talk_1
2019 lightning talk_12019 lightning talk_1
2019 lightning talk_1
Dongho Yu
 
Cache
CacheCache
Cache
Dongho Yu
 
Main memory
Main memoryMain memory
Main memory
Dongho Yu
 
Control unit
Control unitControl unit
Control unit
Dongho Yu
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
Dongho Yu
 
Cpu basic
Cpu basicCpu basic
Cpu basic
Dongho Yu
 
Computer system
Computer systemComputer system
Computer system
Dongho Yu
 
Breadth first search
Breadth first searchBreadth first search
Breadth first search
Dongho Yu
 
Intro to algorithms
Intro to algorithmsIntro to algorithms
Intro to algorithms
Dongho Yu
 

More from Dongho Yu (11)

2019 lightning talk_3
2019 lightning talk_32019 lightning talk_3
2019 lightning talk_3
 
2019 lightning talk_2
2019 lightning talk_22019 lightning talk_2
2019 lightning talk_2
 
2019 lightning talk_1
2019 lightning talk_12019 lightning talk_1
2019 lightning talk_1
 
Cache
CacheCache
Cache
 
Main memory
Main memoryMain memory
Main memory
 
Control unit
Control unitControl unit
Control unit
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 
Cpu basic
Cpu basicCpu basic
Cpu basic
 
Computer system
Computer systemComputer system
Computer system
 
Breadth first search
Breadth first searchBreadth first search
Breadth first search
 
Intro to algorithms
Intro to algorithmsIntro to algorithms
Intro to algorithms
 

2019 lightning talk_11

  • 2. Access Method - Sequential Scan • 각 테이블의 페이지마다… • Buffer Pool 로 가져와 데이터를 탐색 • 각 튜플을 반복(Iterate)해가면서 해당 튜플이 필요(?)한지를 판단 • DBMS 가 쿼리를 실행시키는 상황에서 거의 항상 최악의 경우 • 몇가지 Optimization
  • 3. Optimization - Zone Maps • 각 페이지마다 속성 값을 미리 계산해놓는다. • DBMS 는 쿼리 실행에 해당 페이지의 엑세스가 필요한지를 우선 zone map 을 확인하여 결정한다. • 원래 데이터를 가진 페이지와 분리된 다른 페이지에 저장하며, 저장되는 데이터의 크기가 작기 때문에 하나의 Zone map 페이지에 여러 페이지의 결과 데이터를 저장한다.
  • 4. Optimization - Late Materialization
  • 5. Multi-Index Scan 만약 DBMS 가 쿼리를 위해 사용할 수 있는 다중 Index 가 있다면 • 각각의 매칭되는 인덱스를 이용해 Record ID 의 셋을 계산한다. • 쿼리의 기술에 기초해 위의 셋을 결합시킨다(union vs. intersect). • 결합된 레코드를 탐색한 다음 남은 과정을 진행한다.
  • 6. Index Scan Page Sorting 인덱스는 ID 에 대해 순서가 정해져 있지 않다. 따라서 인덱스 스캔으로 가져온 Record ID 셋으로 튜플 스캔을 진행할 때, 페이지 fetch 에 있어 효율적이지 못할 수 있다