Why does adding an index on a column containing a char version of a UUID decrease performance? I have a table with 3.5 million rows containing UUIDs in their ascii representation (so 36 chars) and an integer amount.
I need to SUM all amounts grouping by UUID, so the query is very simple:
SELECT uuid, SUM(amount) FROM table GROUP BY uuid;

results:

with an index on uuid: Time: 68.074s
without an index: Time: 8.188s

execution plan with index:
| id | select_type | table  | type  | possible_keys    | key      | key_len | ref    | rows    | Extra  |
+----+-------------+-----------------------------+-------+------------------+------------------+---------+
| 1  | SIMPLE      | amount | index | uuid_idx         | uuid_idx | 110     | &lt;null&gt; | 3424833 | &lt;null&gt; |
+----+-------------+-----------------------------+-------+------------------+------------------+---------+

execution plan without index:
| id | select_type | table  | type | possible_keys | key    | key_len | ref    | rows    | Extra                           |
+----+-------------+-----------------------------+------+---------------+--------+---------+--------+---------+-------------
| 1  | SIMPLE      | amount | ALL  | &lt;null&gt;        | &lt;null&gt; | &lt;null&gt;  | &lt;null&gt; | 3424833 | Using temporary; Using filesort |
+----+-------------+-----------------------------+------+---------------+--------+---------+--------+---------+-------------

Am I missing something or does an index on that column really dramatically decrease performance on that kind of query?
The EXPLAINs show that, with the index, it used the index.  That lead to jumping around:  Pick the next alphabetical UUID, reach into the table in random location for the rows to find the amounts to SUM up.
Without the index, it simply plowed through straight through the table, collecting data, then sorting in order to finish the task.
3.5M random lookups apparently takes longer than sorthing 3.5M rows.
Converging the UUID to BINARY(16) would shrink it, thereby helping a little.
Having INDEX(uuid, amount) would significantly speed up this query.  But still, the random nature of uuids is a performance drag.
Some related discussion:  http://mysql.rjweb.org/doc.php/uuid