Skip to content

Enhance HOT update checklist script with additional output details an…#8

Merged
gmartinez-dbai merged 1 commit intomainfrom
chore/prepare-pgtools-to-feed-analyzer
Dec 16, 2025
Merged

Enhance HOT update checklist script with additional output details an…#8
gmartinez-dbai merged 1 commit intomainfrom
chore/prepare-pgtools-to-feed-analyzer

Conversation

@gmartinez-dbai
Copy link
Copy Markdown
Collaborator

This pull request improves the usability and accuracy of the hot_update_optimization_checklist_json.sql script for analyzing PostgreSQL HOT update efficiency. The changes enhance output formatting for automation, add more detailed recommendations, and improve the accuracy of fillfactor reporting.

Usability and output improvements:

  • Added example usage with psql and jq, clarified recommended flags, and documented optional dependencies for easier downstream automation.
  • Enabled strict JSON output by setting QUIET, disabling the pager, and turning off the footer in the script.

Data accuracy and reporting enhancements:

  • Improved the base_stats CTE to:
    • Use explicit table aliases for clarity,
    • Accurately extract the current fillfactor from pg_class.reloptions (defaulting to 100 if unset),
    • Use relid for size lookups,
    • Only include tables with sufficient updates, and
    • Refactor join logic for better reliability.
  • Added current_fillfactor to the JSON output for each table, making it easier to correlate recommendations with the present configuration.
  • Enhanced recommendations to include a clear issue description, the action SQL statement with a context-aware fillfactor value, and the current_fillfactor for transparency.…d examples

@gmartinez-dbai gmartinez-dbai merged commit 2ce8980 into main Dec 16, 2025
2 checks passed
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.

1 participant