問題文
A nightly job regenerates embeddings for notes changed during the day. It reads the note table while technicians keep writing to it, and last night the job sat blocked for two hours and finished late, leaving stale vectors. Which change addresses the delay without letting the job read uncommitted rows?
選択肢
- Run the job under SNAPSHOT isolation after setting ALLOW_SNAPSHOT_ISOLATION to ON, because SNAPSHOT transactions do not request locks when reading and do not block writers.
- Run the job under READ UNCOMMITTED so it never waits for the technicians' locks, because a transaction that requests no shared locks while reading does not block writers and finishes in time to leave the vectors fresh, which is the property the nightly job needs from the isolation level it runs under.
- Set the job's transaction to SNAPSHOT after it begins, once it detects that it is being blocked.
- Run the job under REPEATABLE READ so the rows it has read cannot change while it works.