Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-41649

better default for mhnsw_max_cache_size

    XMLWordPrintable

Details

    • New Feature
    • Status: Stalled (View Workflow)
    • Major
    • Resolution: Unresolved
    • 13.3
    • Vector search
    • 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

      Attachments

        Activity

          People

            serg Sergei Golubchik
            serg Sergei Golubchik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.