Details
-
New Feature
-
Status: Stalled (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
Description
mhnsw_max_cache_size is 16M by default. This is too low, users get very bad performance on the first attempt and leave.
It's generally safe to have it very large as it's not used unless one actually have enough data to fill it.
I've seen an opinion somewhere that up to 100K rows one hardly needs a vector index at all, as the full table scan is still good enough.
Using it as a ballpark figure and 1536 dimensions, 2 bytes per value, M=48 (meaning 96 neighbors of 8 bytes per link) and ignoring higher-level links, one gets
100000*(1536*2+96*8) = 384000000 = 384 MB ≈ 366.2 MiB
|
So, one can say that with the data size less than 265M, a table scan will be faster than the index search. And that mhnsw_max_cache_size should be at least 512MiB