action #94667

Updated by tinita 4 months ago

## Motivation

The SQL to fetch the data is inefficient. For each item in the result set another `SELECT FROM job_settings` is executed. For that means about 2500 SELECTs currently.
Also the costly DateTime columns are fetched, although they are not needed.

## Acceptance criteria

* AC1: the number of SQL queries doesn't depend on the number of items in the table anymore
* AC2: Less columns are fetched

## Suggestions

* All three `/api/v1/products`, `/api/v1/machines`, `/api/v1/test_suites` are handled by the same code in `lib/OpenQA/WebAPI/Controller/API/V1/`
* Enable `DBIC_TRACE=1` environment variable to see all SQL
* Fetch the JobSettings data in one SELECT
* #93925 has a similar optimizations
* This could be a good task for someone not so familiar with DBIx::Class yet