Re: [SQL] to do's? - Mailing list pgsql-sql

From Tom Lane
Subject Re: [SQL] to do's?
Date
Msg-id 19073.937403582@sss.pgh.pa.us
Whole thread Raw
In response to to do's?  (Clayton Cottingham <drfrog@smartt.com>)
List pgsql-sql
Clayton Cottingham <drfrog@smartt.com> writes:
> hi i was wondering if multi threading will be enabled soon?

Huh?  We already have multiple backends, what advantage would
there be to using threads?

> is that i have a 1.3 mil row db when i try to select all i get memory
> out type errors, either system wide or droping the backend

The problem is probably at the application end --- libpq is built on
the model that it can collect the entire query result in memory and
then give the application random access to that array.  So if the
query result won't fit in the space available to the application,
trouble.  I don't see why this would affect anything else in your
system, though, unless the app uses up all available swap space and
holds it for a while before crashing...

What you probably want to do instead of a straight SELECT is use
DECLARE CURSOR and FETCH to retrieve the table a few dozen/hundred
rows at a time.
        regards, tom lane


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] BUG with UNIQUE clause
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Permission problem with COPY FROM