Question: Implement a two-level linear index for variable-length records as illustrated by Figures 10.1 and 10.2. Assume that disk blocks are 1024 bytes in length. Records

Implement a two-level linear index for variable-length records as illustrated by Figures 10.1 and 10.2. 

Linear Index 37 42 52 73 52 98 73 Database Records Figure 10.1 Linear indexing for variable-length records.

Assume that disk blocks are 1024 bytes in length.

1 2003 5894 10528 Second Level Index 1 2001 2003 Linear Index: Disk Blocks 5688 5894 9942 10528 10984

Records in the database file should typically range between 20 and 200 bytes, including a 4-byte key value. Each record of the index file should store a key value and the byte offset in the database file for the first byte of the corresponding record. The top-level index (stored in memory) should be a simple array storing the lowest key value on the corresponding block in the index file.

Linear Index 37 42 52 73 52 98 73 Database Records Figure 10.1 Linear indexing for variable-length records. Each record in the index file is of fixed length and contains a pointer to the beginning of the corre- sponding record in the database file. 98 37 42

Step by Step Solution

3.34 Rating (148 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

java import javaio import javautilArrayList import javautilList class DatabaseRecord int key String ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Practical Introduction To Data Structures Questions!