40 likes | 247 Views
Costs. Btree levels. Typical order: 100. Typical fill-factor: 67%. average fanout = 133 Typical capacities: Level 1 = 133 keys Level 2 = 133 2 ( 17689 ) keys Level 3 = 133 3 ( 2,352,637 ) keys Level 4 = 133 4 ( 312,900,700 ) keys. Costs for single relation plans on R.
E N D
Btree levels • Typical order: 100. Typical fill-factor: 67%. • average fanout = 133 • Typical capacities: • Level 1 = 133 keys • Level 2 = 1332 (17689)keys • Level 3 = 1333(2,352,637)keys • Level 4 = 1334(312,900,700)keys
Costs for single relation plans on R Access method Cost • Sequential scan bR • access primary key index IHeight(I) + 1 if I is B+ tree 2.2if I is hash index • clustered index I matching predicate p sel(p) x (bI +bR) • unclustered index I matching predicate p sel(p) x (bI+nR) - bR nr. of blocks of R - nR nr. of tuples of R
Costs for join R with S • Block nested loop bRx bS+ bR • Indexed nested loopbR + nRxc • Hash join 3 x (bR+ bS) • Merge join if R and S are sortedbR + bS • Sort RbR( 2 logM–1(bR/ M) + 1) c- see previous slide M – nr. of buffer pages