[web2py] Re: auth.has_permission(...) slow -- any way to speed this up?

2013-03-21 Thread Niphlod
So, basically you're doing get me 150K rows, put them in a list for each of them, query the db for permission if query doesn't return True, scan the 150K list and remove this instance Cycling 150K and removing from a list while checking surely will get your app killed. Firing one query for

[web2py] Re: auth.has_permission(...) slow -- any way to speed this up?

2013-03-21 Thread weheh
Not exactly. The fields in rows are indices into db.my_table. len(rows) is a small variable number, say around 8. But there it is, anyway. Thank you Mr. Niphlod. Good work! bad_rows = db((db.my_table.id.belongs(rows)) (auth.accessible_query('update', db.my_table,