From: svim-ig (@svim-ig) <noreply+svim-ig@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: [pgvector/pgvector] issue #751: No Results with HNSW and Filtering
Date: Mon, 06 Jan 2025 21:29:40 +0000
Message-ID: <gh-pgvector-pgvector-751@github.com> (raw)
I am having two tables where table1 created with hnsw indexing and table2 created with ivf indexing (Num of records:1M)
Not getting results (getting empty records) with HNSW and filtering as per query below:
cursor.execute("set hnsw.ef_search = 1000;")
cursor.execute("set hnsw.iterative_scan = 'relaxed_order';")
cursor.execute("set hnsw.max_scan_tuples = 20000;")
cursor.execute("set hnsw.scan_mem_multiplier = 2;")
cur.execute("""
SELECT product_description
FROM table2
WHERE channel= 'ONLINE' and price >100 and price<500
ORDER BY product_embeddings <-> %s
LIMIT 10
""", (query_embedding,)).......whereas with IVF i am getting results by simply setting cursor.execute("set ivfflat.probes = 31;") on table 2...how to get results with HNSW too
I created index on channel and price columns too using btree indexing