Tilo Schwarz <mail@tilo-schwarz.de> writes:
> Do you try to reuse tuples with a similar storage size (or something like
> that)
No. If we try to put a tuple on a page, and there's room there, we'll
store it. There is no intra-page fragmentation problem because we can
always reshuffle the tuples on a particular page --- this is what the
"page item pointer" overhead buys us.
Also, since any given file only holds tuples of a particular table,
there's already some degree of size-similarity present. This gets
pretty weak if some of the fields are of widely varying length, of
course, but I'm dubious that there's much gold to be mined by thinking
harder about which page we put a tuple on...
> Any pointers to documentation or into the source code are welcome!
The comments at the head of src/include/storage/bufpage.h might be
illuminating. Also see
http://www.ca.postgresql.org/users-lounge/docs/7.3/postgres/page.html
regards, tom lane