From: ankane (@ankane) <noreply+ankane@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #785: Continued Issues with HNSW Index Queries Using ORDER BY and LIMIT Despite Parameter Adjustments
Date: Tue, 25 Feb 2025 10:03:47 +0000
Message-ID: <gh-pgvector-pgvector-785-c2681417087@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-785@github.com>
References: <gh-pgvector-pgvector-785@github.com>
Hi @shikaiwei1, what's the output of `EXPLAIN (ANALYZE, BUFFERS)` for each of the queries? Also, how many rows are in the table, and how many match the `WHERE` condition?
A few initial suggestions:
1. Add a B-tree index on `dataset_id`
2. Use the default `m` of 16 instead of 32
3. Make sure `shared_buffers` is set correctly ([docs](https://github.com/pgvector/pgvector?tab=readme-ov-file#tuning))