mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-12 15:46:54 +08:00
Removed unneeded floor and fixed comment formatting [skip ci]
This commit is contained in:
@@ -137,8 +137,7 @@ hnswcostestimate(PlannerInfo *root, IndexPath *path, double loop_count,
|
|||||||
*
|
*
|
||||||
* The tuple estimator formula is below:
|
* The tuple estimator formula is below:
|
||||||
*
|
*
|
||||||
* numIndexTuples = (entryLevel * m) + (layer0TuplesMax *
|
* numIndexTuples = entryLevel * m + layer0TuplesMax * layer0Selectivity
|
||||||
* layer0Selectivity)
|
|
||||||
*
|
*
|
||||||
* "entryLevel * m" represents the floor of tuples we need to scan to get
|
* "entryLevel * m" represents the floor of tuples we need to scan to get
|
||||||
* to layer 0 (L0).
|
* to layer 0 (L0).
|
||||||
@@ -150,7 +149,7 @@ hnswcostestimate(PlannerInfo *root, IndexPath *path, double loop_count,
|
|||||||
* at L0, accounting for previously visited tuples, multiplied by the
|
* at L0, accounting for previously visited tuples, multiplied by the
|
||||||
* "scalingFactor" (currently hardcoded).
|
* "scalingFactor" (currently hardcoded).
|
||||||
*/
|
*/
|
||||||
entryLevel = (int) floor(log(path->indexinfo->tuples + 1) * HnswGetMl(m));
|
entryLevel = (int) (log(path->indexinfo->tuples + 1) * HnswGetMl(m));
|
||||||
layer0TuplesMax = HnswGetLayerM(m, 0) * hnsw_ef_search;
|
layer0TuplesMax = HnswGetLayerM(m, 0) * hnsw_ef_search;
|
||||||
layer0Selectivity = (scalingFactor * log(path->indexinfo->tuples + 1)) /
|
layer0Selectivity = (scalingFactor * log(path->indexinfo->tuples + 1)) /
|
||||||
(log(m) * (1 + log(hnsw_ef_search)));
|
(log(m) * (1 + log(hnsw_ef_search)));
|
||||||
|
|||||||
Reference in New Issue
Block a user