Skip to content

Simplify job history retention by replacing binary search and temp table#9561

Open
svenklemm wants to merge 1 commit intomainfrom
sven/temp_table
Open

Simplify job history retention by replacing binary search and temp table#9561
svenklemm wants to merge 1 commit intomainfrom
sven/temp_table

Conversation

@svenklemm
Copy link
Copy Markdown
Member

Remove the job_history_bsearch function and the temp table + TRUNCATE +
INSERT pattern. The retention function now uses two simple DELETE
statements: one to remove rows older than the cutoff and one CTE-based
delete for per-job limits. This also removes the ACCESS EXCLUSIVE lock
(no longer needed without TRUNCATE) and switches from execution_finish
to execution_start so the existing indexes are utilized.

@svenklemm svenklemm requested a review from a team April 9, 2026 19:42
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

@Poroma-Banerjee, @dbeck: please review this pull request.

Powered by pull-review

Remove the job_history_bsearch function and the temp table + TRUNCATE +
INSERT pattern. The retention function now uses two simple DELETE
statements: one to remove rows older than the cutoff and one CTE-based
delete for per-job limits. This also removes the ACCESS EXCLUSIVE lock
(no longer needed without TRUNCATE) and switches from execution_finish
to execution_start so the existing indexes are utilized.
@svenklemm svenklemm added this to the v2.27.0 milestone Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants