Re: out of memory error on 3 table join - Mailing list pgsql-general

From Jeff Davis
Subject Re: out of memory error on 3 table join
Date
Msg-id 1165881878.13508.12.camel@dogma.v10.wvs
Whole thread Raw
In response to Re: out of memory error on 3 table join  (Kirk Wythers <kwythers@umn.edu>)
List pgsql-general
On Mon, 2006-12-11 at 17:50 -0600, Kirk Wythers wrote:
> SELECT count (*) returns 33,061,700
>
> met_data=# SELECT count(*) FROM climate, sites, solar WHERE
> climate.id = sites.id AND solar.id = sites.id AND climate.year = 1999;
> ----------
> 33061700
> (1 row)
>
> However attempting the join
> met_data=# SELECT climate.year, solar.doy, sites.longname FROM
> climate, sites, solar WHERE climate.id = sites.id AND solar.id =
> sites.id AND climate.year = 1999;
>
> gives the error.
>
>
> psql(394) malloc: *** vm_allocate(size=396742656) failed (error code=3)
> psql(394) malloc: *** error: can't allocate region
> psql(394) malloc: *** set a breakpoint in szone_error to debug
> out of memory
>

That's a client-side error. Why are you trying to return 33M records to
the client?

Regards,
    Jeff Davis


pgsql-general by date:

Previous
From: Kirk Wythers
Date:
Subject: Re: out of memory error on 3 table join
Next
From: Glen Parker
Date:
Subject: PITR and moving objects between table spaces