X-HYBRIDJOIN Algorithm  
----------------------
Once the available memory is distributed among the join components, the algorithm is ready to execute according to the procedure described below.
Before starting the actual join execution, the algorithm reads a particular portion of the disk-based relation R into the non-swappable part of
the disk buffer (line 1). Normally the algorithm continues its execution for an infinite amount of time (line 2). In each iteration, the algorithm
reads the oldest value of the join attribute from the queue (line 3) and loads a disk page pi (where 2 <= i <= n) into the disk buffer, using that
join attribute value as an index (line 4). After loading the disk page into memory, the algorithm reads all the tuples one by one from the non-swappable
part of the disk buffer and looks them up in the hash table. In the case of a match, the algorithm generates that tuples as an output after deleting
it from the hash table and the queue. The algorithm also increments variable w by one which contains the stream input size for the next iteration
(line 5-11). Similarly, the algorithm looks up the swappable part of the disk buffer in the hash table and performs the same tasks as for a non-swappable
part (line 12-18). When the whole disk buffer is looked up in the hash table, the algorithm reads the w tuples from the stream buffer if they are available and
loads them into the hash table along with placing their attribute values into the queue. It then resets the value of w to zero (line 19-22).



**********************************Pseudo-code for X-HYBRIDJOIN*********************************************

Input: A disk-based relation R with an index on join attribute and a Stream of updates S
Output: S join R
Parameters: w tuples of S and a page pi of R
Method:
1: READ page p1 of R into the non-swappable part of disk buffer.
2: while (true) DO
3: 	READ the oldest join attribute value from Q.
4: 	READ a page pi (where 2 <= i <= n) of R into swappable part of the disk buffer using join attribute value as an index.
5: 	FOR each tuple r in page p1 DO
6: 		IF r exists in H then
7: 			OUTPUT r join H
8: 			DELETE the matched tuple from H and the corresponding node from Q.
9: 			w=w + 1
10: 		ENDIF
11: 	END FOR
12: 	FOR each tuple r in page pi (where 2 <= i <= n) do
13: 		IF r exists in H THEN
14: 			OUTPUT r join H
15: 			DELETE the matched tuple from H and the corresponding node from Q.
16: 			w=w + 1
17: 		END IF
18: 	END FOR
19: 	IF (stream available) THEN
20: 		READ w tuples from stream buffer, load them into H and enqueue their join attribute values into Q.
21: 		RESET w to zero
22: 	END IF
23: 	END WHILE
*************************************************************************************************************