Re: wat is the max number of rows that can be returned

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: wat is the max number of rows that can be returned
Дата
Msg-id 14937.1039020946@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: wat is the max number of rows that can be returned  (Joel Burton <joel@joelburton.com>)
Ответы Re: wat is the max number of rows that can be returned  (Ron Johnson <ron.l.johnson@cox.net>)
Список pgsql-novice
Joel Burton <joel@joelburton.com> writes:
> And you're wondering what will happen if you write a query that returns
> more than 2 billion rows (2000 million)?

The first thing that will happen is that you'll run out of memory in the
client process to store all those rows in your PGresult.

You can handle ridiculously-large query results by opening a cursor
and fetching reasonable-sized chunks with FETCH; it might take awhile
but in theory you could process an indefinitely large result that way.

I don't think the int-sized result of PGntuples is going to be a issue
in the foreseeable future --- platforms that could hold >2G tuples are
no doubt going to use a wider size of int.

            regards, tom lane

В списке pgsql-novice по дате отправления:

Предыдущее
От: Joel Burton
Дата:
Сообщение: Re: wat is the max number of rows that can be returned
Следующее
От: Dmitri Touretsky
Дата:
Сообщение: Re: Rép. : Very slow performance