While reviewing patch [1], I realized that the DEBUG1 message for CREATE INDEX could do better in providing information about parallel workers launched. Currently, the message just shows how many workers are planned, but a user may want to ensure that they have the appropriate number of workers launched as well when they enable DEBUG1 logging.
Therefore, I want to suggest that instead of: postgres=# CREATE INDEX tbl_c1 ON tbl(c1); DEBUG: building index "tbl_c1" on table "tbl" with request for 2 parallel workers DEBUG: index "tbl_c1" can safely use deduplication CREATE INDEX to enhance the message to: postgres=# create index tbl_c1 on tbl(c1); DEBUG: building index "tbl_c1" on table "tbl" DEBUG: launched 0 parallel vacuum workers for index vacuuming (planned: 2) DEBUG: index "tbl_c1" can safely use deduplication CREATE INDEX postgres=# I prepared a simple patch, attached, for this. The log message matches the format used in VACUUM VERBOSE ( for consistency sake ). Also, I think the documentation in [2] should be updated to mention that DEBUG1 can be used to view parallel worker usage for the build, but I have not included it in the patch yet. Any thoughts? [1] https://www.postgresql.org/message-id/CAA5RZ0tS%3DFmgku9%3DqCp-U4EBC-dqVtj%2Bv_EGrKV_NA%3DTHnUDsQ%40mail.gmail.com [2] https://www.postgresql.org/docs/current/sql-createindex.html Regards, Sami Imseih Amazon Web Services (AWS)
0001-improve-DEBUG1-logging-of-parallel-workers-for-CREAT.patch
Description: Binary data