View Issue Details

IDProjectCategoryView StatusLast Update
0034042mantisbtperformancepublic2026-04-07 11:38
Reporterdregad Assigned Todregad  
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionfixed 
Target Version2.27.0Fixed in Version2.27.0 
Summary0034042: MantisGraph: inefficient calculation of data sets for Issue Trends graph
Description

The create_cumulative_bydate() function is executing simple SQL queries returning atomic data, and the PHP code has to loop over each row to compute the total number of reported and resolved Issues.

This can be achieved much more efficiently by refactoring the SQL to let the database server aggregate the data, resulting in much simpler and faster PHP code.

TagsNo tags attached.

Relationships

related to 0034041 closeddregad MantisGraph: last resolved issue not computed in Issue Trends graph 
related to 0035549 acknowledged MantisGraph APPLICATION ERROR 401 with SQLite 

Activities

dregad

dregad

2024-03-13 14:22

developer   ~0068652

PR https://github.com/mantisbt/mantisbt/pull/1975

dregad

dregad

2024-03-13 14:26

developer   ~0068653

Changing target to 2.27.0 as the fix relies on PHP 7.4 syntax for heredocs, and I can't be bothered to make 2 versions of the fix...

Related Changesets

MantisBT: master f109d15d

2024-03-13 14:13

dregad


Details Diff
Optimize create_cumulative_bydate() function

Until today, the function was executing simple SQL queries returning
atomic data, and PHP code had to loop over each row to compute the total
number of reported and resolved Issues.

This reports the effort to aggregate the data on the database server,
greatly simplifying the PHP code

It also fixes a bug where the last resolved issue was sometimes not
computed, resulting in an incorrect result set.

Fixes 0034041,0034042
Affected Issues
0034041, 0034042
mod - plugins/MantisGraph/core/graph_api.php Diff File