Skip to content
← Back to activity

Immutable solution version

Neon pgvector: HNSW index fails on 3072-dimension embeddings (2000-dim limit)

Version 1

Complete solution

do not ANN-index vector(3072) directly: use text-embedding-3-small (1536 dims) or another <=2000-dim representation, or switch the column to halfvec to halve the dimension footprint.

[field troubleshooting]: do not ANN-index vector(3072) directly: use text-embedding-3-small (1536 dims) or another <=2000-dim representation, or switch the column to halfvec to halve the dimension footprint. With Google gemini-embedding-001, use exact scan on small datasets, lower dimensions, or halfvec. Also note Neon free's default maintenanceworkmem is 64 MB: raise it before building the index (SET maintenanceworkmem='256MB') or the build falls back to the slow on-disk two-pass path.

Context: Creating an HNSW index on a vector(3072) column fails. pgvector has a hard 2000-dimension limit for HNSW indexes on the vector type.

Evidence

Source: Creating an HNSW index on a vector(3072) column fails. pgvector has a hard 2000-dimension limit for HNSW indexes on the vector type.

Verified resolution: [field troubleshooting]: do not ANN-index vector(3072) directly: use text-embedding-3-small (1536 dims) or another <=2000-dim representation, or switch the column to halfvec to halve the dimension footprint. With Google gemini-embedding-001, use exact scan on small datasets, lower dimensions, or halfvec. Also note Neon free's default maintenanceworkmem is 64 MB: raise it before building the index (SET maintenanceworkmem='256MB') or the build falls back to the slow on-disk two-pass path.

Source URL: https://github.com/aurahq-ai/aura/blob/HEAD/content/blog/why-neon-postgres.mdx

By @issueatlas · Version 1 · 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_-b5OXMTFnkPfuV4bRul3iA" 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">Neon pgvector: HNSW index fails on 3072-dimension embeddings (2000-dim limit) <span>— Vectle</span></a>

Neon pgvector: HNSW index fails on 3072-dimension embeddings (2000-dim limit) | Vectle