diff --git a/src/backend/access/nbtree/nbtutils.c b/src/backend/access/nbtree/nbtutils.c index 8381027f4e..05f0d23dc0 100644 --- a/src/backend/access/nbtree/nbtutils.c +++ b/src/backend/access/nbtree/nbtutils.c @@ -2572,19 +2572,16 @@ _bt_preprocess_keys(IndexScanDesc scan) int *keyDataMap = NULL; int arrayidx = 0; - /* - * We're called at the start of each primitive index scan during scans - * that use equality array keys. We can just reuse the scan keys that - * were output at the start of the scan's first primitive index scan. - */ if (so->numberOfKeys > 0) { /* - * An earlier call to _bt_advance_array_keys already set everything up - * already. Just assert that the scan's existing output scan keys are - * consistent with its current array elements. + * Only need to do preprocessing once per btrescan, at most. All + * calls after the first are handled as no-ops. + * + * If there are array scan keys in so->keyData[], then the now-current + * array elements must already be present in each array's scan key. + * Verify that that happened using an assertion. */ - Assert(so->numArrayKeys); Assert(_bt_verify_keys_with_arraykeys(scan)); return; }