Re: Modifying COPY TO

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
Cc: Dave Held <dave(dot)held(at)arrayservicesgrp(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Modifying COPY TO
Date: 2005-02-26 04:46:39
Message-ID: 18834.1109393199@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Jim C. Nasby" <decibel(at)decibel(dot)org> 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Hoffmann 2005-02-26 04:48:39 Re: Development Plans
Previous Message Andrew - Supernews 2005-02-26 04:07:41 Re: Modifying COPY TO