Forum OpenACS Development: Response to Permissions Performance

Collapse
Posted by Peter Alberer on

This might be known to others, but i noticed that one of the queries where i had to use ad_require_permission in a where clause got much faster when i reordered the different parts of the where clause.

I changed the where clause from
WHERE acs_permission__permission_p(lr_object_id,:user_id,'admin')='t' and lr_objects.restype='excs'
to
WHERE lr_objects.restype='excs' and acs_permission__permission_p(lr_object_id,:user_id,'admin')='t'
and the query got much faster (did use the function only on the smaller set where restype=excs).