View Issue Details

IDProjectCategoryView StatusLast Update
0037492mantisbtapi restpublic2026-11-06 08:23
Reporterkhushal Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Summary0037492: GET /api/rest/issues runs the same DB queries again for every issue in the page
Description

GET /api/rest/issues loads the data of each issue in the page one by one:
bug text, attachments, notes, relationships, monitors and history.
So the number of DB queries grows with the page size, and a page of
50 issues runs hundreds of queries.

Some queries are also repeated in the same request:

  • tag_get_by_name() runs once for every tag line in the history,
    even for the same tag.
  • When a project has no custom fields, an empty list is passed to
    custom_field_cache_array_rows(), which then loads all custom fields.

What needs to change:

  • Load the data of all issues in the page at once, only for the
    requested fields.
  • Cache tags found by tag_get_by_name() for the request.
  • Skip loading custom fields when the project has none.
  • Clear these caches whenever the data is written, so a write is
    seen by the next read.

The response must stay the same. The web UI would also get faster,
because the caches would be in the core APIs.

TagsNo tags attached.

Activities