pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
From: redphosphorus7562 (@redphosphorus7562) <noreply+redphosphorus7562@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #862: Inconsistent behavior with relaxed_order: planner assumes strict ordering from HNSW index
Date: Mon, 23 Jun 2025 02:03:38 +0000
Message-ID: <gh-pgvector-pgvector-862-c2994677835@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-862@github.com>
References: <gh-pgvector-pgvector-862@github.com>

Thank you for your reply,you can use this sql to reproduce :
```sql
CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3));
INSERT INTO items (embedding)
SELECT ARRAY[random(), random(), random()]::vector FROM generate_series(1, 20000);
CREATE INDEX ON items USING hnsw (embedding vector_cosine_ops);
SET hnsw.iterative_scan = strict_order;
select embedding <=> '[3,2,1]' as distance from items order by distance limit 5000;
```
I sorted the results and compared them to each other, and found that some of the positions were not strictly ordered       

view thread (8+ messages)  latest in thread

Message-ID: <gh-pgvector-pgvector-862-c2994677835@github.com>
Permalink:  ../gh-pgvector-pgvector-862-c2994677835@github.com/

 · 


This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox