Tom Lane <tgl@sss.pgh.pa.us> writes:
> On the whole I'm unconvinced that this is worth the trouble. One of the
> reasons for allowing people to move databases around is to determine
> where their temp files go.
The one scenario I would expect to see is having the temp files on filesystem
all to themselves separate from the database. So using the database's location
seems like it would never really satisfy that need.
Actually the sort algorithm postgres uses would be much more efficient if it
could get access to two or three locations guaranteed to be on different
spindles. Last I read the comments it talked about a three tape polyphase sort
emulated on a single tape. It's a _lot_ less efficient emulated on a single
tape than it would be on three separate tapes. And for large sorts drive
really do behave like tapes.
Personally I am inclined to think that sorting and hash table spills really
belong in a location specified completely separate from tablespaces.
Others may be thinking of this more in terms of enforcing resource quotas in
which case the current regime makes more sense. But from a performance point
of view the current system is pointless.
--
greg