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

Distributed Database Management Systems: Lecture 34

26 33 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

Định dạng
Số trang 26
Dung lượng 82,21 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 34. The main topics covered in this chapter include: query optimization; centralized QO; best access path; join processing; QO in distributed environment; single relation queries: executed according to the best access path;...

Trang 1

Distributed Database Management Systems

Lecture 34

Trang 2

In the previous lecture

• Concluded Data Localization

• Query Optimization

– Components: Search space, cost

model, search strategy

– SS consists of eq query trees

– SSts could be static, dynamic or

randomized

– Cost model sees response and total

times…

Trang 3

–Database statistics are used to

evaluate size of iterm Tables

–Selectivity factor, card, size are

some major figures

Trang 5

• Queries involving Joins

in three steps

Trang 6

1 Determine the possible

ordering of

joins-2 Determine the cost of

each ordering

3 Choose the join ordering

with minimal cost

Trang 7

• Cost model assigns

Trang 8

statistics-• Two major steps in

Optimization Algorithm

– Best access path for

individual relation with pred

– The best join ordering; two

possibilities.

Trang 11

• Example: Select eName

From EMP, ASG, PROJ Where

EMP.eNo = ASG.eNo & PROJ.pNo = ASG.pNo & pName = ‘CAD/CAM’

Trang 12

• EMP has an index on eNo

• ASG has an index on pNo

• PROJ has an index on

pNo and an index on

Trang 13

1- Choose the best access paths to each relation

• EMP: sequential scan (no

Trang 14

2- Determine the best join ordering

–Total 3! orderings are

possible

–Rather than computing for

all, some of them are pruned

–Shown in the tree, next page

Trang 15

(ASG EMP ⋈ ) PROJ ⋈ (PROJ⋈ASG)⋈E

MP

Trang 16

Join Ordering in

Fragmented Queries

Trang 18

Join Ordering

• Two relations: move the

smaller relation to the

Trang 19

• More than 2 relations

– Calculate all possible

costs

– Requires to compute size

of intermediate tables

– Difficult! Lets see why

Trang 20

• Strategy 1:

EMPsite2, site2 computes EMP’= EMP ⋈ ASGsite3 computes EMP’ ⋈ PROJ

Trang 21

• Strategy 2:

ASGsite1, site1 computes EMP’= EMP ⋈ ASGsite3 computes EMP’ ⋈ PROJ

Trang 22

• Strategy 3:

ASGsite3, site3 computes ASG’= PROJ ⋈ ASGsite1 computes EMP ⋈ ASG’

Trang 23

• Strategy 4:

PROJsite2, site2 computes PROJ’= PROJ ⋈ ASGsite1 computes EMP ⋈ PROJ’

Trang 24

• Strategy 5:

EMP, PROJsite2, site2

computes PROJ ⋈ ASG ⋈

Trang 25

Which one to Choose

• We need to know

–Size of operand tables

–Estimate interm tables’ size

• Computing all possibilities

could be lengthy

• Heuristic: Consider only

the size of

Trang 26

tables-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