Re: Sorting performance vs. MySQL

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: Yang Zhang <yanghatespam(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Sorting performance vs. MySQL
Date: 2010-02-23 09:02:58
Message-ID: 407d949e1002230102u1a374386h7aa5502839b965f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Feb 23, 2010 at 6:48 AM, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> wrote:
>> I'm relieved that Postgresql itself does not, in fact, suck, but
>> slightly disappointed in the behavior of psql. I suppose it needs to
>> buffer everything in memory to properly format its tabular output,
>> among other possible reasons I could imagine.
>
> It's best when working with big sets to do so with a cursor and fetch
> a few thousand rows at a time.  It's how we handle really big sets at
> work and it works like a charm in keeping the client from bogging down
> with a huge memory footprint.
>

You can do \set FETCH_COUNT to have psql use a cursor automatically.

--
greg

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2010-02-23 09:15:31 Re: typecaste object to array
Previous Message Albe Laurenz 2010-02-23 08:41:00 Explaining duplicate rows in spite of unique index