Sorting the number of mysql subquery statistics causes the query to be too slow

select id, (select sum ( test_field ) from test2 where test_id = test2_id) as total from test order by total limit 5
does a sql like this cause slowness? is there any solution

Oct.16,2021

you have only one piece of data in this query. Why do you still use subqueries and order by??


well, that's all I can write.


use JOIN

Menu