From: | Alex Hunsaker <badalex(at)gmail(dot)com> |
---|---|
To: | Yang Zhang <yanghatespam(at)gmail(dot)com> |
Cc: | Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: Sorting performance vs. MySQL |
Date: | 2010-02-23 06:49:13 |
Message-ID: | 34d269d41002222249u6b61e93fp7012b9d33c64b715@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Mon, Feb 22, 2010 at 22:51, Yang Zhang <yanghatespam(at)gmail(dot)com> wrote:
> vmstat showed no swapping-out for a while, and then suddenly it
> started spilling a lot. Checking psql's memory stats showed that it
> was huge -- apparently, it's trying to store its full result set in
> memory. As soon as I added a LIMIT 10000, everything worked
> beautifully and finished in 4m (I verified that the planner was still
> issuing a Sort).
Well im half surprised no one has recommend using a cursor. Have you
looked in to that? I bet that would fix most of your problems here.
>
> 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.
Well AFAIK it will dump everything you asked for. So if you said
select * from 1G table; It should take at least 1G and potentially
quite a bit more formatting and overhead.
From | Date | Subject | |
---|---|---|---|
Next Message | Yang Zhang | 2010-02-23 07:02:33 | Re: Sorting performance vs. MySQL |
Previous Message | Scott Marlowe | 2010-02-23 06:48:25 | Re: Sorting performance vs. MySQL |