So, here's what you need: 2 subqueries and 2 cross joins with a counting table. I STILL do not know how to limit the number of results of a subquery, but this solution makes it work much faster, so the need for reduction is significantly reduced. ( limit is still not applicable.)
At first I found out about CROSS JOINs with table tables, thanks to my brother. With this, I was able to come up with this crazy solution. If someone knows the best way after considering my decision, please write:
SELECT us.name, gs.idGame, suggestion, count(suggestion) FROM ( SELECT u.idGame, u.name, SUBSTRING_INDEX(SUBSTRING_INDEX(u.name, ' ', nn), ' ', -1) AS user_substr FROM usergames u CROSS JOIN ( SELECT N FROM _tally ) n WHERE u.idGame IS NULL AND nn <= 1 + (LENGTH(u.name) - LENGTH(REPLACE(u.name, ' ', ''))) HAVING LENGTH(user_substr) > 1 ) us, ( SELECT idGame, g.name suggestion, SUBSTRING_INDEX(SUBSTRING_INDEX(g.name, ' ', nn), ' ', -1) AS game_substr FROM games g CROSS JOIN ( SELECT N FROM _tally ) n WHERE nn <= 1 + (LENGTH(g.name) - LENGTH(REPLACE(g.name, ' ', ''))) HAVING LENGTH(game_substr) > 1 ) gs WHERE user_substr NOT IN ( SELECT piece from _piecesrestricted ) AND game_substr NOT IN ( SELECT piece from _piecesrestricted ) AND ( LENGTH(user_substr)>3 OR user_substr = suggestion ) AND user_substr = game_substr GROUP BY suggestion, us.name ORDER BY us.name ASC, count(suggestion) DESC
source share