Adjust tuplesort API to have bitwise option flags
authorDavid Rowley <drowley@postgresql.org>
Mon, 4 Apr 2022 10:24:59 +0000 (22:24 +1200)
committerDavid Rowley <drowley@postgresql.org>
Mon, 4 Apr 2022 10:24:59 +0000 (22:24 +1200)
commit77bae396df3f6f883f58f1877b7c08eb3ebb6b63
tree9c44a5a2006b584aa5a408df392e87f939cb17f5
parent1b0d9aa4f728edfdff64c3a13fc52bb95f7fb860
Adjust tuplesort API to have bitwise option flags

This replaces the bool flag for randomAccess.  An upcoming patch requires
adding another option, so instead of breaking the API for that, then
breaking it again one day if we add more options, let's just break it
once.  Any boolean options we add in the future will just make use of an
unused bit in the flags.

Any extensions making use of tuplesorts will need to update their code
to pass TUPLESORT_RANDOMACCESS instead of true for randomAccess.
TUPLESORT_NONE can be used for a set of empty options.

Author: David Rowley
Reviewed-by: Justin Pryzby
Discussion: https://postgr.es/m/CAApHDvoH4ASzsAOyHcxkuY01Qf%2B%2B8JJ0paw%2B03dk%2BW25tQEcNQ%40mail.gmail.com
src/backend/access/gist/gistbuild.c
src/backend/access/hash/hashsort.c
src/backend/access/heap/heapam_handler.c
src/backend/access/nbtree/nbtsort.c
src/backend/catalog/index.c
src/backend/executor/nodeAgg.c
src/backend/executor/nodeIncrementalSort.c
src/backend/executor/nodeSort.c
src/backend/utils/adt/orderedsetaggs.c
src/backend/utils/sort/tuplesort.c
src/include/utils/tuplesort.h