0% found this document useful (0 votes)
290 views14 pages

SDD 1 Algorithm

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 14

PARASA PREMDEEP

08BCE213

SDD-1 ALGORITHM
System for Distributed Databases A non-commercial database Based on the Hill Climbing Algorithm No semijoins, No replication, No fragmentation.

SDD-1 ALGORITHM
Cost of transferring the result to the user site from the final result site is not considered Can minimize either total time or response time Input include Query Graph Locations of relations Relations statistics.

STEPS
1- Do the initial local processing

2- Select the initial best plan (ES 0) Calculate cost of moving all relations to a single site Plan with the least cost is ES0

3- Split ES0 into ES1 and ES2 ES1: Sending one of the relation to other site, relations joined there ES2:Sending the result back to site in ES0.

4- Replace ES0 with ES1 and ES2 when we should have cost(ES1) + cost(local join) + cost (ES2) < cost (ES0) 5- Recursively apply step 3 and 4 on ES1 and ES2, until no improvement

EXAMPLE
Find the salaries of engineers working on CAD/CAM project Involves EMP, PAY, PROJ and ASG sal(PAY title(EMP eNo(ASG pNo(pName = CAD/CAM (PROJ)))))

RELATION

EMP PAY PROJ ASG

SIZE

8 4 1 10

SITE

1 2 3 4

Assume Tmsg = 0 and TTR = 1 Length of a tuple is 1 So size(R) = card(R)

Cont..
Considering only transfers costs

Site 1
PAY site 1 =4 PROJ site 1 = 1 ASG site 1 = 10 Total = 15

Cont..
Site 2
EMP site 2 = 8 PROJ site 2 = 1 ASG site 2 = 10 Total = 19

Cont..
Site 3
EMP site 3 = 8 PAY site 3 =4 ASG site 3 = 10 Total = 22

Cont..
Site 4
EMP site 4 = 8 PAY site 4 =4 PROJ site 4 =1 Total = 13

Cont..
Cost for site 2 = 19 Cost for site 3 = 22 Cost for site 4 = 13 So site 4 is our ES0 Move all relations to site 4.

THANK YOU

You might also like