"Rance Hall" <ran...@gmail.com> wrote

I'm using python 3.1 with py-postgresql (located at
http://python.projects.postgresql.org/

I need to work through how best to paginate larger sql result sets.

Its usually best to do that at the SQL level by controlling the cursor.
I don't know PostGres but most SQL dialects allow you to control
the number of result rows returned to the cursor then fetch the next
group and the next etc. This will also potentially save a lot of network
bandwidth (you only fetch the results you need which may not be
all of them) and get your results back quicker for a big result set.

HTH,


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to