This preview shows page 1. Sign up to view the full content.
Unformatted text preview: rds b.f.: blocking factor
6 FIGURE 14.1 Primary index on the ordering key field of the file shown in Figure 13.7. 7 FIGURE 14.4 A dense secondary index (with block pointers) on a nonordering key field of a file. Data file is unsorted Dense indexing 8 Data file: sorted on key FIGURE 14.6 A two-level primary index resembling ISAM (Indexed Sequential Access Method) organization. 9 FIGURE 14.5 A secondary index (with recored pointers) on a nonkey field implemented using one level of indirection so that index entries are of fixed length and have unique field values. 10 Single-Level Ordered Indexes Eg. an ordered file with 30,000 records with1,024 bytes/block and 100 bytes/record (fixed length)
1024 bf = (B/R ) = = 10 records/block 100 (w/o indexing) : 30000 NBLK = (r/bf ) = = 3000 blocks/file 10 By Binary search # of block access = (log 2 b ) = log 2 3000 = 12
11 Single-level indexing
assume key field is V = 9 bytes long, and block pointer P is 6 bytes long. (case 1) data records are ordered by keys Ri = 9 + 6 = 15 bytes per index entry, 1024 bf i = (B / Ri ) = = 68 entries per block, 15 the no. of index entries b = 30000 / 10 = 3000, the no. of index blocks 3000 bi = (b / bf i ) = = 45 index block 68 Using binary search, (log 2 b i ) = (log 2 45) = 6 block accesses at index file. Then search for the record, one additional block access is needed, so the t...
View Full Document
This note was uploaded on 10/25/2009 for the course EE 2011 taught by Professor Denny during the Spring '09 term at National Tsing Hua University, China.
- Spring '09