Protect minority queue states from stale PostgreSQL estimates
When a PostgreSQL queue retains completed history, its small pending subset can grow dramatically before table-wide auto-analyze thresholds trigger. An inlined window aggregate used to rank stream dependencies can then be rescanned under a nested loop chosen for stale cardinality…