Indexing: Ensure that the database fields used in filter(), get(), and the fields you join on (foreign keys) are indexed
Defer fields: If there are large fields that aren't always needed (e.g., text fields with a lot of data), you can use .defer() to postpone loading. (or use only fields)
Evaluate Query Patterns: Look at the query patterns to see if select_related and prefetch_related are being used properly. (Sometimes overuse can lead to unnecessary data being retrieved.)
Database Profiling: Use Django Debug Toolbar maybe? or similar tools to learn where the bottlenecks are.
Batch to process data with iterator() to save on memory.
Optimize the database configuration settings.
Review complex filtering logic in the queryset and see if we can make it more simple.
Would've made this a commit, however, since it's just one TODO figured it'd be better as a task
The Function def get_queryset(self) in views.py (in api) (in the backend) is contributing heavily to the long wait times.
How can we optimize this in a way which would reduce loading times?