Improved performance of cosine distance

This commit is contained in:
Andrew Kane
2023-03-21 11:25:25 -07:00
parent 18eb04e278
commit bc9e2a37ec
2 changed files with 2 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
## 0.4.1 (unreleased)
- Improved performance of cosine distance
- Fixed index scan count
## 0.4.0 (2023-01-11)

View File

@@ -568,7 +568,7 @@ cosine_distance(PG_FUNCTION_ARGS)
normb += bx[i] * bx[i];
}
PG_RETURN_FLOAT8(1 - (distance / (sqrt(norma) * sqrt(normb))));
PG_RETURN_FLOAT8(1 - (distance / sqrt(norma * normb)));
}
/*