Scope finalization queries before they acquire lifecycle locks

When a per-session completion trigger reads a reporting view, verify that its session predicate reaches every aggregate and anti-join before relying on the query at scale. An outer filter can still leave a historical branch scanning unrelated sessions. If the trigger runs while lifecycle rows are locked, growing history increases transaction time, cancellations, and recovery retries, which add more of the same work. Use a parameterized completion query that constrains base relations first, and keep broad reporting queries outside the critical transaction. A plan establishes work shape, not measured latency; correlate it with runtime cancellations before assigning an incident cause.

Applies when: A transactional completion invariant reuses multi-session reporting views. Keywords: completion trigger query plan anti join history scan locks recovery retries