All jobs / Database administrator / Performance

Database administrator interview question · 1–3 years

The sessions belong to a reporting service that opens a transaction, then waits for a slow external API.

Several sessions sit “idle in transaction” for hours. Why does that matter and what do you do?

The strongest answer

They hold locks and stop clean-up of old row versions, so tables bloat and others block; I find the code path that opens a transaction and then waits, and set an idle-in-transaction timeout

Why it works

Exactly — an open transaction is a lock holder and a vacuum blocker even when it is doing nothing.

What a good answer covers

Answers that fall short

Who gets asked this

More Performance questions