Tải bản đầy đủ (.pdf) (21 trang)

Distributed Database Management Systems: Lecture 14

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (177.77 KB, 21 trang )

Distributed Database
Management Systems

Lecture 14


Minterm predicates:
given a set of simple predicates
Pr = {pr1, pr2, …, pm}for a relation R, the
set of minterm predicates M is defined
as

Virtual University of Pakistan

2


M = {m1, m2, ……, mz}
M = {mj | mj = p*k}, 1 ≤ k ≤ m, 1 ≤ j
≤z
p ∈ Pr
k

where p*k = pk or p*k = (pk)

Virtual University of Pakistan

3


PAY(title, sal)


p1: title = “El Eng”
p2: title = “Sys Ana”
p3: title = “Mech Eng”
p4: title = “Prog”
p5: SAL ≤ 20,000
p6: SAL > 20000
Virtual University of Pakistan

4


Minterm Predicates

Virtual University of Pakistan

5


m1: title = “El Eng”
m2: title = “Sys Ana”

Virtual University of Pakistan

SAL ≤ 20,000
SAL > 20,000

6


PHF-Requirements

3- minterm selectivities sel(mi):
number of tuples of the relation that
would be accessed by a user query
involving mi. Like, sel(m1) = 0 as
per data on p108

Virtual University of Pakistan

7


4- Access frequencies acc(qi):
frequency with which user
applications access data. If Q(q1,
q2, …, qn} is set of user queries,
then acc(qi) determines the
access frequency of qi within a
given period, like acc(q2) = 24
5- Access frequencies minterm
acc(mi) can also be defined from
acc(q
)
i
Virtual University of Pakistan
8


• A PHF is defined by a selection
operation on the owner
relations of the database

schema, given a relation R, its
PHF are given by
Ri = Fi
(R), 1 ≤ i ≤ w
– Where Fj is a selection formula,
which is (preferably) a minterm
predicate.
Virtual University of Pakistan

9


PHF (Simple Example)

Virtual University of Pakistan

10


PAY
Title

Sal

Elect. Eng

40000

Sys Analyst


34000

Mech. Eng

27000

Programmer

24000

Virtual University of Pakistan

11


PAY1 = σ sal ≤ 30000  (PAY)
PAY2 = σ sal > 30000 (PAY)
Virtual University of Pakistan

12


Title

Sal

Elect. Eng

40000


Sys Analyst

34000

PAY1

PAY2

Title

Sal

Mech. Eng

27000

Programmer

24000

Virtual University of Pakistan

13


• Defining simple predicates may be
tricky
– in case of continuous domain
– Balance in Fragments’ Size


Virtual University of Pakistan

14


A set of simple predicates Pr is said to
be complete if the accesses to the
tuples of the minterm fragments
defined on Pr requires
that two tuples of the same minterm
fragment have the same probability of
being accessed by the application.

Virtual University of Pakistan

15


Completeness Example

Virtual University of Pakistan

16


PROJ
pNo

pName


budget

Loc

P1

Instrumentation

3.5M

Lahore

P2

Database Dev.

2.3M

Rawalpindi

P3

CAD/CAM

1.9M

Rawalpindi

P4


Maintenance

1.6M

Peshawar

Virtual University of Pakistan

17


–Find the budgets of projects at
each location. (1)
–Find projects with budgets less
than 2M. (2)

Virtual University of Pakistan

18


• According to (1),
Pr = {LOC=“Lahore”,
LOC=“Rawalpindi”,
LOC=“Peshawar”}

• Which is not complete with respect to
(2).

Virtual University of Pakistan


19


Modify
Pr = {LOC=“Lahore”,
LOC=“Rawalpindi”, LOC=“Peshawar”,
BUDGET<=200000, BUDGET
>200000}
• Which is complete.

Virtual University of Pakistan

20


Thanks



×