pgsql: Clarify nbtree array exhaustion comments. - Mailing list pgsql-committers

From Peter Geoghegan
Subject pgsql: Clarify nbtree array exhaustion comments.
Date
Msg-id E1t6Cjl-003B9O-9m@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Clarify nbtree array exhaustion comments.

Strictly speaking, we only need to make sure to leave the scan's array
keys in their final positions (final for the current scan direction) to
handle SAOP array exhaustion because btgettuple might only return a
subset of the items for the final page (final for the current scan
direction), before the scan changes direction.  While it's typical for
so->currPos to be invalidated shortly after the scan's arrays are first
exhausted, and while so->currPos invalidation does obviate the need to
leave the scan's arrays in any particular state, we can't rely on any of
that actually happening when handling array exhaustion.  Adjust comments
to make all of that a lot clearer.

Oversight in commit 5bf748b8, which enhanced nbtree ScalarArrayOp
execution.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/81a25790f1f66319b4f088148b97dbb8badd4907

Modified Files
--------------
src/backend/access/nbtree/nbtutils.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)


pgsql-committers by date:

Previous
From: Nathan Bossart
Date:
Subject: pgsql: Optimize sifting down in binaryheap.
Next
From: Peter Geoghegan
Date:
Subject: pgsql: nbtree: assert no scheduled primscan between pages.