Re: are cursors necessary?

Поиск
Список
Период
Сортировка
От Alex Satrapa
Тема Re: are cursors necessary?
Дата
Msg-id 3FCFF143.2050300@lintelsys.com.au
обсуждение исходный текст
Ответ на are cursors necessary?  (Mark Harrison <mh@pixar.com>)
Список pgsql-general
Mark Harrison wrote:
> Is this just to illustrate how to create transactions and cursors, or is
> there
> some material difference between trimming the program down  ...

But then you wouldn't be able to test that transactions, cursors and
queries work :)  And you wouldn't be able to thumb your nose at your
friends who use that *other* popular database ;)

For your own purposes, you would only use cursors where you're expecting
to get back lots of data. Cursors not only save client memory, they save
network bandwidth too - you might have 2GB of RAM in your machine that
can copy data around at a rate of hundreds of megabytes per second, but
transferring that much data over a 100Mbps network takes time.

If you're looking to make your database feel faster, it can be better to
transfer one bunch of rows at a time. You might have an interface that
shows one pageful of details at a time - this is ideal cursor fodder,
since PostgreSQL can feed you the results in exactly the quantities that
you need for your pages.

Just a thought for the day :)

Alex


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

Предыдущее
От: "Roderick A. Anderson"
Дата:
Сообщение: Groups vs. Roles
Следующее
От: "Craig O'Shannessy"
Дата:
Сообщение: Re: How to obtain the real problem that avoids postgresql