pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix briefly showing old progress stats for ANALYZE on inherited 5+ messages / 1 participants [nested] [flat]
* pgsql: Fix briefly showing old progress stats for ANALYZE on inherited @ 2023-09-30 14:17 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 5+ messages in thread From: Heikki Linnakangas @ 2023-09-30 14:17 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix briefly showing old progress stats for ANALYZE on inherited tables. ANALYZE on a table with inheritance children analyzes all the child tables in a loop. When stepping to next child table, it updated the child rel ID value in the command progress stats, but did not reset the 'sample_blks_total' and 'sample_blks_scanned' counters. acquire_sample_rows() updates 'sample_blks_total' as soon as the scan starts and 'sample_blks_scanned' after processing the first block, but until then, pg_stat_progress_analyze would display a bogus combination of the new child table relid with old counter values from the previously processed child table. Fix by resetting 'sample_blks_total' and 'sample_blks_scanned' to zero at the same time that 'current_child_table_relid' is updated. Backpatch to v13, where pg_stat_progress_analyze view was introduced. Reported-by: Justin Pryzby Discussion: https://www.postgresql.org/message-id/20230122162345.GP13860%40telsasoft.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/c181f2e2bcecc2704c6461a0543894a38d7143df Modified Files -------------- src/backend/commands/analyze.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Fix briefly showing old progress stats for ANALYZE on inherited @ 2023-09-30 14:17 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 5+ messages in thread From: Heikki Linnakangas @ 2023-09-30 14:17 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix briefly showing old progress stats for ANALYZE on inherited tables. ANALYZE on a table with inheritance children analyzes all the child tables in a loop. When stepping to next child table, it updated the child rel ID value in the command progress stats, but did not reset the 'sample_blks_total' and 'sample_blks_scanned' counters. acquire_sample_rows() updates 'sample_blks_total' as soon as the scan starts and 'sample_blks_scanned' after processing the first block, but until then, pg_stat_progress_analyze would display a bogus combination of the new child table relid with old counter values from the previously processed child table. Fix by resetting 'sample_blks_total' and 'sample_blks_scanned' to zero at the same time that 'current_child_table_relid' is updated. Backpatch to v13, where pg_stat_progress_analyze view was introduced. Reported-by: Justin Pryzby Discussion: https://www.postgresql.org/message-id/20230122162345.GP13860%40telsasoft.com Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/992d2ca81d2b846e253d4394dac8cd2509fd071a Modified Files -------------- src/backend/commands/analyze.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Fix briefly showing old progress stats for ANALYZE on inherited @ 2023-09-30 14:17 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 5+ messages in thread From: Heikki Linnakangas @ 2023-09-30 14:17 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix briefly showing old progress stats for ANALYZE on inherited tables. ANALYZE on a table with inheritance children analyzes all the child tables in a loop. When stepping to next child table, it updated the child rel ID value in the command progress stats, but did not reset the 'sample_blks_total' and 'sample_blks_scanned' counters. acquire_sample_rows() updates 'sample_blks_total' as soon as the scan starts and 'sample_blks_scanned' after processing the first block, but until then, pg_stat_progress_analyze would display a bogus combination of the new child table relid with old counter values from the previously processed child table. Fix by resetting 'sample_blks_total' and 'sample_blks_scanned' to zero at the same time that 'current_child_table_relid' is updated. Backpatch to v13, where pg_stat_progress_analyze view was introduced. Reported-by: Justin Pryzby Discussion: https://www.postgresql.org/message-id/20230122162345.GP13860%40telsasoft.com Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5ae245664830219bab2e2ada11d2379875f4501a Modified Files -------------- src/backend/commands/analyze.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Fix briefly showing old progress stats for ANALYZE on inherited @ 2023-09-30 14:17 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 5+ messages in thread From: Heikki Linnakangas @ 2023-09-30 14:17 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix briefly showing old progress stats for ANALYZE on inherited tables. ANALYZE on a table with inheritance children analyzes all the child tables in a loop. When stepping to next child table, it updated the child rel ID value in the command progress stats, but did not reset the 'sample_blks_total' and 'sample_blks_scanned' counters. acquire_sample_rows() updates 'sample_blks_total' as soon as the scan starts and 'sample_blks_scanned' after processing the first block, but until then, pg_stat_progress_analyze would display a bogus combination of the new child table relid with old counter values from the previously processed child table. Fix by resetting 'sample_blks_total' and 'sample_blks_scanned' to zero at the same time that 'current_child_table_relid' is updated. Backpatch to v13, where pg_stat_progress_analyze view was introduced. Reported-by: Justin Pryzby Discussion: https://www.postgresql.org/message-id/20230122162345.GP13860%40telsasoft.com Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2d4f99bc693aef5387834333eef06776777f4783 Modified Files -------------- src/backend/commands/analyze.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Fix briefly showing old progress stats for ANALYZE on inherited @ 2023-09-30 14:17 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 5+ messages in thread From: Heikki Linnakangas @ 2023-09-30 14:17 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix briefly showing old progress stats for ANALYZE on inherited tables. ANALYZE on a table with inheritance children analyzes all the child tables in a loop. When stepping to next child table, it updated the child rel ID value in the command progress stats, but did not reset the 'sample_blks_total' and 'sample_blks_scanned' counters. acquire_sample_rows() updates 'sample_blks_total' as soon as the scan starts and 'sample_blks_scanned' after processing the first block, but until then, pg_stat_progress_analyze would display a bogus combination of the new child table relid with old counter values from the previously processed child table. Fix by resetting 'sample_blks_total' and 'sample_blks_scanned' to zero at the same time that 'current_child_table_relid' is updated. Backpatch to v13, where pg_stat_progress_analyze view was introduced. Reported-by: Justin Pryzby Discussion: https://www.postgresql.org/message-id/20230122162345.GP13860%40telsasoft.com Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ed9247cd7f8bd0ec63d31eef822de9a01ed66306 Modified Files -------------- src/backend/commands/analyze.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2023-09-30 14:17 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-09-30 14:17 pgsql: Fix briefly showing old progress stats for ANALYZE on inherited Heikki Linnakangas <heikki.linnakangas@iki.fi> 2023-09-30 14:17 pgsql: Fix briefly showing old progress stats for ANALYZE on inherited Heikki Linnakangas <heikki.linnakangas@iki.fi> 2023-09-30 14:17 pgsql: Fix briefly showing old progress stats for ANALYZE on inherited Heikki Linnakangas <heikki.linnakangas@iki.fi> 2023-09-30 14:17 pgsql: Fix briefly showing old progress stats for ANALYZE on inherited Heikki Linnakangas <heikki.linnakangas@iki.fi> 2023-09-30 14:17 pgsql: Fix briefly showing old progress stats for ANALYZE on inherited Heikki Linnakangas <heikki.linnakangas@iki.fi>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox