Skip to content

Commit

Permalink
Manually define a different order field for listing identities to avo…
Browse files Browse the repository at this point in the history
…id performance issues (#177)
  • Loading branch information
matthewelwell authored Jul 9, 2021
1 parent 05e2da9 commit 01e5f72
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/environments/identities/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def get_queryset(self):
if search_query:
queryset = queryset.filter(identifier__icontains=search_query)

# change the default order by to avoid performance issues with pagination
# when environments have small number (<page_size) of records
queryset = queryset.order_by("created_date")

return queryset

def get_environment_from_request(self):
Expand Down

0 comments on commit 01e5f72

Please sign in to comment.