Home › GATE CSE › computerscience › Database Management Systems › If only one tuple in $S$ has $b\_id=102$ out of …
If only one tuple in $S$ has $b\_id=102$ out of a billion total, then between $\sigma_{b\_id=102}(R \bowtie S)$ and $R \bowtie \sigma_{b\_id=102}(S)$, the truth is
Adifferent answers; only the first is correct
Bsame answer, identical performance
Csame answer, second is far faster (filter-then-join shrinks the join input)
Ddifferent answers; the second drops rows that match the filter
Answer & Solution
Correct answer: C. same answer, second is far faster (filter-then-join shrinks the join input)
Both forms are logically equivalent (commutativity of σ with ⋈ when σ touches only one relation). The cost differs hugely: filter-then-join joins a billion rows down to one row first, then does a tiny join. Join-then-filter joins a billion against the other side before filtering. Same answer, very different cost.
Related questions
The main reasons production DBMSs avoid shadow paging in favour of WAL are that shadow pagWhat is the purpose of a Compensation Log Record (CLR) in ARIES?ARIES recovery is structured as exactlyFuzzy checkpoints differ from naive checkpoints byIn standard log-based recovery, the order of operations isAfter a crash, with checkpointing, the recovery system scans the logA complete log record for a write operation includesPer WAL semantics, a transaction is officially committed at the moment