1. Trang chủ
  2. » Công Nghệ Thông Tin

Distributed Database Management Systems: Lecture 32

34 43 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Final Phase of Query Optimization: Data Localization
Thể loại lecture
Định dạng
Số trang 34
Dung lượng 105,04 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Distributed Database Management Systems: Lecture 32. The main topics covered in this chapter include: final phase of QD; next phase of query optimization: data localization; idempotency of unary Ops; commuting selection with projection;...

Trang 1

Distributed Database Management Systems

Lecture 32

Trang 2

In the previous lecture

• Query Processing

• Query Decomposition

• Its Different Phases.

Trang 4

3- Idempotency of unary Ops

Trang 6

• Many equivalence query

trees can be generated

• Comparing all such trees

to select best is not

feasible

• Heuristic is applied

Trang 7

1 Separation of Unary Ops

2 Unary ops on the same

relation grouped together

3 Unary ops commuted with

binary ops

4 Binary ops are ordered

Trang 8

ASN PROJ EMP

x

⋈ pNo^eNo

(pName = ‘CAD/CAM’)^ ( dur = 12 v dur = 24)^ eName ’Saleem’

eName

Trang 9

PROJ ASG EMP

pName = ‘CAD/CAM’ dur=12 v dur = 24 eName != ‘Saleem’

pNo, eName eName

Trang 10

• This concludes Query

Trang 11

• Now we move to the

second phase of Query Optimization; Data

Localization of DD

phase transform into

local ones (fragments)

Trang 13

Reduction During Data

Localization

Trang 14

Example Schema

• EMP(eNo, eName, title)

• Horizontal Fragmentation

• EMP1 = eNo ≤ ‘E3’ (EMP)

• EMP2 = ’E3’<eNo ≤ ‘E6’ (EMP)

• EMP3 = eNo > ‘E6’ (EMP)

Trang 15

• Reduction with Selection

• Rule 1:

pi (Rj) = Ø if x in R ∀ j: (pi(x) ^ pj(x))

• That is, there exist

conflicting predicates

Trang 16

• Select * from EMP where

Trang 17

Reduction on Join

• Distributing joins over

unions and avoiding

unnecessary joins

• (R1UR2) ⋈ R3= (R1 ⋈

R3) U (R2 ⋈ R3)

Trang 18

• Rule2:

• Ri⋈ Rj = Ø if x in R ∀ iand y in R ∀ j: (pi(x) ^

pj(x))

• Useless joins can be

determined viewing the join predicates

Trang 19

• Remember! Reduced query

is not always better We

have to be

watchful-• Parallel Execution

• ASG1 = eNo ≤ ‘E3’ (ASG)ASG1 =

• ASG2 = ’eNo > ‘E3’ (ASG).ASG2 =

Trang 20

• Select eName

From EMP, ASG

Where EMP.eNo = ASG eNo.

Trang 21

• We already know about

Trang 24

• EMP1 = eNo, eName (EMP)

• EMP2 = eNo, title (EMP)

Trang 25

Rule3: D,K(Ri) is

useless if the set of

projection attributes D

is not in A‘.

Trang 28

• Example

• ASG1: ASG ⋉ ENO EMP1

• ASG2: ASG ⋉ ENO EMP2

Trang 29

• Query

SELECT * FROM

EMP, ASG WHERE

ASG.eNo = EMP.eNo AND EMP.title =

"Mech Eng."

Trang 31

⋈eNo

U

title = ‘Mech Eng.’

Pushing Selection Down

⋈eNo

Trang 32

⋈eNo

U

title = ‘Mech Eng.’

Union Moved Up

title = ‘Mech Eng.’

⋈eNo

Trang 33

title = ‘Mech Eng.’

Optimal Reduced Query

⋈eNo

Trang 34

Thanks

Ngày đăng: 05/07/2022, 13:41

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN