# MySQL Serverprobleme mit dem Select der Funktion getLastOrdersAction in Widgets.php

**URL:** <https://forum.shopware.com/t/mysql-serverprobleme-mit-dem-select-der-funktion-getlastordersaction-in-widgets-php/57998>\
**Category:** Programmierung\
**Tags:** widgets\
**Created:** [12. Februar 2019 um 11:31 UTC](https://forum.shopware.com/t/mysql-serverprobleme-mit-dem-select-der-funktion-getlastordersaction-in-widgets-php/57998 "2019-02-12T11:31:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![b3wii](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@b3wii](https://forum.shopware.com/u/b3wii)\
**Post date:** [12. Februar 2019 um 11:31 UTC](https://forum.shopware.com/t/mysql-serverprobleme-mit-dem-select-der-funktion-getlastordersaction-in-widgets-php/57998/1 "2019-02-12T11:31:27Z")

</div>

Hi, wir haben das Problem das sich der MySQL Prozess aufhängt wenn der Select der Funktion getLastOrdersAction der Datei \engine\Shopware\Controllers\Backend\Widgets.php ausgeführt wird.

MySQL EXPLAIN Statement:

 ![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/2/24401f29b08bd579c692ac0ac7ceb419054c78b0.png)

Es handelt sich um folgenden Select:

```
SELECT s_order.id AS id, currency,currencyFactor,firstname,lastname, company, subshopID, paymentID, ordernumber AS orderNumber, transactionID, s_order.userID AS customerId, invoice_amount,invoice_shipping, ordertime AS `date`, status, cleared
        FROM s_order
        LEFT JOIN s_order_billingaddress ON s_order_billingaddress.userID = s_order.userID
        WHERE
            s_order.status != -1

        AND
            ordertime >= DATE_SUB(now(),INTERVAL 14 DAY)
        GROUP BY s_order.id
        ORDER BY ordertime DESC
        LIMIT 20

```

Das Problem entsteht dadurch, dass wir sehr viele Bestellungen (122986) von einem Benutzer haben.
