Re: psql client memory usage

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Tim Kane" <tim(dot)kane(at)gmail(dot)com>
Cc: "pgsql-general General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql client memory usage
Date: 2013-09-06 12:49:41
Message-ID: 086aeda2-3b30-4bbe-b773-4eb0ead08921@mm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tim Kane wrote:

> 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

See psql's FETCH_COUNT. From the manpage:

FETCH_COUNT
If this variable is set to an integer value > 0, the results
of
SELECT queries are fetched and displayed in groups of that
many
rows, rather than the default behavior of collecting the
entire
result set before display. Therefore only a limited amount of
memory is used, regardless of the size of the result set.

Best regards,
--
Daniel
PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2013-09-06 13:08:46 Re: Old record migration to another table made the db slower
Previous Message Tim Kane 2013-09-06 12:06:23 psql client memory usage