Skip to content

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

@djanderson

Description

@djanderson

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions