StreakPeaked· Practice

ExamsGATETechnical

What is the optimized version of the relation algebra expression πA1(πA2(σF1(σF2(r)))), where A1, A2 are sets of attributes in r with A1 ⊆ A2 and F1, F2 are Boolean expressions based on the attributes in r?

  1. πA1(σ(F1∧F2)(r))
  2. πA1(σ(F1∨F2)(r))
  3. πA2(σ(F1∧F2)(r))
  4. πA2(σ(F1∨F2)(r))

Correct answer: πA1(σ(F1∧F2)(r))

Solution

The correct option is optimized because it first applies the selection of both conditions F1 and F2 together, which reduces the dataset before projecting only the attributes in A1. This minimizes the amount of data processed in the projection step, making the operation more efficient.

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →