Re: [WIP] [B-Tree] Retail IndexTuple deletion

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: "Andrey V(dot) Lepikhov" <a(dot)lepikhov(at)postgrespro(dot)ru>, Юрий Соколов <funny(dot)falcon(at)gmail(dot)com>, PostgreSQL-Dev <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [WIP] [B-Tree] Retail IndexTuple deletion
Date: 2018-07-24 11:38:30
Message-ID: CAD21AoAaZ=3mQbodzz7t_5+Gg0w=k5ca635hGe05H_=fCL5XHQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jul 21, 2018 at 3:11 AM, Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
> On Thu, Jul 19, 2018 at 4:29 AM, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>>> One area that might be worth investigating is retail index tuple
>>> deletion performed within the executor in the event of non-HOT
>>> updates. Maybe LP_REDIRECT could be repurposed to mean "ghost record",
>>> at least in unique index tuples with no NULL values. The idea is that
>>> MVCC index scans can skip over those if they've already found a
>>> visible tuple with the same value.
>>
>> I think that's a good idea. The overhead of marking it as ghost seems
>> small and it would speed up index scans. If MVCC index scans have
>> already found a visible tuples with the same value they can not only
>> skip scanning but also kill them? If can, we can kill index tuples
>> without checking the heap.
>
> I think you're talking about making LP_REDIRECT marking in nbtree
> represent a "recently dead" hint: the deleting transaction has
> committed, and so we are 100% sure that the tuple is about to become
> garbage, but it cannot be LP_DEAD just yet because it needs to stay
> around for the benefit of at least one existing snapshot/long running
> transaction.
>
> That's a different idea to what I talked about, since it could perhaps
> work in a way that's much closer to LP_DEAD/kill_prior_tuple (no extra
> executor stuff is required).

I understood. Thank you for explanation!

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2018-07-24 11:51:36 Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.
Previous Message Michael Paquier 2018-07-24 11:25:04 Re: Indicate anti-wraparound autovacuum in log_autovacuum_min_duration