Skip to content

fix: optimize the number of queries in the serializers and queryset

Imane Messak requested to merge query_optimization into dev
  • Changes in connection.py:
    • Optimizes database queries by prefetching related created_by objects in the queryset of ConnectionViewset
    • Efficiently retrieves the related credential object for the current user by prefetching the associated user object in get_credential (same for get_last_edited_time)
    • Caches and retrieves serialized representations in to_representation based on the instance's primary key to optimize performance and reduce redundant serialization computations.
  • re-adapt the queryset in DatalinksViewset
Edited by Imane Messak

Merge request reports