when I add this subquery in Commessa table:
.....
(SELECT ROUND(SUM(orario.durata))
FROM orario
WHERE orario.commessa = commessa.commessa) AS Ore Impiegate
,
it works correctly in Commessa list, but it slow down the opening of Orario list.
The subquery itself, when added to a query involving the commessa table, should not inherently affect the speed of opening or querying a different table like orario: what is the cause?