-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
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
Multicolumn ANN indexes on a hypertable #134
Comments
@hamishc Vector indexes cannot be multi-column right now. What you want to do instead is use time-based table partitioning using Timescale's hypertables and then have a regular diskann column on the embedding column. That way the query executions will be approximately as follows:
Step 1 makes sure most of the irrelevant data based on the time constraints are thrown away quickly. Step 2 uses the full power of the vector index. Step 3 does the final cleanup. |
Oh, so hypertables don't actually need indexes on the time column in order to use the partitions? When I created the hypertable I ran it with I've validated with the query planner that it's using the indexes and only running on the requested partition, so it's working either way! Thanks for your help! |
Hi! I'm wanting to perform ANN search on time-series data, so I'm trying to index my tables on multiple columns: the embedding column and the timestamp column, in order to optimally take advantage of timescale hypertable functionality. I'm not able to find any documentation on how to do this.
e.g. I would like something like
It seems like pgvector supports conditional indexing only (e.g.
CREATE INDEX ON items USING hnsw (embedding vector_l2_ops) WHERE (category_id = 123);
) but for obvious reasons this isn't available for time-based partitions.It would be a major advantage for us to be able to query on long-term timeseries data, so we'd love to see this added if it's not already available. If it isn't, is this functionality possible or on the roadmap as an enhancement at some point?
The text was updated successfully, but these errors were encountered: