pgsql: Report syncscan position at end of scan.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Report syncscan position at end of scan.
Date: 2023-08-31 10:11:36
Message-ID: E1qbeeF-001nz0-Rb@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Report syncscan position at end of scan.

The comment in heapgettup_advance_block() says that it reports the
scan position before checking for end of scan, but that didn't match
the code. The code was refactored in commit 7ae0ab0ad9, which
inadvertently changed the order of the check and reporting. Change it
back.

This caused a few regression test failures with a small shared_buffers
setting like 10 MB. The 'portals' and 'cluster' tests perform seqscans
that are large enough that sync seqscans kick in. When the sync scan
position is not updated at end of scan, the next seq scan doesn't
start at the beginning of the table, and the test queries are
sensitive to that.

Reviewed-by: Melanie Plageman, David Rowley
Discussion: https://www.postgresql.org/message-id/6f991389-ae22-d844-a9d8-9aceb7c01a9a@iki.fi
Backpatch-through: 16

Branch
------
master

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

Modified Files
--------------
src/backend/access/heap/heapam.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2023-08-31 19:14:43 pgsql: doc: PG 16 relnotes: clarify LOCK TABLE description
Previous Message Peter Eisentraut 2023-08-31 09:12:42 pgsql: Correct ObjectProperty entry for transforms