"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > ... ISTM there's far more use for copying from a query > result that just copying by index order.
Yeah. The other point is that it's entirely likely that an external sort will be faster than using an indexscan to produce the sorted order. If you instead create a command like COPY FROM (SELECT whatever FROM foo ORDER BY something) then you give the optimizer a chance at deciding what to do ... not that I promise it will get it right, but a fixed choice is certain to be wrong. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly