Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 5DEA864FE47 for ; Tue, 2 Dec 2008 08:00:21 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 60744-02-2 for ; Tue, 2 Dec 2008 08:00:17 -0400 (AST) X-Greylist: delayed 00:06:41.296658 by SQLgrey-1.7.6 Received: from 42.mail-out.ovh.net (42.mail-out.ovh.net [213.251.189.42]) by mail.postgresql.org (Postfix) with SMTP id A7CC065022A for ; Tue, 2 Dec 2008 08:00:02 -0400 (AST) Received: (qmail 18675 invoked by uid 503); 2 Dec 2008 11:52:59 -0000 Received: from b6.ovh.net (HELO mail412.ha.ovh.net) (213.186.33.56) by 42.mail-out.ovh.net with SMTP; 2 Dec 2008 11:52:59 -0000 Received: from b0.ovh.net (HELO queue-out) (213.186.33.50) by b0.ovh.net with SMTP; 2 Dec 2008 11:53:17 -0000 Received: from par69-8-88-161-102-87.fbx.proxad.net (HELO soyouz) (88.161.102.87) by ns0.ovh.net with SMTP; 2 Dec 2008 11:53:17 -0000 Date: Tue, 02 Dec 2008 12:54:22 +0100 To: "Richard Huxton" , "Craig James" Subject: Re: Sort causes system to freeze From: PFC Cc: pgsql-performance@postgresql.org Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <8763maouy9.fsf@oxford.xeocode.com> <4934CC58.1050309@emolecules.com> <493506E8.8010304@archonet.com> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <493506E8.8010304@archonet.com> User-Agent: Opera Mail/9.62 (Linux) X-Ovh-Tracer-Id: 2426595774514136609 X-Ovh-Remote: 88.161.102.87 (par69-8-88-161-102-87.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|H 0.5/N X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200812/8 X-Sequence-Number: 32044 >> Maybe this is an obviously dumb thing to do, but it looked reasonable to >> me. > > Looks reasonable here too - except I'm not sure what I'd do with 2 > million rows of sorted table in my console. I'm guessing you're piping > the output into something. Probably it's psql that is choking from buffering the rows. If you want to fetch that huge amount of data into a user application, a CURSOR is the best way to do so.