diff options
author | Peter Geoghegan <pg@bowt.ie> | 2024-09-24 12:58:55 -0400 |
---|---|---|
committer | Peter Geoghegan <pg@bowt.ie> | 2024-09-24 12:58:55 -0400 |
commit | 3da436ec09ae2f1a0167d4b74b30449f0292f581 (patch) | |
tree | d0094be58fd56a6414e0ca03e1f62f2682f94fe7 /src/backend/access/nbtree/nbtutils.c | |
parent | 62ddf7ee9a399e0b9624412fc482ed7365e38958 (diff) | |
download | postgresql-3da436ec09ae2f1a0167d4b74b30449f0292f581.tar.gz postgresql-3da436ec09ae2f1a0167d4b74b30449f0292f581.zip |
Update obsolete nbtree array preprocessing comments.
The array->scan_key references fixed up at the end of preprocessing
start out as offsets into the arrayKeyData[] array (the array returned
by _bt_preprocess_array_keys at the start of preprocessing that involves
array scan keys). Offsets into the arrayKeyData[] array are no longer
guaranteed to be valid offsets into our original scan->keyData[] input
scan key array, but comments describing the array->scan_key references
still talked about scan->keyData[]. Update those comments.
Oversight in commit b5249741.
Diffstat (limited to 'src/backend/access/nbtree/nbtutils.c')
-rw-r--r-- | src/backend/access/nbtree/nbtutils.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/backend/access/nbtree/nbtutils.c b/src/backend/access/nbtree/nbtutils.c index b9f81496976..b4ba51357a5 100644 --- a/src/backend/access/nbtree/nbtutils.c +++ b/src/backend/access/nbtree/nbtutils.c @@ -538,11 +538,10 @@ _bt_preprocess_array_keys(IndexScanDesc scan, int *new_numberOfKeys) * _bt_preprocess_array_keys_final() -- fix up array scan key references * * When _bt_preprocess_array_keys performed initial array preprocessing, it - * set each array's array->scan_key to the array's arrayKeys[] entry offset - * (that also work as references into the original scan->keyData[] array). + * set each array's array->scan_key to its scankey's arrayKeyData[] offset. * This function handles translation of the scan key references from the * BTArrayKeyInfo info array, from input scan key references (to the keys in - * scan->keyData[]), into output references (to the keys in so->keyData[]). + * arrayKeyData[]), into output references (to the keys in so->keyData[]). * Caller's keyDataMap[] array tells us how to perform this remapping. * * Also finalizes so->orderProcs[] for the scan. Arrays already have an ORDER @@ -2974,8 +2973,8 @@ _bt_preprocess_keys(IndexScanDesc scan) /* * Now that we've built a temporary mapping from so->keyData[] (output - * scan keys) to scan->keyData[] (input scan keys), fix array->scan_key - * references. Also consolidate the so->orderProc[] array such that it + * scan keys) to arrayKeyData[] (our input scan keys), fix array->scan_key + * references. Also consolidate the so->orderProcs[] array such that it * can be subscripted using so->keyData[]-wise offsets. */ if (arrayKeyData) |