Re: are cursors necessary?

From: Alex Satrapa <alex(at)lintelsys(dot)com(dot)au>
To: Mark Harrison <mh(at)pixar(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: are cursors necessary?
Date: 2003-12-05 02:45:23
Message-ID: 3FCFF143.2050300@lintelsys.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig O'Shannessy 2003-12-05 04:12:29 Re: How to obtain the real problem that avoids postgresql
Previous Message Roderick A. Anderson 2003-12-05 01:23:42 Groups vs. Roles