mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-11 23:26:55 +08:00
Revert "Fixed locking for index scans for HNSW - #256"
This reverts commit d032726976.
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
## 0.5.1 (unreleased)
|
## 0.5.1 (unreleased)
|
||||||
|
|
||||||
- Improved performance of index scans for IVFFlat after updates and deletes
|
- Improved performance of index scans for IVFFlat after updates and deletes
|
||||||
- Fixed locking for index scans for HNSW
|
|
||||||
|
|
||||||
## 0.5.0 (2023-08-28)
|
## 0.5.0 (2023-08-28)
|
||||||
|
|
||||||
|
|||||||
@@ -113,12 +113,6 @@ hnswbeginscan(Relation index, int nkeys, int norderbys)
|
|||||||
|
|
||||||
scan->opaque = so;
|
scan->opaque = so;
|
||||||
|
|
||||||
/*
|
|
||||||
* Get a shared lock. This allows vacuum to ensure no in-flight scans
|
|
||||||
* before marking tuples as deleted.
|
|
||||||
*/
|
|
||||||
LockPage(scan->indexRelation, HNSW_SCAN_LOCK, ShareLock);
|
|
||||||
|
|
||||||
return scan;
|
return scan;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,8 +163,17 @@ hnswgettuple(IndexScanDesc scan, ScanDirection dir)
|
|||||||
/* Get scan value */
|
/* Get scan value */
|
||||||
value = GetScanValue(scan);
|
value = GetScanValue(scan);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get a shared lock. This allows vacuum to ensure no in-flight scans
|
||||||
|
* before marking tuples as deleted.
|
||||||
|
*/
|
||||||
|
LockPage(scan->indexRelation, HNSW_SCAN_LOCK, ShareLock);
|
||||||
|
|
||||||
so->w = GetScanItems(scan, value);
|
so->w = GetScanItems(scan, value);
|
||||||
|
|
||||||
|
/* Release shared lock */
|
||||||
|
UnlockPage(scan->indexRelation, HNSW_SCAN_LOCK, ShareLock);
|
||||||
|
|
||||||
so->first = false;
|
so->first = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,9 +226,6 @@ hnswendscan(IndexScanDesc scan)
|
|||||||
{
|
{
|
||||||
HnswScanOpaque so = (HnswScanOpaque) scan->opaque;
|
HnswScanOpaque so = (HnswScanOpaque) scan->opaque;
|
||||||
|
|
||||||
/* Release shared lock */
|
|
||||||
UnlockPage(scan->indexRelation, HNSW_SCAN_LOCK, ShareLock);
|
|
||||||
|
|
||||||
MemoryContextDelete(so->tmpCtx);
|
MemoryContextDelete(so->tmpCtx);
|
||||||
|
|
||||||
pfree(so);
|
pfree(so);
|
||||||
|
|||||||
Reference in New Issue
Block a user