stable

Clone or download

Read-only

request #28875 Improve burnup performances

According to blackfire ananlysis [0], burnup display can take a large amount of time for release burnup: We can see in analysis that 4m5s are spend in method `searchLinkedArtifactsAtGivenTimestamp` An explain on query show that something is goin wrong on table plugin_agiledashboard_planning: | 1 | SIMPLE | plugin_agiledashboard_planning | NULL | index | idx | idx | 8 | NULL | 2 | 50.00 | Using where; Using index; Using join buffer (Block Nested Loop) | I tried to add an index on plugin_agiledashboard_planning, but it worse the issue instead of improving performances I also tried to add the reverse index (planning_tracker_id, id) without any performances improvement When I tried to force index usage, the explain[1] looks good, but the query is still slow When we execute the query without the `INNER JOIN` but with a `IN` with configured tracker, execution time of query is improved with a time who should solve the issue `491 rows in set (0.32 sec)` All tests have been done over a project where the burnup is computed on a backlog of ~500 elements that where added one by one (it seems that the number of changeset on the milestone artifact matters) [0] https://blackfire.io/profiles/69b40cdd-5fc6-43cc-bb80-fbd742c70ab6/graph?settings%5Bdimension%5D=wt&settings%5Bdisplay%5D=landscape&settings%5BtabPane%5D=nodes&selected=&callname=main%28%29&constraintDoc= [1] explain whith `USE INDEX` | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+-------------+------------------------------------------------+------------+--------+--------------------------------------------+---------------------+---------+------------------------------------------------------------------+------+----------+------------------------------------+ | 1 | SIMPLE | parent_art | NULL | const | PRIMARY,idx_tracker_id,idx_id_changeset_id | PRIMARY | 4 | const | 1 | 100.00 | NULL | | 1 | SIMPLE | tracker | NULL | const | PRIMARY | PRIMARY | 4 | const | 1 | 100.00 | NULL | | 1 | SIMPLE | f | NULL | ref | PRIMARY,idx_fk_tracker_id | idx_fk_tracker_id | 4 | const | 23 | 1.00 | Using index condition; Using where | | 1 | SIMPLE | plugin_agiledashboard_planning | NULL | ref | planning_tracker_id | planning_tracker_id | 4 | tuleap.f.tracker_id | 1 | 100.00 | Using where; Using index | | 1 | SIMPLE | plugin_agiledashboard_planning_backlog_tracker | NULL | ref | idx | idx | 4 | tuleap.plugin_agiledashboard_planning.id | 2 | 100.00 | Using index | | 1 | SIMPLE | linked_art | NULL | ref | PRIMARY,idx_tracker_id,idx_id_changeset_id | idx_tracker_id | 4 | tuleap.plugin_agiledashboard_planning_backlog_tracker.tracker_id | 108 | 100.00 | Using index | | 1 | SIMPLE | artlink | NULL | ref | PRIMARY,idx_reverse | idx_reverse | 4 | tuleap.linked_art.id | 647 | 100.00 | Using index | | 1 | SIMPLE | cv | NULL | eq_ref | PRIMARY,value_idx,idx_value_field_id | PRIMARY | 4 | tuleap.artlink.changeset_value_id | 1 | 10.00 | Using where | | 1 | SIMPLE | changeset1 | NULL | eq_ref | PRIMARY,artifact_idx | PRIMARY | 4 | tuleap.cv.changeset_id | 1 | 5.00 | Using where | | 1 | SIMPLE | changeset2 | NULL | ref | PRIMARY,artifact_idx | artifact_idx | 4 | const | 1181 | 10.00 | Using where; Not exists | Change-Id: Ieb7de9609fcab7345cba930b4c5b35fcd6ebeb10

Modified Files

Name
M plugins/agiledashboard/include/AgileDashboard/FormElement/Burnup.php +8 −11 Go to diff View file
M plugins/agiledashboard/include/AgileDashboard/FormElement/Burnup/CountElementsCalculator.php +7 −32 Go to diff View file
M plugins/agiledashboard/include/AgileDashboard/FormElement/BurnupCalculator.php +15 −39 Go to diff View file
M plugins/agiledashboard/include/AgileDashboard/FormElement/BurnupDataBuilder.php +21 −64 Go to diff View file
R plugins/agiledashboard/include/AgileDashboard/FormElement/BurnupDao.php Go to diff View file
M plugins/agiledashboard/include/AgileDashboard/FormElement/SystemEvent/SystemEvent_BURNUP_DAILY.php +25 −41 Go to diff View file
M plugins/agiledashboard/include/AgileDashboard/FormElement/SystemEvent/SystemEvent_BURNUP_GENERATE.php +33 −50 Go to diff View file
M plugins/agiledashboard/include/agiledashboardPlugin.php +12 −21 Go to diff View file
M plugins/agiledashboard/tests/rest/ArtifactsTest.php +3 −4 Go to diff View file
M plugins/agiledashboard/tests/unit/AgileDashboard/FormElement/Burnup/CountElementsCalculatorTest.php +34 −44 Go to diff View file
M plugins/agiledashboard/tests/unit/AgileDashboard/FormElement/BurnupCalculatorTest.php +14 −14 Go to diff View file
M plugins/agiledashboard/tests/unit/AgileDashboard/FormElement/BurnupDataBuilderTest.php +33 −40 Go to diff View file