Is the tuplestore basically just an array of ItemPointer-s? In mean, it's not a copy of each entire row, is it?
Yup, it is copied:
src/backend/utils/sort/tuplestore.c:tuplestore_puttuple() 8<-------------------------------------------------------- /* * Accept one tuple and append it to the tuplestore. * * Note that the input tuple is always copied; the caller need not save * it. 8<--------------------------------------------------------
Joe
---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend