1 / 10

Quiz 2 Review

Quiz 2 Review. For which of the following attributes would a hash-index most likely be a better fit than a B+-tree index? A. Social Security Number B. Age C. Salary D. Last Name E. Starting Date. A given B+-tree index has a height of 4 and maximum fan out of 129 (128 index entries).

cora
Download Presentation

Quiz 2 Review

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Quiz 2 Review

  2. For which of the following attributes would a hash-index most likely be a better fit than a B+-tree index? A. Social Security Number B. Age C. Salary D. Last Name E. Starting Date

  3. A given B+-tree index has a height of 4 and maximum fan out of 129 (128 index entries). What is the fewest number of keys possible in this index? The largest?

  4. Which of the following is true after inserting 12, 11, 10, 9, 8 sequentially into the B+-tree shown above? A. Node D will hold numbers: 5, 6, 8, 9 B. A new leaf node will be created to hold 9, 10, 11, 12 C. Two new leaf nodes will be crated to hold 8, 9, and 10, 11, 12 D. Node E will hold numbers: 12, 15, 16 E. None of above

  5. Which of the following statements regarding extensible hashing is false? A. An insertion that doubles the directory size to 2N adds only one new bucket B. Doubling the directory requires examining all buckets with local depth equal to global depth C. The hash function changes whenever the directory size changes D. An overflowed bucket must have all of its entries redirected to one of two new buckets E. After doubling, all but one new directory entry shares a bucket with an old directory entry

  6. Which of the following best justifies why many query optimizers consider only left-deep join trees? A. The number of possible plans increases too rapidly to consider all possible joining approaches. B. Left-deep trees all lead to fully pipelined plans C. Optimal plans always include a version that is a left-deep join tree D. Left-deep join trees make the best use of available indices E. All of the above

  7. Problem Points X( • Consider a database table of 200 disk pages, with 50 records per page.  Assume this database is running on a machine with an average disk access time of 5 ms.  Assume any tree indices mentioned in this problem have a fanout of 100. Compute the time in milliseconds that it will take to do a range selection with 10% of all rows matching with clustered, unclusted indicies.

  8. Problem Points X( • What is SQL injection? What does (x, ) mean in Python? • sql = “SELECT * FROM users WHERE name=‘” + request[“username”] + “’ AND pass =‘” + request[“password”] + “’” • IE: SELECT * FROM users WHERE name=' Brian' AND pass ='mypass' • OR: SELECT * FROM users WHERE name='Brian' AND pass ='' OR ''='' • cursor.execute(“… WHERE a=?”, (a, ))

  9. Misc Notes • The quiz goes back as far as internet applications; expect at least 1 question on that. • Solutions for Problem Sets 3 and 4, these slides, and slides from last review session will be posted by midnight tonight.

  10. Questions? • Internet Applications • Overview of Storage and Indexing • Disks and Files • Trees • Hashes • Query Evaluation • External Sorting • Evaluation of Relational Operators

More Related