Skip to content

Commit

Permalink
perf: remove unnecessary qs distinct call
Browse files Browse the repository at this point in the history
When filtering using Exists() there is no risk of introducing duplicate
rows.

http://localhost:8000/v1/opening_hours/?data_source=tprek&start_date=0w
&end_date=4w&page=3&page_size=10

Query time goes from 30-40 ms to <20 ms

refs: HAUKI-647
  • Loading branch information
voneiden committed Sep 12, 2024
1 parent bd8591a commit d8d9e77
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion hours/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,6 @@ def get_queryset(self, start_date=None):
),
),
)
.distinct()
.order_by("id")
)

Expand Down

0 comments on commit d8d9e77

Please sign in to comment.