mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-09 22:30:58 +08:00
Removed prefix for static functions
This commit is contained in:
@@ -331,7 +331,7 @@ FlushPages(HnswBuildState * buildstate)
|
|||||||
* Add a heap TID to an existing element
|
* Add a heap TID to an existing element
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
HnswAddDuplicateInMemory(HnswElement element, HnswElement dup)
|
AddDuplicateInMemory(HnswElement element, HnswElement dup)
|
||||||
{
|
{
|
||||||
LWLockAcquire(&dup->lock, LW_EXCLUSIVE);
|
LWLockAcquire(&dup->lock, LW_EXCLUSIVE);
|
||||||
|
|
||||||
@@ -352,7 +352,7 @@ HnswAddDuplicateInMemory(HnswElement element, HnswElement dup)
|
|||||||
* Find duplicate element
|
* Find duplicate element
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
HnswFindDuplicateInMemory(char *base, HnswElement element)
|
FindDuplicateInMemory(char *base, HnswElement element)
|
||||||
{
|
{
|
||||||
HnswNeighborArray *neighbors = HnswGetNeighbors(base, element, 0);
|
HnswNeighborArray *neighbors = HnswGetNeighbors(base, element, 0);
|
||||||
Datum value = HnswGetValue(base, element);
|
Datum value = HnswGetValue(base, element);
|
||||||
@@ -368,7 +368,7 @@ HnswFindDuplicateInMemory(char *base, HnswElement element)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Check for space */
|
/* Check for space */
|
||||||
if (HnswAddDuplicateInMemory(element, neighborElement))
|
if (AddDuplicateInMemory(element, neighborElement))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -379,7 +379,7 @@ HnswFindDuplicateInMemory(char *base, HnswElement element)
|
|||||||
* Add to element list
|
* Add to element list
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
HnswAddElementInMemory(char *base, HnswGraph * graph, HnswElement element)
|
AddElementInMemory(char *base, HnswGraph * graph, HnswElement element)
|
||||||
{
|
{
|
||||||
SpinLockAcquire(&graph->lock);
|
SpinLockAcquire(&graph->lock);
|
||||||
element->next = graph->head;
|
element->next = graph->head;
|
||||||
@@ -391,7 +391,7 @@ HnswAddElementInMemory(char *base, HnswGraph * graph, HnswElement element)
|
|||||||
* Update neighbors
|
* Update neighbors
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
HnswUpdateNeighborsInMemory(char *base, FmgrInfo *procinfo, Oid collation, HnswElement e, int m)
|
UpdateNeighborsInMemory(char *base, FmgrInfo *procinfo, Oid collation, HnswElement e, int m)
|
||||||
{
|
{
|
||||||
for (int lc = e->level; lc >= 0; lc--)
|
for (int lc = e->level; lc >= 0; lc--)
|
||||||
{
|
{
|
||||||
@@ -424,14 +424,14 @@ UpdateGraphInMemory(FmgrInfo *procinfo, Oid collation, HnswElement element, int
|
|||||||
char *base = buildstate->hnswarea;
|
char *base = buildstate->hnswarea;
|
||||||
|
|
||||||
/* Look for duplicate */
|
/* Look for duplicate */
|
||||||
if (HnswFindDuplicateInMemory(base, element))
|
if (FindDuplicateInMemory(base, element))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Add element */
|
/* Add element */
|
||||||
HnswAddElementInMemory(base, graph, element);
|
AddElementInMemory(base, graph, element);
|
||||||
|
|
||||||
/* Update neighbors */
|
/* Update neighbors */
|
||||||
HnswUpdateNeighborsInMemory(base, procinfo, collation, element, m);
|
UpdateNeighborsInMemory(base, procinfo, collation, element, m);
|
||||||
|
|
||||||
/* Update entry point if needed (already have lock) */
|
/* Update entry point if needed (already have lock) */
|
||||||
if (entryPoint == NULL || element->level > entryPoint->level)
|
if (entryPoint == NULL || element->level > entryPoint->level)
|
||||||
|
|||||||
@@ -451,7 +451,7 @@ HnswUpdateNeighborsOnDisk(Relation index, FmgrInfo *procinfo, Oid collation, Hns
|
|||||||
* Add a heap TID to an existing element
|
* Add a heap TID to an existing element
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
HnswAddDuplicateOnDisk(Relation index, HnswElement element, HnswElement dup, bool building)
|
AddDuplicateOnDisk(Relation index, HnswElement element, HnswElement dup, bool building)
|
||||||
{
|
{
|
||||||
Buffer buf;
|
Buffer buf;
|
||||||
Page page;
|
Page page;
|
||||||
@@ -515,7 +515,7 @@ HnswAddDuplicateOnDisk(Relation index, HnswElement element, HnswElement dup, boo
|
|||||||
* Find duplicate element
|
* Find duplicate element
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
HnswFindDuplicateOnDisk(Relation index, HnswElement element, bool building)
|
FindDuplicateOnDisk(Relation index, HnswElement element, bool building)
|
||||||
{
|
{
|
||||||
char *base = NULL;
|
char *base = NULL;
|
||||||
HnswNeighborArray *neighbors = HnswGetNeighbors(base, element, 0);
|
HnswNeighborArray *neighbors = HnswGetNeighbors(base, element, 0);
|
||||||
@@ -531,7 +531,7 @@ HnswFindDuplicateOnDisk(Relation index, HnswElement element, bool building)
|
|||||||
if (!datumIsEqual(value, neighborValue, false, -1))
|
if (!datumIsEqual(value, neighborValue, false, -1))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (HnswAddDuplicateOnDisk(index, element, neighborElement, building))
|
if (AddDuplicateOnDisk(index, element, neighborElement, building))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -547,7 +547,7 @@ UpdateGraphOnDisk(Relation index, FmgrInfo *procinfo, Oid collation, HnswElement
|
|||||||
BlockNumber newInsertPage = InvalidBlockNumber;
|
BlockNumber newInsertPage = InvalidBlockNumber;
|
||||||
|
|
||||||
/* Look for duplicate */
|
/* Look for duplicate */
|
||||||
if (HnswFindDuplicateOnDisk(index, element, building))
|
if (FindDuplicateOnDisk(index, element, building))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Add element */
|
/* Add element */
|
||||||
|
|||||||
Reference in New Issue
Block a user