rtcharity / eahub.org

A global directory for effective altruists to connect
https://eahub.org
MIT License
18 stars 6 forks source link

Fix the optimization issue by replacing filter(is_publicly_visible=True) with the enum alternative #1245

Closed viktor-yunenko closed 3 years ago

viktor-yunenko commented 3 years ago

The call Profile.objects.filter(is_publicly_visible=True) loads each object in RAM before executing the function is_publicly_visible, instead to generate a single query it must use direct enum objects, eg Profile.objects.filter(visibility=Visibility.PUBLIC).

viktor-yunenko commented 3 years ago

handled