O MySQL 8 tem as funções de janela ! Portanto, você pode escrever sua consulta assim:
SELECT username,
count(sentSmsId) OVER (partition by userId)
FROM sentSmsTable
JOIN userTable ON userId = sentUserId;
SELECT username,
count(sentSmsId) OVER (partition by userId)
FROM sentSmsTable
JOIN userTable ON userId = sentUserId;