pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
From: knizhnik (@knizhnik) <noreply+knizhnik@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] PR #86: Ivf index prefetch
Date: Wed, 24 May 2023 06:05:43 +0000
Message-ID: <gh-pgvector-pgvector-86-c1560505293@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-86@github.com>
References: <gh-pgvector-pgvector-86@github.com>

> From my testing, I'm -1 on changing from `BAS_BULKREAD` to `BAS_NORMAL`, though I'd like to test a bit more so I can bring numbers I'm more confident in. For queries under the defaults (i.e. `ivfflat.probes` is `1`), this likely makes little difference. However, increasing the number of probes requires loading more pages into memory, both indexes and heap, and the benefits of `BAS_BULKREAD` becoming noticeable in this case as the vector dimensionality increases.
> 
> Assuming that "datasets fit into memory" may work on systems that are exclusively processing vector data, but my current experience from seeing people integrating pgvector is that it exists alongside current workloads.

Please notice that Postgres is using ring buffer strategies only for seqscan, not for index scan.
I wonder why ivfflat index scan is considered to be more close to seqscan rather than to index scan?
IMHO Postgres use very strange approach for buffer eviction when it is throwing away pages from shared buffers even if there are free buffers. It leads to worse performance even if it is enough free memory at the system to keep the whole data set in memory. Without usin special extensions like pg_prewarm it is not possible to to reach maximal possible speed. Yes, file system cache may help i this case, but it is about 15% slow then access to the page in shared buffers.

So I think that BAS_BULKREAD should be used at least when expected relation size is more than 1// or better 1/2 os shared buffers, but IMHO it is better not to use BAS_BULKREAD at all, because we are actually performing index scan and let buffer manager eviction algorithm do it work.



view thread (11+ messages)  latest in thread

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