SharedTuplestore allows multiple participants to write into it and then read the tuples back from it in parallel. Each reader receives partial results.
For now it always uses disk files, but other buffering policies and other kinds of scans (ie each reader receives complete results) may be useful in future.
The upcoming parallel hash join feature will use this facility.
Author: Thomas Munro
ab9e0e718a Add shared tuplestores.
src/backend/storage/lmgr/lwlock.c | 2 +
src/backend/utils/sort/Makefile | 2 +-
src/backend/utils/sort/sharedtuplestore.c | 633 ++++++++++++++++++++++++++++++
src/include/storage/lwlock.h | 1 +
src/include/utils/sharedtuplestore.h | 60 +++
src/tools/pgindent/typedefs.list | 2 +
6 files changed, 699 insertions(+), 1 deletion(-)