发布

  • [OPIK-7255] perf(backend): bound the per-project pending-closure thread scan (#7370)

    frostbyte_neo 发布于 2026-07-07 09:59:39 +00:00

    • [NA] perf(backend): bound the per-project pending-closure thread scan

    Rewrite GET_RECENT_CLOSED_THREADS_PER_PROJECT from a FINAL scan to the
    same bounded aggregation form as FIND_PENDING_CLOSURE_THREADS_SQL, so
    each closure event stops merge-reading every version row of the project.

    • argMax/max aggregation replaces FINAL; a last_updated_at lookback
      pre-filter lets the minmax skip index prune granules
    • the lookback bound reuses the enqueuing scan's computation, widened by
      the cold-start lookback so it always covers the enqueuer's window
    • add a log_comment for query attribution

    Co-Authored-By: Claude Fable 5 noreply@anthropic.com

    • [OPIK-7255] clamp pending-closure lookback to never start after the cutoff

    Guards the window shape against the cached global max timeout lagging a
    workspace timeout increase for up to its TTL.

    Co-Authored-By: Claude Fable 5 noreply@anthropic.com

    • [OPIK-7255] include workspace and user in stream_pending_closure_threads log_comment

    Render the template inside the context-aware lambda so the log_comment
    carries workspace_id, user_name, and project_id for query attribution.

    Co-Authored-By: Claude Fable 5 noreply@anthropic.com


    Co-authored-by: Claude Fable 5 noreply@anthropic.com

    下载附件