The request can be optimized? I have this SQL request:

SELECT 
    m.id, 
    IF(CURRENT_TIMESTAMP BETWEEN bc.start_date AND bc.expiration_date, FALSE, TRUE) AS hasFreeAccount, 
    CONCAT(e.id, ' - ', e.name) AS establishment, 
    bc.start_date, 
    bc.expiration_date
FROM establishment e 
    LEFT JOIN establishment_owner eo ON e.id = eo.establishment
    LEFT JOIN member m ON eo.member = m.id 
    LEFT JOIN business_command bc ON m.id = bc.member
WHERE eo.member = 103
    AND (bc.start_date &lt;= CURRENT_TIMESTAMP() OR bc.start_date is NULL)
    AND (bc.id NOT IN (
        SELECT bc.id 
        FROM member m 
            LEFT JOIN business_command bc on m.id = bc.member 
            INNER JOIN establishment_owner eo on m.id = eo.member 
        WHERE CURRENT_TIMESTAMP() &gt; bc.expiration_date 
            AND eo.member IN (SELECT m.id FROM member m LEFT JOIN business_command bc ON m.id = bc.member HAVING COUNT(m.id) &gt; 1)
    ) OR bc.id IS NULL);


With this Explain plan:


The request works, I just want to know if I can optimize it.
Looking at your original query, I see that the only static WHERE clause is

WHERE eo.member = 103


This being the case, you should make establishment_owner the main table in the query:

SELECT 
    m.id, 
    IF(CURRENT_TIMESTAMP BETWEEN bc.start_date AND bc.expiration_date, FALSE, TRUE) AS hasFreeAccount, 
    CONCAT(e.id, ' - ', e.name) AS establishment, 
    bc.start_date, 
    bc.expiration_date
FROM
    establishment_owner eo
    LEFT JOIN establishment e ON eo.establishment = e.id
    LEFT JOIN member m ON eo.member = m.id 
    LEFT JOIN business_command bc ON m.id = bc.member
WHERE eo.member = 103
    AND (bc.start_date &lt;= CURRENT_TIMESTAMP() OR bc.start_date is NULL)
    AND (bc.id NOT IN (
        SELECT bc.id 
        FROM member m 
            LEFT JOIN business_command bc on m.id = bc.member 
            INNER JOIN establishment_owner eo on m.id = eo.member 
        WHERE CURRENT_TIMESTAMP() &gt; bc.expiration_date 
            AND eo.member IN (SELECT m.id FROM member m LEFT JOIN business_command bc ON m.id = bc.member HAVING COUNT(m.id) &gt; 1)
    ) OR bc.id IS NULL);


In other words, LEFT JOIN from establishment_owner instead of establishment.