Files
uni/third/semester1/CT3532: Database Systems II/notes/_minted-CT3532-Notes/7DF042CB8E51F92B818B99B436D39B70FC50BCEA60446E6358356EFFD071FAB9.pygtex
2023-12-07 01:44:01 +00:00

20 lines
593 B
Plaintext

\begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}]
i := 0;
M = number of page frames in main memory buffer
repeat
read M blocks of the relation
sort M blocks in memory
write sorted data to file R\PYGZus{}i
until end of relation
read first block of each R\PYGZus{}i into memory
repeat
choose first (in sort order) from pages
write tuple to output
remove tuple from buffer
if any buffer R\PYGZus{}i empty and not eof(R\PYGZus{}i)
read next block from R\PYGZus{}i into memory
until all pages empty
\end{Verbatim}