Ran pgindent [skip ci]

This commit is contained in:
Andrew Kane
2024-09-25 14:03:51 -07:00
parent 2df9f24aad
commit a100dc67e5

View File

@@ -124,22 +124,21 @@ hnswcostestimate(PlannerInfo *root, IndexPath *path, double loop_count,
/* /*
* HNSW cost estimation follows a formula that accounts for the total * HNSW cost estimation follows a formula that accounts for the total
* number of tuples indexed combined with the parameters that most influence * number of tuples indexed combined with the parameters that most
* the duration of the index scan, namely: * influence the duration of the index scan, namely: m - the number of
* m - the number of tuples that are scanned in each step of the HNSW * tuples that are scanned in each step of the HNSW graph traversal
* graph traversal
* ef_search - which influences the total number of steps taken at layer 0 * ef_search - which influences the total number of steps taken at layer 0
* *
* The source of the vector data can impact how many steps it takes to * The source of the vector data can impact how many steps it takes to
* converge on the set of vectors to return to the executor. Currently, * converge on the set of vectors to return to the executor. Currently, we
* we use a hardcoded scaling factor (HNSWScanScalingFactor) to help * use a hardcoded scaling factor (HNSWScanScalingFactor) to help
* influence that, but this could later become a configurable parameter * influence that, but this could later become a configurable parameter
* based on the cost estimations. * based on the cost estimations.
* *
* The tuple estimator formula is below: * The tuple estimator formula is below:
* *
* numIndexTuples = (entryLevel * m) + * numIndexTuples = (entryLevel * m) + (layer0TuplesMax *
* (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).