Thread: pgsql: Refactor handling of nbtree array redundancies.
Refactor handling of nbtree array redundancies. Teach _bt_preprocess_array_keys to eliminate redundant array equality scan keys directly, rather than just marking them as redundant. Its _bt_preprocess_keys caller is no longer required to ignore input scan keys that were marked redundant in this way. Oversights like the one fixed by commit f22e17f7 are no longer possible. The new scheme also makes it easier for _bt_preprocess_keys to output a so.keyData[] scan key array with _more_ scan keys than it was passed in its scan.keyData[] input scan key array. An upcoming patch that adds skip scan optimizations to nbtree will take advantage of this. In passing, remove and rename certain _bt_preprocess_keys variables to make the difference between our input scan key array and our output scan key array clearer. Author: Peter Geoghegan <pg@bowt.ie> Reviewed-By: Tomas Vondra <tomas@vondra.me> Discussion: https://postgr.es/m/CAH2-Wz=9A_UtM7HzUThSkQ+BcrQsQZuNhWOvQWK06PRkEp=SKQ@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/b524974106acb05ae4f9c2178153c3ead72eaf04 Modified Files -------------- src/backend/access/nbtree/nbtutils.c | 210 +++++++++++++++++------------------ 1 file changed, 100 insertions(+), 110 deletions(-)