Evaluating Relational Operations: Part I
(From Chapter 14)
Evaluating Relational Operations: Part I (From Chapter 14) - - PDF document
Evaluating Relational Operations: Part I (From Chapter 14)
(From Chapter 14)
R(a,b,c,d,e): 5,000,000 records, 10 records/page stored as sorted file by R.a (candidate key in [0,4999999]) What is best? a) access sorted file for R directly b) use clustered B+tree index on R.a c) use linear hashing index on R.a d) use clustered B+tree index on (R.a, R.b) e) use linear hashing inex on (R.a, R.b) f) use unclustered B+tree index on R.b Queries: SELECT * FROM R WHERE …
Can eliminate duplicates in single pass of index-only scan
Input file 4-page runs 3,4 6,2 9,4 8,7 5,6 3,1 9,2 2,3 5,6 6,7 4,4 8,9 1,1 2,3 6,1 6,9 8,2 3,4 5,5 5,5 6,8 2,3 6,3 3,4
2,3
B main memory buffers Disk Disk Original Relation
OUTPUT 2 INPUT 1 hash function
h
B-1
Partitions 1 2 B-1
Partitions
Input buffer for Si
Hash table for partition Ri
B main memory buffers Disk Disk Duplicate Free Partition
h2
# $
%&'()*+