From 9211d69c057abe6d271b92526667b8c467621965 Mon Sep 17 00:00:00 2001 From: Nikolay Samokhvalov Date: Tue, 10 Feb 2026 03:39:47 +0000 Subject: [PATCH] refactor: rename reports for consistent categories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - b6 → c1: buffer cache is not bloat, new 'cache' category - c1 → p1: index creation progress, new 'progress' category - p1 → x1: alignment padding (experimental), new 'experimental' category Updated: start.psql menu, README, CI regression tests, release notes. --- .github/workflows/test.yml | 4 ++-- README.md | 14 ++++++++++--- RELEASE_NOTES.md | 12 ++++++++++- ...{b6_buffercache.sql => c1_buffercache.sql} | 0 ...gress.sql => p1_index_create_progress.sql} | 0 ...t_padding.sql => x1_alignment_padding.sql} | 0 start.psql | 20 +++++++++---------- 7 files changed, 34 insertions(+), 16 deletions(-) rename sql/{b6_buffercache.sql => c1_buffercache.sql} (100%) rename sql/{c1_index_create_progress.sql => p1_index_create_progress.sql} (100%) rename sql/{p1_alignment_padding.sql => x1_alignment_padding.sql} (100%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d3524a4..2481983 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -127,8 +127,8 @@ jobs: exit 1 fi - echo " Testing p1_alignment_padding.sql..." - OUTPUT=$(PAGER=cat psql -h localhost -U dba_user -d test --no-psqlrc -f warmup.psql -f sql/p1_alignment_padding.sql | grep align) + echo " Testing x1_alignment_padding.sql..." + OUTPUT=$(PAGER=cat psql -h localhost -U dba_user -d test --no-psqlrc -f warmup.psql -f sql/x1_alignment_padding.sql | grep align) if [[ "$OUTPUT" == *"align1"* && "$OUTPUT" == *"align2"* && "$OUTPUT" == *"int4, more, int8"* ]]; then echo " ✓ Alignment padding test passed" else diff --git a/README.md b/README.md index 41c03ef..7a0f38b 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,11 @@ Then connect to any Postgres server via psql and type `:dba` to open the interac | b3 | Table bloat via `pgstattuple` (expensive) | | b4 | B-tree index bloat via `pgstattuple` (expensive) | | b5 | Tables and columns without stats (bloat cannot be estimated) | -| b6 | Buffer cache contents (requires `pg_buffercache`, expensive) | + +### Cache +| ID | Report | +|----|--------| +| c1 | Buffer cache contents (requires `pg_buffercache`, expensive) | ### Indexes | ID | Report | @@ -58,7 +62,11 @@ Then connect to any Postgres server via psql and type `:dba` to open the interac |----|--------| | v1 | Vacuum: current activity | | v2 | Autovacuum progress and queue | -| c1 | Index creation/reindex progress | + +### Progress +| ID | Report | +|----|--------| +| p1 | Index creation/reindex progress | ### Statements | ID | Report | @@ -73,7 +81,7 @@ Then connect to any Postgres server via psql and type `:dba` to open the interac | t1 | Postgres parameters tuning | | t2 | Objects with custom storage parameters | | e1 | Installed extensions | -| p1 | Alignment padding analysis (experimental) | +| x1 | Alignment padding analysis (experimental) | | r1 | Create user with random password (interactive) | | r2 | Alter user with random password (interactive) | diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 3e9a6fa..c57c2d5 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -4,7 +4,7 @@ ## New Reports -### b6 — Buffer cache contents +### c1 — Buffer cache contents What's in your `shared_buffers` right now. Shows cached size vs total size, % of cache used per object, and dirty buffer counts. Requires `pg_buffercache` extension. ### s3 — Workload profile by query type @@ -18,6 +18,16 @@ The node information report now includes: - **WAL**: current LSN, file count, total WAL size - **Replication Slots**: name, type, active/inactive status, lag from current WAL position +## Report Renames + +Categories reorganized for consistency: + +| Old | New | Reason | +|-----|-----|--------| +| b6 | **c1** | Buffer cache isn't bloat — moved to new **c** (cache) category | +| c1 | **p1** | Index creation progress → **p** (progress) category | +| p1 | **x1** | Alignment padding (experimental) → **x** (experimental) category | + ## Bug Fixes - **i3**: Fixed `operator is not unique` error when `intarray` extension is installed (added explicit `::int2[]` cast) diff --git a/sql/b6_buffercache.sql b/sql/c1_buffercache.sql similarity index 100% rename from sql/b6_buffercache.sql rename to sql/c1_buffercache.sql diff --git a/sql/c1_index_create_progress.sql b/sql/p1_index_create_progress.sql similarity index 100% rename from sql/c1_index_create_progress.sql rename to sql/p1_index_create_progress.sql diff --git a/sql/p1_alignment_padding.sql b/sql/x1_alignment_padding.sql similarity index 100% rename from sql/p1_alignment_padding.sql rename to sql/x1_alignment_padding.sql diff --git a/start.psql b/start.psql index ff2b787..355fc8b 100644 --- a/start.psql +++ b/start.psql @@ -10,8 +10,7 @@ \echo ' b3 – Table bloat (requires pgstattuple; expensive)' \echo ' b4 – B-tree indexes bloat (requires pgstattuple; expensive)' \echo ' b5 – Tables and columns without stats (so bloat cannot be estimated)' -\echo ' b6 – Buffer cache contents (requires pg_buffercache; expensive)' -\echo ' c1 – Index (re)creation progress (CREATE INDEX / REINDEX)' +\echo ' c1 – Buffer cache contents (requires pg_buffercache; expensive)' \echo ' e1 – Extensions installed in current database' \echo ' i1 – Unused and rarely used indexes' \echo ' i2 – Redundant indexes' @@ -20,7 +19,7 @@ \echo ' i5 – Cleanup unused and redundant indexes – DO & UNDO migration DDL' \echo ' l1 – Lock trees (lightweight)' \echo ' l2 – Lock trees, detailed (based on pg_blocking_pids())' -\echo ' p1 – [EXP] Alignment padding: how many bytes can be saved if columns are reordered?' +\echo ' p1 – Index (re)creation progress (CREATE INDEX / REINDEX)' \echo ' r1 – Create user with random password (interactive)' \echo ' r2 – Alter user with random password (interactive)' \echo ' s1 – Slowest queries, by total time (requires pg_stat_statements)' @@ -30,6 +29,7 @@ \echo ' t2 – Objects with custom storage parameters' \echo ' v1 – Vacuum: current activity' \echo ' v2 – VACUUM progress and autovacuum queue' +\echo ' x1 – [EXP] Alignment padding: how many bytes can be saved if columns are reordered?' \echo ' q – Quit' \echo \echo Type your choice and press : @@ -46,7 +46,6 @@ select :d_stp::text = 'b3' as d_step_is_b3, :d_stp::text = 'b4' as d_step_is_b4, :d_stp::text = 'b5' as d_step_is_b5, -:d_stp::text = 'b6' as d_step_is_b6, :d_stp::text = 'c1' as d_step_is_c1, :d_stp::text = 'e1' as d_step_is_e1, :d_stp::text = 'i1' as d_step_is_i1, @@ -66,6 +65,7 @@ select :d_stp::text = 't2' as d_step_is_t2, :d_stp::text = 'v1' as d_step_is_v1, :d_stp::text = 'v2' as d_step_is_v2, +:d_stp::text = 'x1' as d_step_is_x1, :d_stp::text = 'q' as d_step_is_q \gset \if :d_step_is_q \echo 'Bye!' @@ -110,12 +110,8 @@ select \ir ./sql/b5_tables_no_stats.sql \prompt 'Press to continue…' d_dummy \ir ./start.psql -\elif :d_step_is_b6 - \ir ./sql/b6_buffercache.sql - \prompt 'Press to continue…' d_dummy - \ir ./start.psql \elif :d_step_is_c1 - \ir ./sql/c1_index_create_progress.sql + \ir ./sql/c1_buffercache.sql \prompt 'Press to continue…' d_dummy \ir ./start.psql \elif :d_step_is_e1 @@ -151,7 +147,7 @@ select \prompt 'Press to continue…' d_dummy \ir ./start.psql \elif :d_step_is_p1 - \ir ./sql/p1_alignment_padding.sql + \ir ./sql/p1_index_create_progress.sql \prompt 'Press to continue…' d_dummy \ir ./start.psql \elif :d_step_is_r1 @@ -190,6 +186,10 @@ select \ir ./sql/v2_autovacuum_progress_and_queue.sql \prompt 'Press to continue…' d_dummy \ir ./start.psql +\elif :d_step_is_x1 + \ir ./sql/x1_alignment_padding.sql + \prompt 'Press to continue…' d_dummy + \ir ./start.psql \else \echo \echo '\033[1;31mError:\033[0m Unknown option! Try again.'