


























Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!



























Cost is estimated using statistical info. from DB catalog
s salary < 75000 (Õ salary ( instructor)) Õ salary (s salary < 75000 ( instructor))
With HDD, I/O cost dominated CPU cost. Not longer the case with SDDs and large RAM.
Real systems do use CPU cost, and, in parallel DBs, network costs are basic
g a d 31 c 33 b 14 e 16 r 16 d 21 m 3 p 2 d 7 a 14 a 14 a 19 b 14 c 33 d 7 d 21 d 31 e 16 g 24 m 3 p 2 r 16 a 19 b 14 c 33 d 31 e 16 g 24 a 14 d 7 d 21 m 3 p 2 r 16 a 19 d 31 g 24 b 14 c 33 e 16 d 21 m 3 r 16 a 14 d 7 p 2 initial relation create runs merge pass– merge pass– runs runs sorted output 24 19 Two steps: 1.Divide the relation into small ordered pieces (called runs ) 2.Combine (merge) the runs in a sorted way
Running example : student ⨝ takes student takes No. records: 5,000 10, No. blocks: 100 400
where nr and br are the no. records and no. blocks of relation r (same for s ) § E.g., with student as outer relation : 5000 * 400 + 100 = 2,000,100 block transfers 5000 + 100 = 5100 I/O accesses with takes as outer relation : 1,000,400 block transfers 10,400 I/O accesses
Similar to merge stage of sort-merge algorithm
repeat:
a 3 b 1 d 8 d 13 f 7 m (^5) q (^6) a A b G c L d N m B a1 a2 a1 a pr ps r s