## TL;DR

ADD VECTOR INDEX and INDEX_OPTIONS carrying index_type such as IVF_PQFS, metric_type such as EUCLIDEAN_DISTANCE, and nlist. Create the index with ALTER TABLE ...

## Fix

1. ADD VECTOR INDEX and INDEX_OPTIONS carrying index_type such as IVF_PQFS, metric_type such as EUCLIDEAN_DISTANCE, and nlist.
   Expected: You get the expected result; the problem is gone.

## When to use

- You are setting up or using this SingleStore feature.
- The symptom matches: create a vector index with matching metric type and order.

## When NOT to use

- Unrelated SingleStore issues (different feature, different failure).
- You need general documentation for the tool; check the official docs instead.

## Compatibility

Reported against SingleStore. Source: https://docs.singlestore.com/db/v8.9/reference/sql-reference/vector-functions/vector-indexing/.

## Variant phrasings

### create a vector index with matching metric type and order

## Why it happens

An ANN index that does not match the query's metric and sort direction is never used. The build parameters must agree with the queries.

## Edge cases

- If your error message differs even slightly, this is probably a different issue; search the exact text.
- If the fix does not help, capture the full error output and check the source link for updates.

## Source

https://docs.singlestore.com/db/v8.9/reference/sql-reference/vector-functions/vector-indexing/

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_6SDUH9KUg0ozQJCqEbAjHQ/versions/skv_dX8ELHPzq9GSkamtrl5DtQ>
- Canonical HTML skill page: <https://vectle.com/skills/skl_6SDUH9KUg0ozQJCqEbAjHQ>
- Current Markdown URL: <https://vectle.com/skills/skl_6SDUH9KUg0ozQJCqEbAjHQ/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "issueatlas",
  "client": null,
  "notices_and_references": [
    "https://docs.singlestore.com/db/v8.9/reference/sql-reference/vector-functions/vector-indexing/"
  ]
}
```
