Progress report of CREATE INDEX for nested partitioned tables
Ilya Gladyshev <ilya.v.gladyshev@gmail.com>
From: Ilya Gladyshev <ilya.v.gladyshev@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2022-12-10T08:18:32Z
Lists: pgsql-hackers
Attachments
- 0001-report-top-parent-progress-for-CREATE-INDEX.patch (text/x-patch) patch 0001
Hi,
I have noticed that progress reporting for CREATE INDEX of partitioned
tables seems to be working poorly for nested partitioned tables. In
particular, it overwrites total and done partitions count when it
recurses down to child partitioned tables and it only reports top-level
partitions. So it's not hard to see something like this during CREATE
INDEX now:
postgres=# select partitions_total, partitions_done from
pg_stat_progress_create_index ;
partitions_total | partitions_done
------------------+-----------------
1 | 2
(1 row)
I changed current behaviour to report the total number of partitions in
the inheritance tree and fixed recursion in the attached patch. I used
a static variable to keep the counter to avoid ABI breakage of
DefineIndex, so that we could backpatch this to previous versions.
Thanks,
Ilya Gladyshev
Commits
-
Fix CREATE INDEX progress reporting for multi-level partitioning.
- 27f5c712b2c5 16.0 landed