Skip to content

Commit 74b7cc8

Browse files
committed
Fix misleading comment in nodeIndexonlyscan.c.
The stated reason for acquiring predicate locks on heap pages hasn't existed since commit c01262a, so fix the comment. Perhaps in a later release we'll also be able to change the code to use tuple locks. Back-patch all the way. Reviewed-by: Ashwin Agrawal Discussion: https://postgr.es/m/CAEepm%3D2GK3FVdnt5V3d%2Bh9njWipCv_fNL%3DwjxyUhzsF%3D0PcbNg%40mail.gmail.com
1 parent 69fd82f commit 74b7cc8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/backend/executor/nodeIndexonlyscan.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,8 @@ IndexOnlyNext(IndexOnlyScanState *node)
242242
errmsg("lossy distance functions are not supported in index-only scans")));
243243

244244
/*
245-
* Predicate locks for index-only scans must be acquired at the page
246-
* level when the heap is not accessed, since tuple-level predicate
247-
* locks need the tuple's xmin value. If we had to visit the tuple
248-
* anyway, then we already have the tuple-level lock and can skip the
249-
* page lock.
245+
* If we didn't access the heap, then we'll need to take a predicate
246+
* lock explicitly, as if we had. For now we do that at page level.
250247
*/
251248
if (!tuple_from_heap)
252249
PredicateLockPage(scandesc->heapRelation,

0 commit comments

Comments
 (0)