Propose an algorithm for finding an intersection of two large relations (i.e., ones that do not fit in main memory) using hashing.

What will be an ideal response?

Solution:
Hash each relation on all attributes using the same hash function. Keep the distinction between the two parts of the bucket, which came from different relations. Tuples that fall into the intersection must fall into the same bucket. If the bucket is small enough, do the intersection in main memory. Else hash the tuples in the bucket again using a different hash function. It is reasonable to expect that the second-level buckets will fit into the main memory and then intersection within each bucket can be done in main memory.

Computer Science & Information Technology

You might also like to view...

When you open a database from a location displayed in the ________ Center a security warning will NOT display

A) Directory B) Trust C) Privacy D) Encryption

Computer Science & Information Technology

5. What is displayed by the following program after the call to execl?

#include #include int main() { if (fork() == 0) execl("prog.exe", "prog.exe", NULL); cout << "After execl" << endl; return 0; } a. The parent process will display "After execl" b. The child process will display "After execl" c. Neither the parent process nor the child process will display "After execl" d. The program does not create a child process e. Both the parent process and child process will display "After execl"

Computer Science & Information Technology