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
1SIMPLEhistorynullALLnullnullnullnull1407100Using temporary


idselect_typetablepartitionstypepossible_keyskeykey_lenrefrowsfilteredExtra
1SIMPLEhistorynullindexname_status_idxname_status_idx771null1407100null


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