Re: [PERFORM] Correct use of cursors for very large result sets in Postgres - Mailing list pgsql-performance

From Mike Beaton
Subject Re: [PERFORM] Correct use of cursors for very large result sets in Postgres
Date
Msg-id CAHzAAWSRPmJLqoKwkCndBH-U=moULwV=o=NTd=pcoEkHvD9kyw@mail.gmail.com
Whole thread Raw
In response to Re: [PERFORM] Correct use of cursors for very large result sets in Postgres  (Mike Beaton <mjsbeaton@gmail.com>)
List pgsql-performance
The generated buffer is 140MB, not 14MB. At 14 bytes per row, that makes sense.

I have done another test.

If I execute `FETCH ALL FROM cursor` I get a 140MB disk buffer file, on the PostgreSQL server, reported in its log.

If I execute `FETCH 5000000 FROM cursor` (exactly half the rows), I see a 70MB disk buffer file.

This is regardless of how many rows I actually stream from thE connection before closing the cursor.

pgsql-performance by date:

Previous
From: Diego Vargas
Date:
Subject: [PERFORM] Query Performance
Next
From: Tom Lane
Date:
Subject: Re: [PERFORM] Correct use of cursors for very large result sets in Postgres