On Monday, April 25, 2016 at 5:38:19 AM UTC-4, Pierre wrote:
>
> Hi everyone,
>
> I discovered this in the book:
>
>
> "The select method has an optional cacheable argument, normally set to 
> False. When cacheable=True the resulting Rows is serializable but The Rows 
> lack update_record and delete_record methods.
>
> If you do not need these methods you can speed up selects a lot by setting 
> the cacheable attribute:
>
>
> *rows = db(query).select(cacheable=True)*"
>
> what's the difference (what makes it faster) between a normal select and the 
> above select ?
>
>
It just takes less time to construct each Row object because it doesn't 
contain those extra attributes.
 

> given the dynamic nature of a database app is the caching mechanism reserved 
> for static/pseudo-static content ?
>
>
The "cacheable" argument doesn't actually do any caching, it just makes it 
so the resulting Rows object itself is cacheable (should you choose to 
cache it). It can still be useful to set cacheable=True for the increased 
speed, even if you aren't doing any caching.

Anthony 

 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to