Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL query on /tasks/completed endpoint can be very slow #149

Open
djanderson opened this issue Jun 6, 2019 · 1 comment
Open

SQL query on /tasks/completed endpoint can be very slow #149

djanderson opened this issue Jun 6, 2019 · 1 comment

Comments

@djanderson
Copy link
Contributor

Django ORM queries were written naively for speed of development. At this point, it's probably worth spending the time to determine hot queries and tweaking them.

One of the worst offenders is /tasks/completed/{schedule_entry_name} when the entry holds a lot of acquisitions, for example a stepped_freq_tdomain_iq.

To test,

  • create 1 stepped_freq_tdomain_iq acquisition,
  • log into the browsable api root with debugging enabled (currently on by default, see docker-compose.yml -> DEBUG=true.
  • reload the API root page to see the django-debug-toolbar on the right
  • navigate to /tasks/completed/{schedule_entry_name} and note that this page takes a long time to load
  • use the SQL waterfall plot on django-debug-toolbar to analyze the query that took the most time
  • improve it
@djanderson
Copy link
Contributor Author

Screenshot from 2019-06-06 13-33-49

Screenshot from 2019-06-06 13-34-24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant