pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
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







view thread (8+ messages)  latest in thread

Message-ID: <gh-pgvector-pgvector-751@github.com>
Permalink:  ../gh-pgvector-pgvector-751@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