From: MMeent (@MMeent) <noreply+MMeent@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #244: HNSW + dead tuples: recall loss/usability issues
Date: Thu, 07 Sep 2023 08:58:25 +0000
Message-ID: <gh-pgvector-pgvector-244-c1709762325@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-244@github.com>
References: <gh-pgvector-pgvector-244@github.com>
> 1. Marking tuples as deleted (since `scan->kill_prior_tuple` is the only way to get this information).
The built-in `btree` AM does some optimistic cleanup for non-hot updates where the indexed value hasn't changed, and does this during index tuple insertion (since PostgreSQL 14).
Might you be able to do something similar? The underlying assumption of the optimization is "we've just had a non-hot update, there might be more non-hot updated tuples, and those other tuples may already be dead, so let's try to find some dead non-HOT-updated tuples to clean up".
Ref: [`_bt_bottomupdel_pass`](https://github.com/postgres/postgres/blob/master/src/backend/access/nbtree/nbtdedup.c#L307)