Question: Q 3 . [ 2 1 marks ] Consider the following two relations R 1 and R 2 : We would like to merge -
Q marks Consider the following two relations and :
We would like to mergejoin and on attribute However, is unsorted on so we have to
sort before joining the relations. The records are stored on attribute in ascending order
sequentially from top to bottom. Assume record fits into block of memory. Please show how an
external sortmerge on on the attribute is conducted, by illustrating the following steps:
a marks Create sorted runs, assuming blocks are allocated to the memory buffer.
Draw figures as in p of Ch lecture slides
There should be runs. Label them sequentially as
b marks Merge the sorted runs created above via way merge p of Ch lecture
slides The memory buffer has blocks denoted as and respectively.
Memory buffer
blocks:
Show this process by stating the readwrite operations in the form of
rite
For instance, "Read to stands for reading a block of from disk to thememory block
"Write to stands for writing the record in to the output buffer, and "Write
to Disk" stands for writing the record in to disk. The first seven operations are shown
as a reference:
Read to
Read to
Write to
Write to Disk
Read to
Write to
Write to Disk
c marks Show the resulting joined relation.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
