Quiz 2 Review Slides
Download
Report
Transcript Quiz 2 Review Slides
Quiz 2 Review
For which of the following attributes would a hashindex 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).
What is the fewest number of keys possible in this
index? The largest?
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
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
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
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.
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, ))
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.
Questions?
•
•
•
•
•
•
•
•
Internet Applications
Overview of Storage and Indexing
Disks and Files
Trees
Hashes
Query Evaluation
External Sorting
Evaluation of Relational Operators