cacheable=True just creates a version of the Rows object that can be cached -- it lacks the update_record and delete_record functions for each record. As a result, it is somewhat faster to create. I don't think the grid uses the update_record and delete_record functions, so presumably the grid could benefit from setting cacheable=True (i.e., it would speed things up a bit).
Actual caching of the query results could also benefit the grid, as with any other queries. Of course, given that the grid involves pagination, a potential problem is having some pages cached and others fetched live, but not having them in sync (e.g., page 1 was cached but page 2 was fetched live after a table update, so some records are either missing or repeated on page 2). If the data are relatively static, though, this should not be an issue, and caching would be beneficial. Anthony On Thursday, August 30, 2012 6:38:27 AM UTC-4, Niphlod wrote: > > If only I had a penny every time in a changelog there is a "big number" > speedup and all users starts making questions.....I knew those "x% faster" > will have raised more questions than answers. > > SQLTABLE take the rows after they have been fetched. SQLTABLE is for > displaying results only. > > SQLFORM.grid or smartgrid take tables or queries, and the grid is in > charge to fetch those records (based on the parameters you use) for every > request. > The grids paginate, order, edit, create, export, find related tables, etc > etc etc. If you are going to use SQLFORM grids you can't "use" any > improvement regarding "the cache side". > > > > Il giorno giovedì 30 agosto 2012 12:05:55 UTC+2, Johann Spies ha scritto: >> >> I am afraid I do not understand you reasoning: >> >> I can do >> >> rows = db(db.sometable).select( >> cacheable=True, cache = (ram.cache,3600)) >> data = SQLTABLE(rows) >> >> or I can do >> >> query = db.sometable.id>0 >> data = SQLFORM.grid(query) >> >> or >> >> data = SQLFORM.smartgrid(db.sometable) >> >> and how do I use those improvements in the latter 2 cases. That is what >> I have asked in my first email. >> >> So what do you mean that it has nothing to do with grid/smartgrid where >> both of them run queries? >> >> Regards >> Johann >> >> >> >>> --