This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full 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 (branchname, branch city) is available on relation branch . What would be the best way to handle the following selection? ( branch city&lt; Brooklyn 00 ) ( assets&lt; 5000) ( branch name = 00 Downtown 00 ) ( branch ) Solution: Assume that the index compares keys lexicographically, with the brachname as the most significant component: ( n 1 , c 1 ) &lt; ( n 2 , c 2 ) iff c 1 &lt; c 2 or ( c 1 = c 2 and n 1 &lt; n 2 ) . Lookup the value (Brooklyn,Downtown) in the index, to get to the corresponding leaf l . All values satisfying ( branch city&lt; Brooklyn 00 ) ( branch name = 00 Downtown 00 ) ( branch ) are reachable by going to the left sibling leaves of l as long as the branchname attribute is Downtown. For each visited leaf, output only if assets &lt; 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.
 Fall '08
 AlinDeutsch

Click to edit the document details