Skip to content

Solve Trigger Maintenance Procedure #1207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dbaai[bot]
Copy link

@dbaai dbaai bot commented Apr 15, 2025

Description

The issue being solved in this pull request is a slow-running SQL query that is part of the run_maintenance procedure. The query is being executed 41 times, with an average execution time of 335.82 milliseconds and a total execution time of 13.77 seconds.

SELECT run_maintenance($1)

Changes

To optimize the performance of the run_maintenance procedure, the following changes have been made:

  1. Added a new migration file 20241015185254_optimize_pgpartman_maintenance.sql that contains SQL statements to optimize the performance of the run_maintenance procedure. The changes include:

    • Optimizing the partitioning strategy for the tables involved in the maintenance procedure.
    • Introducing additional indexes to improve query performance.
    • Tuning various database configuration parameters to maximize performance.
  2. Updated the README.md file to document the changes made in this pull request and provide guidance on how to apply the database migrations.

These changes are expected to significantly improve the performance of the run_maintenance procedure and reduce the overall execution time.

https://dba.ai/issues/cfc5db58-0b9d-4b6b-8089-a9c5519889f0

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.

0 participants