From: | Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Fix briefly showing old progress stats for ANALYZE on inherited |
Date: | 2023-09-30 14:17:31 |
Message-ID: | E1qmamh-006oP5-Q8@gemulon.postgresql.org |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Dunstan | 2023-09-30 16:44:16 | pgsql: Provide FORCE_NULL * and FORCE_NOT_NULL * options for COPY FROM |
Previous Message | Dean Rasheed | 2023-09-30 09:57:19 | pgsql: Fix EvalPlanQual rechecking during MERGE. |