Inefficient query to get data makes component slow

Issue #137 resolved
Alastair Mair created an issue

The query that is sent to the Jira instance to do the search is unnecessarily complex since it fetches full issue details when all that is required is the ‘total’ field from the JSON response. This makes complex charts very slow to load

  1. The query sets max results to 100, when the results data itself is not required for the chart
  2. The query returns nearly all fields for each issue (and can even request expansions to get additional fields) making the response even larger

By setting maxResults to 1 and fields to key in the query params a simple response like below is obtained

{
    "expand": "names,schema",
    "startAt": 0,
    "maxResults": 1,
    "total": 777,
    "issues": [
        {
            "expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
            "id": "124313",
            "self": "https://{{site}}.atlassian.net/rest/api/2/issue/124313",
            "key": "XXX-5563"
        }
    ]
}

Data required to create the chart should just be the “total” and this responds significantly quicker

Comments (3)

  1. boydo repo owner

    @Alastair Mair Thank you for raising this. I’ve made the change and deployed it.
    I’m not convinced it will improve performance, as the Jira APIs are rate-limited by request / sec, but there’s no reason not to make this improvement. Thanks!

  2. Alastair Mair reporter

    Excellent stuff. I accept the point about rate limiting, but I still think this will help with larger queries as I could see the requests queuing because of the amount of data that was being transferred between Atlassian and the user’s browser.

  3. Log in to comment