mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
Use pgstat_progress_update_multi_param() where possible
This commit changes one code path in REINDEX INDEX and one code path in CREATE INDEX CONCURRENTLY to report the progress of each operation using pgstat_progress_update_multi_param() rather than multiple calls to pgstat_progress_update_param(). This has the advantage to make the progress report more consistent to the end-user without impacting the amount of information provided. Author: Bharath Rupireddy Discussion: https://postgr.es/m/CALj2ACV5zW7GxD8D_tyO==bcj6ZktQchEKWKPBOAGKiLhAQo=w@mail.gmail.com
This commit is contained in:
@@ -3686,12 +3686,18 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence,
|
||||
|
||||
if (progress)
|
||||
{
|
||||
const int progress_cols[] = {
|
||||
PROGRESS_CREATEIDX_COMMAND,
|
||||
PROGRESS_CREATEIDX_INDEX_OID
|
||||
};
|
||||
const int64 progress_vals[] = {
|
||||
PROGRESS_CREATEIDX_COMMAND_REINDEX,
|
||||
indexId
|
||||
};
|
||||
|
||||
pgstat_progress_start_command(PROGRESS_COMMAND_CREATE_INDEX,
|
||||
heapId);
|
||||
pgstat_progress_update_param(PROGRESS_CREATEIDX_COMMAND,
|
||||
PROGRESS_CREATEIDX_COMMAND_REINDEX);
|
||||
pgstat_progress_update_param(PROGRESS_CREATEIDX_INDEX_OID,
|
||||
indexId);
|
||||
pgstat_progress_update_multi_param(2, progress_cols, progress_vals);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user