mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-04 03:30:56 +08:00
Added build phase progress for Postgres 12+
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user