ago
76 views
0 0 votes

A disk block has size $4096\text{ bytes}$

Each record has the following fields, in order:

  • Real number $: 6\text{ bytes}$
  • Character string $: 17\text{ bytes}$
  • Timestamp $: 8\text{ bytes}$

Each record also has a header consisting of:

  • Pointer $: 4\text{ bytes}$
  • Pointer $: 4\text{ bytes}$
  • Date $: 10\text{ bytes}$

Every field must begin at a byte location that is a multiple of $\mathbf{4}$.

The block itself also contains a block header consisting of eight $\mathbf{4}$-byte integers.

What is the maximum number of records that can fit in one block?

1 Answer

1 1 vote

The two pointers take $4+4=8$ bytes.

The date requires $10$ bytes, but because of the alignment rule its occupied space is rounded up to the next multiple of $4:10\rightarrow12$

Hence record-header size $:4+4+12=20$ bytes.

Now, The real field needs $6$ bytes $:6\rightarrow8$

The character string needs $17$ bytes $:17\rightarrow20$

The timestamp already occupies a multiple of $4:8\rightarrow8$

Therefore, field storage is:

$8+20+8=36$ bytes.

Total physical record size:

$20+36=56$ bytes.

Now, There are eight $4$-byte integers:

$8\times4=32$ bytes.

So the space available for records is:

$4096-32=4064$ bytes.

Now,

$\left\lfloor\dfrac{4064}{56}\right\rfloor=\boxed{72}$

ago
Answer:
Position:
Show:

Related questions

0 0 votes
1 1 answer
47
47 views
GO Classes asked 2 days ago
47 views
A table contains $10,000$ fixed-length records. Each record occupies $100\text{ bytes}$. The disk block size is $1024\text{ bytes}$ and every block contains a $20\text{-b...
2 2 votes
1 1 answer
59
59 views
GO Classes asked 2 days ago
59 views
Consider the following statement:Spanned records refer to records that are longer than blocks and therefore are broken into fragments.Enter $1$ if the statement is True a...
0 0 votes
1 1 answer
57
57 views
GO Classes asked 2 days ago
57 views
Regarding search techniques on files, which statement is correct?For binary search to work, the file must be ordered according to any arbitrary field. For sequential sear...
0 0 votes
1 1 answer
43
43 views
GO Classes asked 2 days ago
43 views
Which of the following is NOT a characteristic of heap files?Insertion of new records is very efficient. It is the simplest and most basic form of file organization. Sear...