]> granicus.if.org Git - postgresql/commitdiff
Fix misleading comment in nodeIndexonlyscan.c.
authorThomas Munro <tmunro@postgresql.org>
Thu, 27 Jun 2019 23:11:26 +0000 (11:11 +1200)
committerThomas Munro <tmunro@postgresql.org>
Fri, 28 Jun 2019 05:22:39 +0000 (17:22 +1200)
The stated reason for acquiring predicate locks on heap pages hasn't
existed since commit c01262a8, 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

src/backend/executor/nodeIndexonlyscan.c

index afcd1ff353e71ab39616cd49919c1f8a5d6bd54b..d6049625e9bf3d3d08f303f61afef3c107610014 100644 (file)
@@ -166,11 +166,8 @@ IndexOnlyNext(IndexOnlyScanState *node)
                }
 
                /*
-                * Predicate locks for index-only scans must be acquired at the page
-                * level when the heap is not accessed, since tuple-level predicate
-                * locks need the tuple's xmin value.  If we had to visit the tuple
-                * anyway, then we already have the tuple-level lock and can skip the
-                * page lock.
+                * If we didn't access the heap, then we'll need to take a predicate
+                * lock explicitly, as if we had.  For now we do that at page level.
                 */
                if (tuple == NULL)
                        PredicateLockPage(scandesc->heapRelation,