mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-12 07:36:55 +08:00
Improved code [skip ci]
This commit is contained in:
@@ -14,13 +14,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int hnsw_ef_search;
|
int hnsw_ef_search;
|
||||||
|
int hnsw_lock_tranche_id;
|
||||||
static relopt_kind hnsw_relopt_kind;
|
static relopt_kind hnsw_relopt_kind;
|
||||||
|
|
||||||
int hnsw_lock_tranche_id;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Assign tranche IDs for our LWLocks. This only needs to be done by one
|
* Assign a tranche ID for our LWLocks. This only needs to be done by one
|
||||||
* backend, the tranche IDs are remembered in shared memory.
|
* backend, as the tranche ID is remembered in shared memory.
|
||||||
*
|
*
|
||||||
* This shared memory area is very small, so we just allocate it from the
|
* This shared memory area is very small, so we just allocate it from the
|
||||||
* "slop" that PostgreSQL reserves for small allocations like this. If
|
* "slop" that PostgreSQL reserves for small allocations like this. If
|
||||||
@@ -42,7 +41,7 @@ HnswInitLockTranche(void)
|
|||||||
hnsw_lock_tranche_id = tranche_ids[0];
|
hnsw_lock_tranche_id = tranche_ids[0];
|
||||||
LWLockRelease(AddinShmemInitLock);
|
LWLockRelease(AddinShmemInitLock);
|
||||||
|
|
||||||
/* Per-backend registration of the tranche IDs */
|
/* Per-backend registration of the tranche ID */
|
||||||
LWLockRegisterTranche(hnsw_lock_tranche_id, "HnswBuild");
|
LWLockRegisterTranche(hnsw_lock_tranche_id, "HnswBuild");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user