Ctid chain following enhancement - Mailing list pgsql-patches

From Pavan Deolasee
Subject Ctid chain following enhancement
Date
Msg-id 2e78013d0701262150i7e48018br27fbd3ce0309cf2e@mail.gmail.com
Whole thread Raw
Responses Re: Ctid chain following enhancement
List pgsql-patches

Attached is a patch which should marginally improve the ctid chain followin
code path when current and the next tuple in the chain are in the same block.

In the current code, we unconditionally drop pin of the current block without
checking whether the next tuple is the same block or not. ISTM that this can
be improved.

The attached patch replaces the heap_fetch() with heap_release_fetch() in
EvalPlanQual() and thus releases the buffer iff the chain gets into a different block.
Similarly, ReadBuffer() is replaced with ReleaseAndReadBuffer() in
heap_get_latest_tid() for the same reason. The buffer is set to InvalidBuffer
to start with and is not released at the end of the loop. heap_release_fetch()/
ReleaseAndReadBuffer() would release it if required.

Thanks,
Pavan

--

EnterpriseDB     http://www.enterprisedb.com
Attachment

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Autovacuum launcher patch
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] less privileged pl install