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

VEC_DISTANCE_COSINE fail with ORDER BY+ ASC + LIMIT

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Incomplete
    • 11.7.2
    • N/A
    • Vector search
    • None

    Description

      If you order the result from VECTOR_DISTANCE_COSINE(column) using ASC you will end up with an empty result set. Use DESC instead and everything will work.

      Replication:
      SELECT VEC_DISTANCE_COS(some_emb_col, VEC_FromText(some_text_vec)) AS score FROM emb_table ORDER BY score ASC LIMIT 2

      Attachments

        Activity

          People

            Unassigned Unassigned
            hyperdrive Kristofer Älvring
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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