Homework 2 Solutions

Homework 2 Solutions - Homework 2 CSE 132A Due by noon on...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Homework 2 CSE 132A Due by noon on Monday, Dec. 8, by sliding under Alins office door. Problem 2 [20pts] Suppose that a B + tree index on (branch-name, branch- city) is available on relation branch . What would be the best way to handle the following selection? ( branch- city< Brooklyn 00 ) ( assets< 5000) ( branch- name = 00 Downtown 00 ) ( branch ) Solution: Assume that the index compares keys lexicographically, with the brach-name as the most significant component: ( n 1 , c 1 ) < ( n 2 , c 2 ) iff c 1 < c 2 or ( c 1 = c 2 and n 1 < n 2 ) . Lookup the value (Brooklyn,Downtown) in the index, to get to the corresponding leaf l . All values satisfying ( branch- city< Brooklyn 00 ) ( branch- name = 00 Downtown 00 ) ( branch ) are reachable by going to the left sibling leaves of l as long as the branch-name attribute is Downtown. For each visited leaf, output only if assets < 5000....
View Full Document

This note was uploaded on 12/03/2009 for the course CSE 132A taught by Professor Alindeutsch during the Fall '08 term at UCSD.

Page1 / 2

Homework 2 Solutions - Homework 2 CSE 132A Due by noon on...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online