aboutsummaryrefslogtreecommitdiff
path: root/contrib/jsonb_plpython
diff options
context:
space:
mode:
authorPeter Geoghegan <pg@bowt.ie>2025-05-07 15:17:40 -0400
committerPeter Geoghegan <pg@bowt.ie>2025-05-07 15:17:40 -0400
commit7e25c9363a82b6974c1ca2303ae8ded98af3bb24 (patch)
treefa3e3afaa3391f4587527eafa20384dcc8becf7a /contrib/jsonb_plpython
parentacea3fc49f006a08e6c540ac0bacc2c2577a5ff9 (diff)
downloadpostgresql-7e25c9363a82b6974c1ca2303ae8ded98af3bb24.tar.gz
postgresql-7e25c9363a82b6974c1ca2303ae8ded98af3bb24.zip
nbtree: tighten up array recheck rules.
Be more conservative when performing a scheduled recheck of an nbtree scan's array keys once on the next page, having set so->scanBehind: back out of reading the page (perform another primitive scan instead) when the next page's high key/finaltup has an untruncated prefix of matching values and truncated suffix attributes associated with lower-order keys. In other words, stop assuming that the lower-order keys have been satisfied by the truncated suffix attributes in this context (only do so when considering scheduling a recheck within _bt_advance_array_keys). The new behavior is more logical: if the next page read after setting so->scanBehind can only contain tuples that are themselves "behind the scan", that's reason enough to cut our losses. In general, when we set so->scanBehind, we only expect to perform one recheck on the next page to make a final decision about whether or not to continue the current primitive index scan. It seems unprincipled for the recheck to allow a _bt_readpage to continue unless the scan's arrays will advance/unless the page might actually contain relevant tuples. In practice it is highly unlikely that things will line up like this (the untruncated prefix of attribute values from the next page's high key is seldom an exact match for their corresponding array's current element following array advancement on the original/previous page). That gives us all the more reason to keep things simple and consistent. This was arguably an oversight in commit 9a2e2a285a, which improved nbtree array primitive scan scheduling. Author: Peter Geoghegan <pg@bowt.ie> Discussion: https://postgr.es/m/CAH2-WzkXzJajgyW-pCQ7vaDPhaT3huU+Zw_j448rpCBEsu2YOQ@mail.gmail.com
Diffstat (limited to 'contrib/jsonb_plpython')
0 files changed, 0 insertions, 0 deletions