Re: large resultset

Поиск
Список
Период
Сортировка
От Thom Brown
Тема Re: large resultset
Дата
Msg-id AANLkTimJPh6X78KS0rflYhLcldMtrIq8S4HfMVMKUJfS@mail.gmail.com
обсуждение исходный текст
Ответ на Re: large resultset  (vinny <vinny@xs4all.nl>)
Ответы Re: large resultset  (AI Rumman <rummandba@gmail.com>)
Список pgsql-php
On 15 June 2010 10:40, vinny <vinny@xs4all.nl> wrote:

On Tue, 15 Jun 2010 10:33:05 +0100, Thom Brown <thombrown@gmail.com>
wrote:
> On 15 June 2010 09:31, AI Rumman  wrote:
>  How to return large resutlset (almost 2 millions record) in php?
>
> Presumably this is so people can download results rather than display
> them in a browser?
>
> Here's a basic a raw version of what you can do:
>
> $db = pg_connect($connection_string);
>
> $results = pg_query($db, $query);
>
> while ($result = pg_fetch_array($results)
> {
>     echo implode("|", $result) . "\n"; //typo before
> }
>
> pg_close($db);
>
> Obviously that wouldn't do by itself, but it's quite simple to loop over
> a result set.
>
> Regards
>
> Thom
>

If that's the case surely you'd use some SQL to merge the data into one
long string and return it in a single record.
Looping over two million results is going to take a while, not to mention
quite a bit of memory.
v.


I don't understand.  Return all data as a single massive string?

Thom

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

Предыдущее
От: vinny
Дата:
Сообщение: Re: large resultset
Следующее
От: AI Rumman
Дата:
Сообщение: Re: large resultset