Adam Lee <[email protected]> wrote: > Thanks for Cc-ing me. I tested and found two problems. > > 1. The progress row stays after CREATE INDEX CONCURRENTLY and REINDEX > CONCURRENTLY.
I'm not able to reproduce these in v04 [1], maybe they got fixed along with othe problems in v03. Can you please check? > 2. In a parallel BRIN build, the leader's row loses its command and > phase, and the workers get rows of their own. > > CREATE TABLE big AS > SELECT g a, g % 97 b FROM generate_series(1, 4000000) g; > ALTER TABLE big SET (parallel_workers = 2); > SET max_parallel_maintenance_workers = 2; > SET min_parallel_table_scan_size = 0; > CREATE INDEX big_brin ON big USING brin (a); > > I sampled pg_stat_progress_create_index from another session about > every 1 ms during the build, joined with pg_stat_activity. > > master, 101 samples, all the same: > > client backend CREATE INDEX building index > > v03, 104 of 106 samples: > > client backend command NULL initializing > parallel worker command NULL initializing > parallel worker command NULL initializing > > The other 2 samples show "CREATE INDEX, building index" for the > leader. blocks_total and blocks_done still advance in the leader's > row. Sorry, I misunderstood the problem when finishing v04. I thought the leader should report the progress too, so I modified _brin_parallel_scan_and_build(). Now I see that it needs more work. It's probably out of the scope of this patch anyway, so I'll remove the change in the next version. Thanks for testing! [1] https://www.postgresql.org/message-id/115231.1795710799%40chrudos -- Antonin Houska Web: https://www.cybertec-postgresql.com
