mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-13 08:06:54 +08:00
Updated comments [skip ci]
This commit is contained in:
@@ -252,16 +252,8 @@ RepairGraphEntryPoint(HnswVacuumState * vacuumstate)
|
|||||||
highestPoint = NULL;
|
highestPoint = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Repair graph for highest non-entry point. May be outdated due to
|
* Repair graph for highest non-entry point. Highest point may be outdated
|
||||||
* inserts that happen during RemoveHeapTids.
|
* due to inserts that happen during and after RemoveHeapTids.
|
||||||
*
|
|
||||||
* Outdated point can remove connections at higher levels in the graph
|
|
||||||
* until they are repaired. Could set the insert page to the last page at
|
|
||||||
* the start of RemoveHeapTids to reduce this possibility, but likely
|
|
||||||
* better to keep reusing space.
|
|
||||||
*
|
|
||||||
* If highest point is empty and entry point is deleted, the entry point
|
|
||||||
* can be empty for a short period until a live element is repaired.
|
|
||||||
*/
|
*/
|
||||||
if (highestPoint != NULL)
|
if (highestPoint != NULL)
|
||||||
{
|
{
|
||||||
@@ -293,12 +285,20 @@ RepairGraphEntryPoint(HnswVacuumState * vacuumstate)
|
|||||||
|
|
||||||
if (DeletedContains(vacuumstate->deleted, &epData))
|
if (DeletedContains(vacuumstate->deleted, &epData))
|
||||||
{
|
{
|
||||||
/* Replace the entry point with the highest point */
|
/*
|
||||||
|
* Replace the entry point with the highest point. If highest
|
||||||
|
* point is outdated and empty, the entry point will be empty
|
||||||
|
* until an element is repaired.
|
||||||
|
*/
|
||||||
HnswUpdateMetaPage(index, HNSW_UPDATE_ENTRY_ALWAYS, highestPoint, InvalidBlockNumber, MAIN_FORKNUM);
|
HnswUpdateMetaPage(index, HNSW_UPDATE_ENTRY_ALWAYS, highestPoint, InvalidBlockNumber, MAIN_FORKNUM);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Repair the entry point with the highest point */
|
/*
|
||||||
|
* Repair the entry point with the highest point. If highest point
|
||||||
|
* is outdated, this can remove connections at higher levels in
|
||||||
|
* the graph until they are repaired, but this should be fine.
|
||||||
|
*/
|
||||||
HnswLoadElement(entryPoint, NULL, NULL, index, vacuumstate->procinfo, vacuumstate->collation, true);
|
HnswLoadElement(entryPoint, NULL, NULL, index, vacuumstate->procinfo, vacuumstate->collation, true);
|
||||||
|
|
||||||
if (NeedsUpdated(vacuumstate, entryPoint))
|
if (NeedsUpdated(vacuumstate, entryPoint))
|
||||||
|
|||||||
Reference in New Issue
Block a user