amschaal / bioshare

MIT License
6 stars 2 forks source link

Improve Share API performance with prefetch #20

Open amschaal opened 8 years ago

amschaal commented 8 years ago

Try to use prefetch_related to get the users and groups that have permission for a Share. Currently, each share queries both individually. That makes at least 2 queries for every share listed.

This stack overflow may be of help: http://stackoverflow.com/questions/28127135/is-django-prefetch-related-supposed-to-work-with-genericrelation