%ex1.2

\begin{enumerate}[label=(\alph*)]
	\item
$ blockSize = 16 kB = 16384 b $ \\
$ diskBlockSize = 64 kB = 65536 b $ \\
$ blocksPerDiskBlock = diskBlockSize / blockSize = 4 $ \\
$ diskSpeed = 348160 kB/s $
\\
$ recordsPerBlockW = math.floor(blockSize / R_{w}) = 1170 $ \\
$ recordsPerBlockP = math.floor(blockSize / R_{p}) = 136 $ \\
$ recordsPerBlockE = math.floor(blockSize / R_{e}) = 252 $ \\
\\
$ numBlocksW = math.ceil(n_{w} / recordsPerBlockW) = 48 $ \\
$ numBlocksP = math.ceil(n_{p} / recordsPerBlockP) = 15 $ \\
$ numBlocksE = math.ceil(n_{e} / recordsPerBlockE) = 497 $ \\
\\
$ tableSizeW = numBlocksW * blockSize = 768 kB $ \\
$ tableSizeP = numBlocksP * blockSize = 240 kB $ \\
$ tableSizeE = numBlocksE * blockSize = 7952 kB $ \\
\\
$ numDiskBlocksW = math.ceil(numBlocksW / blocksPerDiskBlock) = 12 $ \\
$ numDiskBlocksP = math.ceil(numBlocksP / blocksPerDiskBlock) = 4 $ \\
$ numDiskBlocksE = math.ceil(numBlocksE / blocksPerDiskBlock) = 125 $ \\
\\
$ seqScanBytesW = numDiskBlocksW * diskBlockSize = 12 * 64 kB = 768 kB $ \\
$ seqScanBytesP = numDiskBlocksP * diskBlockSize = 4 * 64 kB = 256 kB $ \\
$ seqScanBytesE = numDiskBlocksE * diskBlockSize = 125 * 64 kB = 8000 kB $ \\
\\
$ totalScanBytes = seqScanBytesW + seqScanBytesP + seqScanBytesE = 9024 kB $ \\
\\
$ totalTime = totalScanBytes * 1000 ms / diskSpeed = 25.919 ms $\\
	\item
$ indexReadBlocks = math.ceil( 18 kB / diskBlockSize ) = 1 $ \\
$ tupleReadBlocksP = 3 $ \\
$ totalBlocks = indexReadBlocks + tupleReadBlocksP + numDiskBlocksW + numDiskBlocksE $ \\
$ totalBlocks = 1 + 3 + 12 + 125 = 141 $
$ totalBytes = totalBlocks * diskBlockSize $ \\
$ totalBytes = 141 * 64 kB = 9024 kB $ \\
$ totalTime = totalBytes * 1000 ms / diskSpeed = 25.92 ms $ \\
The results are the same, as the full project table can be read by reading 4 blocks.

If the project table were larger, the speed would be higher.
\end{enumerate}
