•  
      request #6866 Performance issue while displaying an artifact
    Infos
    #6866
    Nicolas Terray (nterray)
    2016-10-07 10:56
    2014-05-13 19:13
    6902
    Details
    Performance issue while displaying an artifact

    Opening an epic in a new tab takes over 13 seconds.

    From mysql seems the query is taking about 11s

    mysql> SELECT DISTINCT a.id as artifact_id, a.last_changeset_id, t.group_id, t.item_name as keyword, t.id as tracker_id FROM tracker_changeset_value_artifactlink AS artlink JOIN tracker_changeset_value AS cv ON (cv.id = artlink.changeset_value_id) JOIN tracker_artifact AS a ON (a.last_changeset_id = cv.changeset_id) JOIN tracker AS t ON (t.id = a.tracker_id) WHERE artlink.artifact_id = 134153;
    +-------------+-------------------+----------+-----------+------------+
    | artifact_id | last_changeset_id | group_id | keyword | tracker_id |
    +-------------+-------------------+----------+-----------+------------+
    | 150589 | 357020 | 506 | product | 3493 |
    | 150595 | 375499 | 506 | releases | 3494 |
    | 149312 | 346186 | 506 | Operation | 4099 |
    +-------------+-------------------+----------+-----------+------------+
    3 rows in set (11.20 sec)

    After analysis and experiments, we should add the following index:

    ALTER TABLE tracker_artifact ADD INDEX idx_changeset_tracker(last_changeset_id, tracker_id);

    This will take down the time taken to 0.01 sec.

    Trackers
    Empty
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Benjamin Dauton (bdauton_enalean)
    Closed
    Empty
    Attachments
    Empty
    References

    Follow-ups

    User avatar
    Integrated in Tuleap 7.0.99.14

    • Status changed from Under review to Closed
    • Assigned to changed from None to Benjamin Dauton (bdauton_enalean)