Prevent a temporary DB table caused by SQL group by

Code
-- tested with MySQL 5.6

-- Missing index. Filesort and tmp table using more memory
EXPLAIN SELECT name, status, SUM(price)
  FROM history
    GROUP BY name, status;

-- index (name, status)
EXPLAIN SELECT name, status, SUM(price)
  FROM history
  GROUP BY name, status;
Result
idselect_typetablepartitionstypepossible_keyskeykey_lenrefrowsfilteredExtra
1SIMPLEhistorynullALLnullnullnullnull1407100.00Using temporary


idselect_typetablepartitionstypepossible_keyskeykey_lenrefrowsfilteredExtra
1SIMPLEhistorynullindexname_status_idxname_status_idx771null1407100.00null


Used Versions
PHP 8.0, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8