Which statement best describes how a nested loop join works in database systems?
Think about how many times the inner table is scanned for each row of the outer table.
A nested loop join works by taking each row from the first table and scanning all rows of the second table to find matching rows. This can be slow if tables are large.
Which of the following is true about the sort-merge join algorithm?
Consider what the 'merge' part of sort-merge join implies about the input data.
Sort-merge join requires both tables to be sorted on the join key so that they can be merged efficiently by scanning through both tables once.
Given two tables: one small and one very large, which join algorithm is generally the most efficient?
Think about which algorithm uses the smaller table to build a quick lookup structure.
Hash join is efficient when one table is small because it builds a hash table on the smaller table, allowing fast lookups when scanning the larger table.
Which of the following correctly compares the performance characteristics of nested loop join, sort-merge join, and hash join?
Consider the requirements and typical use cases of each join algorithm.
Sort-merge join is efficient for large sorted datasets; hash join is fast if memory allows building a hash table; nested loop join is generally slow for large tables due to repeated scanning.
When memory is limited and cannot hold the entire smaller table for hashing, which join algorithm is most suitable?
Think about which algorithm can work efficiently even when data does not fit fully in memory.
Sort-merge join can handle large tables by sorting them in chunks and merging, making it suitable when memory is limited and hash join is not feasible.