You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using a forked version of Guardian 2.4.0 that lives in a private artifact repository. We forked Guardian because of two separate performance issues. The issue I am addressing in this Git Issue is related to the filter_perms_queryset_by_objects function. Some information about our application:
It appears that this is doing a full table scan. For users with global group permissions to view FirstTable ( OOTB Django perms, not guardian object level perms ) this query runs in <1s. However, for users with only object level perms ( group or user ) the following query takes >30s
We are using a forked version of Guardian 2.4.0 that lives in a private artifact repository. We forked Guardian because of two separate performance issues. The issue I am addressing in this Git Issue is related to the filter_perms_queryset_by_objects function. Some information about our application:
Database Version
Django Version
Django-Guardian Version
We are using Direct Foreign Keys for all User and Group Object Permissions
DRF Versions
The application has four tables that may be relevant to this issue:
After upgrading from 2.3.0 (fork) to 2.4.0 (fork) we noticed very poor performance with PATCH requests to FirstTable . The request went from taking roughly 2s to well over 30s. We traced the offending query to line 848 in shortcuts.py
https://github.com/django-guardian/django-guardian/blob/devel/guardian/shortcuts.py#L848
It appears that this is doing a full table scan. For users with global group permissions to view FirstTable ( OOTB Django perms, not guardian object level perms ) this query runs in <1s. However, for users with only object level perms ( group or user ) the following query takes >30s
The following change seems to drastically increase performance
We are going to issue a MR to change this
The text was updated successfully, but these errors were encountered: