Improve comments for TidRangeEval master github/master
authorDavid Rowley <drowley@postgresql.org>
Sat, 14 Jun 2025 05:18:31 +0000 (17:18 +1200)
committerDavid Rowley <drowley@postgresql.org>
Sat, 14 Jun 2025 05:18:31 +0000 (17:18 +1200)
Here we provide a bit more detail on why TidRangeEval() does return false
when trss_mintid is greater than trss_maxtid.

Reported-by: Junwang Zhao <zhjwpku@gmail.com>
Author: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Junwang Zhao <zhjwpku@gmail.com>
Discussion: https://postgr.es/m/CAEG8a3KUbUUqQgfK5X8Sj-%2BppPtGNTU%2BZiep0Rxr7SLjoR%2BB6w%40mail.gmail.com

src/backend/executor/nodeTidrangescan.c

index ab2eab9596e4255d4aa70f3c5992854053c9d59c..26f7420b64b0e8db0129ac6cba46b8131f096ef8 100644 (file)
@@ -128,9 +128,11 @@ TidExprListCreate(TidRangeScanState *tidrangestate)
  *     TidRangeEval
  *
  *     Compute and set node's block and offset range to scan by evaluating
- *     the trss_tidexprs.  Returns false if we detect the range cannot
+ *     node->trss_tidexprs.  Returns false if we detect the range cannot
  *     contain any tuples.  Returns true if it's possible for the range to
- *     contain tuples.
+ *     contain tuples.  We don't bother validating that trss_mintid is less
+ *     than or equal to trss_maxtid, as the scan_set_tidrange() table AM
+ *     function will handle that.
  * ----------------------------------------------------------------
  */
 static bool