Refine nbtree = redundancy preprocessing comment.

Spell out how a = key associated with a SAOP array renders a > key
against the same index column redundant at the relevant point inside
_bt_preprocess_keys.

Follow-up to commit 5bf748b8.
This commit is contained in:
Peter Geoghegan 2024-11-20 13:37:08 -05:00
parent 94131cd53c
commit 7074337698

View File

@ -2668,8 +2668,14 @@ _bt_preprocess_keys(IndexScanDesc scan)
/*
* If = has been specified, all other keys can be eliminated as
* redundant. If we have a case like key = 1 AND key > 2, we can
* set qual_ok to false and abandon further processing.
* redundant. Note that this is no less true if the = key is
* SEARCHARRAY; the only real difference is that the inequality
* key _becomes_ redundant by making _bt_compare_scankey_args
* eliminate the subset of elements that won't need to be matched.
*
* If we have a case like "key = 1 AND key > 2", we set qual_ok to
* false and abandon further processing. We'll do the same thing
* given a case like "key IN (0, 1) AND key > 2".
*
* We also have to deal with the case of "key IS NULL", which is
* unsatisfiable in combination with any other index condition. By