Re: [PERFORM] Correct use of cursors for very large result sets in Postgres
От
Mike Beaton
Тема
Re: [PERFORM] Correct use of cursors for very large result sets in Postgres
Дата
Msg-id
CAHzAAWSRPmJLqoKwkCndBH-U=moULwV=o=NTd=pcoEkHvD9kyw@mail.gmail.com
Ответ на
Список
Дерево обсуждения
[PERFORM] Correct use of cursors for very large result sets in Postgres Mike Beaton <mjsbeaton@gmail.com>
Re: [PERFORM] Correct use of cursors for very large result sets in Postgres Mike Beaton <mjsbeaton@gmail.com>
Re: [PERFORM] Correct use of cursors for very large result sets in Postgres Tom Lane <tgl@sss.pgh.pa.us>
Re: [PERFORM] Correct use of cursors for very large result sets in Postgres Mike Beaton <mjsbeaton@gmail.com>
Re: [PERFORM] Correct use of cursors for very large result sets in Postgres Tom Lane <tgl@sss.pgh.pa.us>
Re: [PERFORM] Correct use of cursors for very large result sets in Postgres Mike Beaton <mjsbeaton@gmail.com>
Re: [PERFORM] Correct use of cursors for very large result sets in Postgres Tom Lane <tgl@sss.pgh.pa.us>
Re: [PERFORM] Correct use of cursors for very large result sets in Postgres Mike Beaton <mjsbeaton@gmail.com>
Re: [PERFORM] Correct use of cursors for very large result sets inPostgres John Gorman <jgorman@eldocomp.com>
Re: [PERFORM] Correct use of cursors for very large result sets in Postgres Vitalii Tymchyshyn <vit@tym.im>
Re: [PERFORM] Correct use of cursors for very large result sets inPostgres John Gorman <jgorman@eldocomp.com>
Re: [PERFORM] Correct use of cursors for very large result sets in Postgres Mike Beaton <mjsbeaton@gmail.com>
Re: [PERFORM] Correct use of cursors for very large result sets in Postgres Mike Beaton <mjsbeaton@gmail.com>
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.
This is regardless of how many rows I actually stream from thE connection before closing the cursor.
В списке pgsql-performance по дате отправления
От: Tom Lane
Дата: