The opinion in this thread is leaning towards a VERBOSE option and I agree with this as it provides the users with a much more intuitive way to gather parallel information about parallel index builds. Also, the current DEBUG1 output is useless as it is now.
Here is a v1 that implements CREATE INDEX (VERBOSE) to output the parallel workers planned and launched. A few points about this patch: 1/ the (VERBOSE) option is added after the INDEX. It seemed better than adding it after the CREATE keyword to make the option specific to the "CREATE INDEX" operation rather than the "CREATE" operation which can be many things. 2/ The workers launched is determined in the index AM, therefore a new field called "ii_verbose" is added to IndexInfo so it can be available to the AM to determine if logging is required. We currently handle the concurrently option in the same manner. 3/ currently REINDEX (VERBOSE) does not show parallel workers planned, but it will with this patch. Both CREATE INDEX and REINDEX will show the same output. 4/ Updated auto-completed in psql to deal with (VERBOSE) 5/ Removed the existing DEBUG1 output. 6/ Updated the tests for create index/reinde Here is sample output: postgres=# CREATE INDEX (VERBOSE ON) ON t(c1); INFO: building index "t_c1_idx" on table "t" with parallel workers INFO: launched 1 parallel workers for index creation (planned: 1) INFO: index "public.t" was created DETAIL: CPU: user: 0.88 s, system: 0.01 s, elapsed: 0.89 s. CREATE INDEX postgres=# postgres=# REINDEX (verbose) INDEX t_c1_idx ; INFO: building index "t_c1_idx" on table "t" with parallel workers INFO: launched 1 parallel workers for index creation (planned: 1) INFO: index "t_c1_idx" was reindexed DETAIL: CPU: user: 0.88 s, system: 0.00 s, elapsed: 0.89 s REINDEX Looking forward to feedback. Regards, Sami
v1-0001-Improve-Parallel-worker-reporting-in-CREATE-INDEX.patch
Description: Binary data