CS FundamentalsModerateGATE CS
Which statement correctly states the write-ahead logging (WAL) rule?
- A. A page is written only after the log records for its changes are stable, and commit waits for all its log records
- B. The data page must reach disk before its log record, so the log can later be verified against it
- C. Log records are written only at checkpoints, together with every dirty page in the buffer pool
- D. Only the commit record must be forced at commit; earlier update records may still be lost in a crash
Correct answer: A. A page is written only after the log records for its changes are stable, and commit waits for all its log records
WAL forces undo information to the log before the page it describes can overwrite the old value, and forces all of a transaction's log records (including commit) before reporting the commit. Writing the page first could leave an uncommitted change with no undo record.
More DBMS and SQL questions
- Which statement about compensation log records (CLRs) in ARIES is correct?
- Which locking scheme guarantees BOTH freedom from deadlock and schedules without cascading rollback?
- Table T has 7 rows. What does SELECT COUNT() FROM T HAVING COUNT() > 10; return? (Standard SQL; SQLite accepts HAVING without GROUP BY…
- Table U(x INT UNIQUE) is empty. These statements run one at a time: INSERT (1); INSERT (NULL); INSERT (NULL); INSERT (1). How many succeed…
- Table K(amt INT CHECK (amt > 0)) is empty. These run one at a time: INSERT (-5); INSERT (NULL); INSERT (0); INSERT (3). How many rows does…
- P(id PRIMARY KEY) has rows 1, 2. C(id, pid REFERENCES P ON DELETE CASCADE) has (10, 1), (11, 1), (12, 2). G(id, cid REFERENCES C ON DELETE…