Thank you for your reply, Rick.
I think the indexes I noticed could be added to core. It would depend if it is moodle core or an addition from a developer working for the school. Probably the former.
Regarding partitioning, it would be nice if that would be added up front to be honest, but its up to moodle itself to decide.
The place I am at the moment has in fact has a lot of issues with submissions. I made a recommendation to the my.cnf, but please note that it has not been implemented yet.
I would say though, that I have gone over it very carefully and tuned it to their use case:
innodb_buffer_pool_size = 12G ### How much innodb data to store in memory. Higher = faster performance
innodb_file_per_table = 1 ### Each innodb table is its own file on disk.
innodb_flush_log_at_trx_commit = 2 ### Flushes to disk in batches instead of per change
innodb_io_capacity = 800 ### Min IO speed expected to write to disk.
read_buffer_size = 2M ### Helps with reading temp tables faster, bulk inserts and nested queries
read_rnd_buffer_size = 8M ### Helps with multi range queries and ORDER Bys.
sort_buffer_size = 8M ### Helps with ORDER BY queries, which we have a lot of.
table_open_cache = 4096 ### Cache data about open tables. Saves reopening tables.
thread_cache_size = 128 ### How many threads to cache. Can help reduce thread count.
thread_stack = 256k ### How much cache each thread can have. Higher = more complicated results are cached
tmp_table_size = 64M ### Max size a tmp table can be.
innodb_flush_method = O_DIRECT ## Innodb flushes to table files directly
innodb_log_file_size = 512M ##
innodb_log_files_in_group = 3 ##
innodb_read_io_threads = 8 ## innodb background threads for reads. Helps with reads
join_buffer_size = 2M ## Helps when a join doesn’t have an index or an index wont be more helpful than a full table scan
max_heap_table_size = 64M ## Max size a tmp table can be in memory
query_cache_limit = 2M ##
query_cache_min_res_unit = 2048 ##
query_cache_size = 196M ##
query_cache_type = 1 ## Caches complete query results. Data gets invalidated when underlying tables are changed.
table_open_cache_instances = 8 ## Divides the table cache to reduce contention
table-definition-cache = 4096 ## Stores table definitions - .frm files
key_buffer_size = 16M # As there are no MyISAM tables, this variable helps with MyISAM temp tables.
back_log = 1500 # When MySQL gets a lot of connections in a short time, it will keep them in a back log
innodb_purge_threads = 2 # May reduce locks for when updates/deletes are run often (like sessions table)
innodb_sort_buffer_size = 2M # Helps with index changes and create table statements
#innodb_page_cleaners = 4 # Will help with start up and shutdown in 5.7