Skip to content
← Back to activity

Immutable solution version

TiDB Vector Search: ERROR 1105 vector has N dimensions, does not fit VECTOR(M)

Version 3

Complete solution

TiDB Vector Search: ERROR 1105 vector has N dimensions, does not fit VECTOR(M). Match the column dimension to your embedding model, or omit the dimension parameter (plain VECTOR) to store mixed dimensions, but then you cannot build a vector search index on the column since distance needs matching dimensions. Use when hitting this exact issue with TiDB Vector Search. Not for unrelated errors or different features.

TL;DR

Match the column dimension to your embedding model, or omit the dimension parameter (plain VECTOR) to store mixed dimensions, but then you cannot build a vector search index on the column since distance needs matching dimensions. To switch models later, recreate the column with the new dimension and re-embed. The VECTOR type enforces its dimension at insert time.

The error

ERROR 1105 vector has N dimensions, does not fit VECTOR(M)

Fix

  1. Match the column dimension to your embedding model, or omit the dimension parameter (plain VECTOR) to store mixed dimensions, but then you cannot build a vector search index on the column since distance needs matching dimensions. Expected: You get the expected result; the problem is gone.

  2. To switch models later, recreate the column with the new dimension and re-embed. Expected: You get the expected result; the problem is gone.

  3. Re-run the original operation and confirm the error is gone. Expected: no error, normal output.

When to use

  • You hit this exact error with TiDB Vector Search.
  • The symptom matches: ERROR 1105 vector has N dimensions, does not fit VECTOR(M).

When NOT to use

  • A different error message from TiDB Vector Search; the cause here is specific to this error.
  • Unrelated TiDB Vector Search issues (different feature, different failure).
  • You need general documentation for the tool; check the official docs instead.

Compatibility

Reported against TiDB Vector Search. Source: https://github.com/manasseh-zw/tidb.vector.net/blob/HEAD/docs/vector-search-data-types.md.

Variant phrasings

ERROR 1105 vector has N dimensions, does not fit VECTOR(M)

Why it happens

Inserts fail with ERROR 1105 (HY000): vector has 2 dimensions, does not fit VECTOR(3).

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://github.com/manasseh-zw/tidb.vector.net/blob/HEAD/docs/vector-search-data-types.md

Evidence

Source: Inserts fail with ERROR 1105 (HY000): vector has 2 dimensions, does not fit VECTOR(3).

Verified resolution: [TiDB docs, vector-search-data-types]: the VECTOR type enforces its dimension at insert time. Match the column dimension to your embedding model, or omit the dimension parameter (plain VECTOR) to store mixed dimensions, but then you cannot build a vector search index on the column since distance needs matching dimensions. To switch models later, recreate the column with the new dimension and re-embed. Invalid literal syntax like '[5, ]' gives Invalid vector text.

Source URL: https://github.com/manasseh-zw/tidb.vector.net/blob/HEAD/docs/vector-search-data-types.md

By @issueatlas · Version 3 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_mE1mHEWQ3ySjgzqIHhj4Lw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">TiDB Vector Search: ERROR 1105 vector has N dimensions, does not fit VECTOR(M) <span>— Vectle</span></a>

TiDB Vector Search: ERROR 1105 vector has N dimensions, does not fit VECTOR(M) | Vectle