Re: psql client memory usage

From: Tim Kane <tim(dot)kane(at)gmail(dot)com>
To: Suzuki Hironobu <hironobu(at)interdb(dot)jp>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql client memory usage
Date: 2013-09-06 13:19:42
Message-ID: CE4F9423.20049%tim.kane@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Ahh. All these years (albeit sporadic), I never knew about FETCH_COUNT.
That makes sense. Thanks muchly.

On 06/09/2013 14:11, "Suzuki Hironobu" <hironobu(at)interdb(dot)jp> wrote:

>(13/09/06 21:06), Tim Kane wrote:
>> Hi all,
>>
>> I have a fairly simple query, running on a particularly large table.
>>For
>> illustration:
>>
>> echo "select * from really_big_table;" | psql my_database > /dev/null
>>
>>
>> When I monitor the memory usage of the psql session, it continually
>>grows.
>> In fact, for this particularly large table ­ it grows to the point of
>> consuming all swap, before the OOM killer takes steps to resolve it.
>> Clearly, this isn't what I'd like to happen.
>>
>>
>> My settings are:
>> Postgresql 9.1.9
>> work_mem = 256MB
>> effective_cache_size = 12GB
>> shared_buffers = 6GB
>>
>> I have 24GB physical ram to play with.
>>
>
>This is a client side problem (not server size).
>See the description of FETCH_COUNT, please.
>http://www.postgresql.org/docs/9.2/static/app-psql.html
>
>
>echo "select * from really_big_table;" | psql --variable=FETCH_COUNT=100
>my_database > /dev/null
>
>
>Regards,
>
>
>
>
>
>--
>Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
>To make changes to your subscription:
>http://www.postgresql.org/mailpref/pgsql-general

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Agustin Larreinegabe 2013-09-06 13:26:08 PK referenced function
Previous Message Michael Paquier 2013-09-06 13:16:42 Re: How to check if any WAL file is missing in archive folder