"Jim C. Nasby" <decibel@xxxxxxxxxxx> writes: > On Sun, Jan 30, 2005 at 08:50:49PM +1100, Neil Conway wrote: >> Do you have any thoughts on how to improve it? > See http://archives.postgresql.org/pgsql-general/2003-06/msg01072.php > and http://archives.postgresql.org/pgsql-general/2003-06/msg01089.php All of this falls down on twin problems: (1) we have no portable way to find out how much RAM is really available, and (2) the planner has to make a cost estimate for the sort in advance of actual runtime --- which requires making some assumption about the value of sort_mem that will be used. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your message can get through to the mailing list cleanly