From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | jtp <john(at)akadine(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: killed select? |
Date: | 2002-02-28 21:48:21 |
Message-ID: | 14991.1014932901@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-hackers |
jtp <john(at)akadine(dot)com> writes:
> A question was asked which i through to the database to see how it was
> able to handle the question at hand and it failed . . . after 50 minutes
> of processing it flopped to the ground killed: out of swap space.
My guess is that what actually bombed out was psql, which tries to
buffer the entire result of a query. (Well, actually it's libpq not
psql that does that, but anyway the client side is what's failing.)
I suspect that your query is insufficiently constrained and will return
many millions of rows --- are you sure you have the WHERE clauses right?
If you actually do need to process a query that returns gazillions of
rows, the best bet is to declare a cursor so you can fetch the result
in bite-size chunks, say a few hundred rows at a time.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Richard Emberson | 2002-03-01 00:30:49 | bulk insertions in PL/pgsql functions |
Previous Message | Andrew Sullivan | 2002-02-28 21:36:59 | vsnprintf and 64-bit Solaris 7 (was: abnormal exits) |
From | Date | Subject | |
---|---|---|---|
Next Message | Greg Sabino Mullane | 2002-02-28 22:23:46 | Database Caching |
Previous Message | Bruce Momjian | 2002-02-28 21:35:05 | Re: elog() patch |