Re: Cursor behavior - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Cursor behavior
Date
Msg-id CA+TgmoaYmoXYeWxB3ZF4oEG73WunxyiBggA1p9X-kcpQimNyvQ@mail.gmail.com
Whole thread Raw
In response to Cursor behavior  (amit sehas <cun23@yahoo.com>)
Responses Re: Cursor behavior  (amit sehas <cun23@yahoo.com>)
List pgsql-hackers
On Thu, Dec 15, 2011 at 4:15 PM, amit sehas <cun23@yahoo.com> wrote:
> I had a question about the cursor internals implementation. When you Fetch next 'n' results without moving the
cursors,is this kind of functionality implemented by firstly executing the whole query and then moving the cursor over
theresults, or are the movements done on active database lookups, moving forward and backward... 

I think it depends on the query.  For example, I believe that a query
involving writeable CTEs will be run to completion before returning
any results, but I believe that a seqscan will not.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Page Checksums
Next
From: Robert Haas
Date:
Subject: Re: Cursor behavior