We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When trying to create HNSW indices for pgvector columns in Atlas HCL, the generated SQL is missing required operator class and parameters.
Given this simplified schema:
schema "public" {} extension "vector" { schema = schema.public version = "0.8.0" } table "items" { schema = schema.public column "id" { type = text null = false } column "embedding" { type = sql("vector(384)") null = true } primary_key { columns = [column.id] } index "hnsw_embedding_idx" { type = "HNSW" columns = [column.embedding] } }
Atlas generates:
CREATE INDEX "hnsw_embedding_idx" ON "public"."items" USING HNSW ("embedding");
Which fails with:
pq: data type vector has no default operator class for access method "hnsw"
The correct SQL should be:
CREATE INDEX "hnsw_embedding_idx" ON "public"."items" USING hnsw ((embedding vector_l2_ops)) WITH (m=16, ef_construction=64);
Currently there's no way to specify:
vector_l2_ops
vector_ip_ops
vector_cosine_ops
m
ef_construction
I tried various approaches including:
index "hnsw_embedding_idx" { type = sql("hnsw") columns = [column.embedding] options = sql("WITH (m=16, ef_construction=64)") }
But none worked properly with Atlas's HCL syntax.
This is related to #3222.
The text was updated successfully, but these errors were encountered:
You can define the operator class of index parts like this:
index "hnsw_embedding_idx" { type = "hnsw" on { column = column.embedding ops = "vector_l2_ops" } }
However, the other storage parameters are not supported. I'll check what's the status of it and I'll update you.
Sorry, something went wrong.
That works, thanks @a8m!
Sounds good, thanks.
No branches or pull requests
When trying to create HNSW indices for pgvector columns in Atlas HCL, the generated SQL is missing required operator class and parameters.
Given this simplified schema:
Atlas generates:
Which fails with:
The correct SQL should be:
Currently there's no way to specify:
vector_l2_ops
,vector_ip_ops
, orvector_cosine_ops
)m
,ef_construction
)I tried various approaches including:
But none worked properly with Atlas's HCL syntax.
This is related to #3222.
The text was updated successfully, but these errors were encountered: