Re: number of rown in a cursor. - Mailing list pgsql-general

From Christoffer Gurell
Subject Re: number of rown in a cursor.
Date
Msg-id 20050124183816.GA29580@h55p111.delphi.afb.lu.se
Whole thread Raw
In response to Re: number of rown in a cursor.  (Scott Marlowe <smarlowe@g2switchworks.com>)
Responses Re: number of rown in a cursor.  (John DeSoi <desoi@pgedit.com>)
List pgsql-general
> yep.  This is because one of the advantages of a cursor is that it only
> runs partially and returns the first X rows for the fetch.  This keeps
> load down so that many cursors hitting the machine at once don't all
> materialize all their rows and chew up all that I/O, cpu, and memory.
> Unfortunately, one of the side effects of this methodology is that no
> one knows how many rows there really are until they've been fetched.

the thing is that i want to create a gui-widget that has the possibility
to show a large amount of data over a slow connection. My idea was that
i create a cursor and create a srollbar with the number of rows in the
cursor so the user can scroll and only fetch the rows displayed from the
cursor as the user releases the scrollbar.

If i understand right then the way to do this is: create the cursor,
move to the end to get the number of rows, move to the front. get data.
am i right? or is there a better way to achieve this ? perhaps with a
local view?



pgsql-general by date:

Previous
From: Jeff Davis
Date:
Subject: Re: disable trigger from transaction
Next
From: Tom Lane
Date:
Subject: Re: on update / on delete performance of foreign keys