Yeah I'm well aware, thanks. I'm also well aware that "select id from
foo limit 10; select * from foo where id='1'; select * from foo where
id='2'; etc" will never be fast. I'm all for saving memory. But most of
the time I just want to output a page in under 5 seconds.

Also this methodology assumes that either your SQL server and webserver
share the same memory or the SQL server is otherwise short of memory. In
my experience this is rarely the case. Even on shared servers the SQL
server is free to have over 80% of the available memory.

-Rob

Joost Moesker wrote:
>>From the SQLObject documentation:
> 
> "Select results are generators, which are lazily evaluated. So the SQL
> is only executed when you iterate over the select results, or if you
> use list() to force the result to be executed. When you iterate over
> the select results, rows are fetched one at a time. This way you can
> iterate over large results without keeping the entire result set in
> memory. You can also do things like .reversed() without fetching and
> reversing the entire result -- instead, SQLObject can change the SQL
> that is sent so you get equivalent results.
> 
> You can also slice select results. This modifies the SQL query, so
> peeps[:10] will result in LIMIT 10 being added to the end of the SQL
> query. If the slice cannot be performed in the SQL (e.g., peeps[:-10]),
> then the select is executed, and the slice is performed on the list of
> results. This will generally only happen when you use negative
> indexes."
> 
> 
> > 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to