paging through results with fetchmany()
Uzo Uzo <uzoechi-/[email protected]> Sun, 7 Nov 2004 09:41:50 -0800 (PST)
| Newsgroups | gmane.comp.python.db.pypgsql.user |
|---|---|
| Message-ID | <[email protected]> |
I return a set of results, which I break into multiple pages. This is how I have implemented, but I feel that it is too expensive in terms of execution. Is there anyway to tell PgSQL to start fetching from a particular number? c.execute(Query) c.fetchmany( (pagenum-1)*NumPerPage) # skip previous results c.fetchmany(NumPerPage) # fetch for page Uzo The Opportunity Gap Between what is and what could be exists a potential gap. This gap is an opportunity gap; With every passing of time, it closes. The gap becomes closed, when what was becomes what is, ... OR what was can no longer be what it could be. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com