1. **State the problem:** We want to find how many index blocks are read during a binary search on a dense, sorted index for a table with 800,000,000 rows.
2. **Given data:**
- Number of rows $N = 800,000,000$
- Index block size = 4 kilobytes = $4 \times 1000 = 4000$ bytes
- Index entry size = 100 bytes
3. **Calculate the number of index entries per block:**
$$\text{entries per block} = \frac{\text{block size}}{\text{entry size}} = \frac{4000}{100} = 40$$
4. **Calculate the total number of index blocks:**
$$\text{total blocks} = \frac{N}{\text{entries per block}} = \frac{800,000,000}{40} = 20,000,000$$
5. **Binary search reads:**
Binary search on $M$ blocks requires approximately $\log_2(M)$ block reads.
6. **Calculate the number of block reads:**
$$\log_2(20,000,000) = \log_2(2 \times 10^7) = \log_2(2) + \log_2(10^7) = 1 + 7 \times \log_2(10)$$
Since $\log_2(10) \approx 3.3219$,
$$1 + 7 \times 3.3219 = 1 + 23.2533 = 24.2533$$
7. **Final answer:** Approximately 24 blocks are read during the binary search.
**Answer:** $\boxed{24}$ blocks
Binary Search Blocks Ca0237
Step-by-step solutions with LaTeX - clean, fast, and student-friendly.