Re: reducing IO and memory usage: sending the content of a table to multiple files

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: reducing IO and memory usage: sending the content of a table to multiple files
Дата
Msg-id dcc563d10904021954w7923db0bne1df993b8b69d055@mail.gmail.com
обсуждение исходный текст
Ответ на Re: reducing IO and memory usage: sending the content of a table to multiple files  (Sam Mason <sam@samason.me.uk>)
Список pgsql-general
On Thu, Apr 2, 2009 at 7:05 PM, Sam Mason <sam@samason.me.uk> wrote:
> On Thu, Apr 02, 2009 at 09:48:33PM +0200, Ivan Sergio Borgonovo wrote:
>> I didn't find any elegant example of cursor use in PHP... OK PHP is
>> not the most elegant language around... but still any good exapmle
>> someone could point me at?
>
> I don't program PHP; but my guess would be something like:
>
>  pg_query("BEGIN;");
>  pg_query("DECLARE cur CURSOR FOR SELECT * FROM t1;");
>  while (pg_num_rows($result = pg_query("FETCH 1000 FROM cur;")) > 0) {
>    while($row = pg_fetch_array($result)) {
>    }
>  }
>  pg_query("COMMIT;");

I've done something similar and it worked just fine.

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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: slow select in big table
Следующее
От: itishree sukla
Дата:
Сообщение: Re: Hello, i want to subscribe...