pgsql: Further refactor of heapgettup and heapgettup_pagemode

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Further refactor of heapgettup and heapgettup_pagemode
Date: 2023-02-02 22:49:01
Message-ID: E1pNiO4-001Hpc-K1@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Further refactor of heapgettup and heapgettup_pagemode

Backward and forward scans share much of the same page acquisition code.
Here we consolidate that code to reduce some duplication.

Additionally, add a new rs_coffset field to HeapScanDescData to track the
offset of the current tuple. The new field fits nicely into the padding
between a bool and BlockNumber field and saves having to look at the last
returned tuple to figure out which offset we should be looking at for the
current tuple.

Author: Melanie Plageman
Reviewed-by: David Rowley
Discussion: https://postgr.es/m/CAAKRu_bvkhka0CZQun28KTqhuUh5ZqY=_T8QEqZqOL02rpi2bw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f9bc34fcb664e93d1fa3c3873527dce6f4cc495f

Modified Files
--------------
src/backend/access/heap/heapam.c | 200 ++++++++++++---------------------------
src/include/access/heapam.h | 1 +
2 files changed, 63 insertions(+), 138 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2023-02-02 23:39:40 pgsql: Add helper functions to simplify heapgettup code
Previous Message Thomas Munro 2023-02-02 22:32:03 pgsql: Retire PG_SETMASK() macro.