innodb_buffer_pool_size is the setting that matters

Almost every MySQL tuning guide lists forty variables, and on a dedicated server the first one accounts for most of the difference.

SELECT ROUND(SUM(data_length + index_length)/1024/1024) AS total_mb
FROM information_schema.tables
WHERE table_schema NOT IN ('mysql','information_schema','performance_schema','sys');

SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_read%';
-- hit rate = 1 - (reads / read_requests)

SET GLOBAL innodb_buffer_pool_size = 12884901888;   -- resizable since 5.7

The rule of thumb is 60-70% of RAM on a dedicated database server and considerably less on a machine also running PHP — the default of 128 MB is a value chosen so MySQL starts anywhere. A hit rate below 99% under normal load means the working set does not fit, which is worth knowing before optimising any individual query. Being dynamically resizable means the experiment costs a command rather than a restart.