I discovered why my smartgrid (and grids) were very slow. =

I had neglected to set searchable=False, sortable=False. With those options 
disabled (I need neither), performance is very good. It is the searchable 
option that is very costly.

It would probably be good to highlight this in the documentation!!!

On Monday, April 15, 2019 at 12:24:44 PM UTC-4, David Manns wrote:
>
>
> here is my smartgrid (simplified to show only essential pieces):
>
>     grid = SQLFORM.smartgrid(db.Members, linked_tables=['Affiliations'],
>                     constraints=dict(Members=query),
>                     deletable=False, details=False, editable=True, 
> create=True)
>  
>
> Members is a table with several thousand records.
> Affiliations is a table with a reference field back to Members; each 
> member generally has a small number of Affiliations.
> query on the Member table that selects a number of Members (generally a 
> few up to a few hundred).
>
> The page displays the subset of Members efficiently, with each selected 
> member including an edit button and an Affiliations link.
>
> As expected the edit button displays the individual Member record promptly.
>
> Clicking the Affiliations link does display the page showing the small 
> number of affiliations belonging to the member as one would expect, but 
> very slowly (order of 10 seconds in my test environment). It must be 
> retrieving all Affiliations and then filtering to rows belonging to the 
> member???
>
> I'm updating an aging implementation that uses legacy crud, as smartgrid 
> will allow me to greatly reduce the amount and complexity of controller 
> code, however the legacy implementation generates the equivalent page with 
> no apparent delay.
>

-- 
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