# Idea OP-8630 - Optimize usage of /api/v3/queries/XXX

Project: OpenProject
Status: new
URL: https://community.openproject.org/work_packages/OP-8630

## RICE

| Attribute | Value |
| --- | --- |
| Reach | 10.0 = Impacts the vast majority (~80% or greater) |
| RICE Score |  |
| Votes |  |

## Requires

_No work packages_

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |

## Details

| Attribute | Value |
| --- | --- |
| Roadmap |  |
| Date |  |
| Target versions | Wish List |
| Module |  |
| Priority | Medium |
| List | UX/UI |
| Interest by |  |
| Labels |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |

## Description

Related to <mention class="mention" data-id="36684" data-type="work_package" data-text="#36684">\#36684</mention> 

After more investigation, I found that on my relatively new machine, /api/v3/queries/XXX delivers after **more than 2 seconds** with only 120 tasks in the database. As a result, the paginator is not the primary problem for this size of the data.

However, I found that the retrieved JSON is extremely inflated, containing a lot of redundant data and initially invisible data.

lines of JSON data: 27929  
size of JSON data: 19.7 KB  
server time: 2.26 sec

**Analysis so far:**

A) Much of the redundant data consists of IDS and URLs. **Idea**: the client could use URL templates to reduce server side processing and also **lazily resolving URL templates on the client** would reduce workload there as well. Especially because 99% of the delivered URLs are **never used nor looked at**.

B) Invisible data consists of menu items, and form interaction data etc. **Idea**: only provide initially visible data first (table cells), then query remaining data (cf. A) in the background or/and when the user hovers certain lines/cells in order to query form URLs, etc.

Cheers,  
Sven
