mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-07 13:10:56 +08:00
Removed vector-specific code from IVFFlat [skip ci]
This commit is contained in:
@@ -600,7 +600,7 @@ ParallelHeapScan(IvfflatBuildState * buildstate)
|
|||||||
* Perform a worker's portion of a parallel sort
|
* Perform a worker's portion of a parallel sort
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
IvfflatParallelScanAndSort(IvfflatSpool * ivfspool, IvfflatShared * ivfshared, Sharedsort *sharedsort, Vector * ivfcenters, int sortmem, bool progress)
|
IvfflatParallelScanAndSort(IvfflatSpool * ivfspool, IvfflatShared * ivfshared, Sharedsort *sharedsort, char *ivfcenters, int sortmem, bool progress)
|
||||||
{
|
{
|
||||||
SortCoordinate coordinate;
|
SortCoordinate coordinate;
|
||||||
IvfflatBuildState buildstate;
|
IvfflatBuildState buildstate;
|
||||||
@@ -672,7 +672,7 @@ IvfflatParallelBuildMain(dsm_segment *seg, shm_toc *toc)
|
|||||||
IvfflatSpool *ivfspool;
|
IvfflatSpool *ivfspool;
|
||||||
IvfflatShared *ivfshared;
|
IvfflatShared *ivfshared;
|
||||||
Sharedsort *sharedsort;
|
Sharedsort *sharedsort;
|
||||||
Vector *ivfcenters;
|
char *ivfcenters;
|
||||||
Relation heapRel;
|
Relation heapRel;
|
||||||
Relation indexRel;
|
Relation indexRel;
|
||||||
LOCKMODE heapLockmode;
|
LOCKMODE heapLockmode;
|
||||||
@@ -786,7 +786,7 @@ IvfflatBeginParallel(IvfflatBuildState * buildstate, bool isconcurrent, int requ
|
|||||||
Size estcenters;
|
Size estcenters;
|
||||||
IvfflatShared *ivfshared;
|
IvfflatShared *ivfshared;
|
||||||
Sharedsort *sharedsort;
|
Sharedsort *sharedsort;
|
||||||
Vector *ivfcenters;
|
char *ivfcenters;
|
||||||
IvfflatLeader *ivfleader = (IvfflatLeader *) palloc0(sizeof(IvfflatLeader));
|
IvfflatLeader *ivfleader = (IvfflatLeader *) palloc0(sizeof(IvfflatLeader));
|
||||||
bool leaderparticipates = true;
|
bool leaderparticipates = true;
|
||||||
int querylen;
|
int querylen;
|
||||||
@@ -865,7 +865,7 @@ IvfflatBeginParallel(IvfflatBuildState * buildstate, bool isconcurrent, int requ
|
|||||||
tuplesort_initialize_shared(sharedsort, scantuplesortstates,
|
tuplesort_initialize_shared(sharedsort, scantuplesortstates,
|
||||||
pcxt->seg);
|
pcxt->seg);
|
||||||
|
|
||||||
ivfcenters = (Vector *) shm_toc_allocate(pcxt->toc, estcenters);
|
ivfcenters = shm_toc_allocate(pcxt->toc, estcenters);
|
||||||
memcpy(ivfcenters, buildstate->centers->items, estcenters);
|
memcpy(ivfcenters, buildstate->centers->items, estcenters);
|
||||||
|
|
||||||
shm_toc_insert(pcxt->toc, PARALLEL_KEY_IVFFLAT_SHARED, ivfshared);
|
shm_toc_insert(pcxt->toc, PARALLEL_KEY_IVFFLAT_SHARED, ivfshared);
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ typedef struct VectorArrayData
|
|||||||
int maxlen;
|
int maxlen;
|
||||||
int dim;
|
int dim;
|
||||||
Size itemsize;
|
Size itemsize;
|
||||||
Vector *items;
|
char *items;
|
||||||
} VectorArrayData;
|
} VectorArrayData;
|
||||||
|
|
||||||
typedef VectorArrayData * VectorArray;
|
typedef VectorArrayData * VectorArray;
|
||||||
@@ -150,7 +150,7 @@ typedef struct IvfflatLeader
|
|||||||
IvfflatShared *ivfshared;
|
IvfflatShared *ivfshared;
|
||||||
Sharedsort *sharedsort;
|
Sharedsort *sharedsort;
|
||||||
Snapshot snapshot;
|
Snapshot snapshot;
|
||||||
Vector *ivfcenters;
|
char *ivfcenters;
|
||||||
} IvfflatLeader;
|
} IvfflatLeader;
|
||||||
|
|
||||||
typedef struct IvfflatBuildState
|
typedef struct IvfflatBuildState
|
||||||
|
|||||||
Reference in New Issue
Block a user