GX-Bug #70464
Von Moritz Bunjes vor mehr als 1 Jahr aktualisiert
The Ajax request to load the orders on the orders page in the Gambio Admin is very slow when there are tens of thousands of orders.
The Method OrdersOverviewColumns::_getGroupOptions contains the SQL
```
$rows = $this->db->distinct()
->select('orders.customers_status AS id, orders.customers_status_name AS fallback_name, '
. 'customers_status.customers_status_name AS status_name')
->from('orders')
->join('customers_status',
'customers_status.customers_status_id = orders.customers_status',
'left')
->join('languages', 'languages.languages_id = customers_status.language_id', 'left')
->where('languages.languages_id',
$_SESSION['languages_id'])
->get()
->result_array();
```
which is slow because of a missing index for the fields orders.customers_status and orders.customers_status_name.
Solution:
```
ALTER TABLE `feature`.`orders` ADD INDEX `customers_status_index` (`customers_status`, `customers_status_name`);
```
For testing (review 2) just ensure that installer and updater create the index successfully.