This has probably been asked before, but I'll re-ask to spark debate on it again.
Is there any good reason to not have explain analyze also include information if temporary files will be required on
sorts,hashes, etc. during the processing of a query. [Idea being setting your sort_mem won't be purely anecdotal]...
maybeinclude how much space it needed in temp files?
something along the lines of:
Sort (Cost=1..10) (Actual=1..1000) (Temp Files=5MB)
Seeing that and looking at your current sort_mem and seeing it is 4MB you'll have the info you need to get a nice boost
byavoiding that spill at a low cost.
--
Jeff Trout <jeff@jefftrout.com>
http://www.jefftrout.com/
http://www.stuarthamm.net/