On Sep 25, 12:02 pm, Tzury <[EMAIL PROTECTED]> wrote:
> > Why not just do:
>
> > results = list(select(...)) in those few cases where you want to have all
> > the items in any order?
>
> I guess my example was bad.
>
> Here is a better one: (real world) case of a result set, which contain
> 262144 records.
> In that case what I do is caching the list(select), and adding
> pagination mechanism at client side.
>
> While web.select takes no time,
> Calling list(select(...)) means running over all the records just for
> casting itterBetter to list.
>
> On new powerful laptop just list(select)) takes about 10 seconds!!
>
> Whereas end user may only use first 2 or 3 pages.

Do you think reading that much data into memory ist good practise.
I don't know which database your are using, but when I need paging,
I'm using OFFSET and LIMIT for the selects. The user can choose how
much rows per page and each request for the next page ist doing like:

web.select('the_table', offset=25, limit=25)

In this case the user has choosen to get 25 rows per page and has
requested the 2'nd page.
Of course you have to pass the offset along with the HTTP-Requests.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to