Added build phase progress for Postgres 12+

This commit is contained in:
Andrew Kane
2022-01-29 19:19:16 -08:00
parent 423e478a85
commit 9ec174137f
5 changed files with 70 additions and 1 deletions

View File

@@ -4,6 +4,16 @@
#include "storage/bufmgr.h"
#include "vector.h"
#if PG_VERSION_NUM >= 120000
#include "commands/progress.h"
#endif
#if PG_VERSION_NUM >= 140000
#include "utils/backend_progress.h"
#elif PG_VERSION_NUM >= 120000
#include "pgstat.h"
#endif
/*
* Allocate a vector array
*/
@@ -174,3 +184,14 @@ IvfflatUpdateList(Relation index, GenericXLogState *state, ListInfo listInfo,
/* Could only commit if changed, but extra complexity isn't needed */
IvfflatCommitBuffer(buf, state);
}
/*
* Update build phase progress
*/
void
IvfflatUpdateProgress(int64 val)
{
#if PG_VERSION_NUM >= 120000
pgstat_progress_update_param(PROGRESS_CREATEIDX_SUBPHASE, val);
#endif
}